qid int64 10 74.7M | question stringlengths 15 26.2k | date stringlengths 10 10 | metadata list | response_j stringlengths 27 28.1k | response_k stringlengths 23 26.8k |
|---|---|---|---|---|---|
46,804,566 | I wrote this code to print all prime numbers between 3 and 'n' inputted by the user, but upon running, it produces nothing.
Can you please help?
```
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
for (int candidate = 3; candidate < n; ++candidate)
{
bool isPrime = tru... | 2017/10/18 | [
"https://Stackoverflow.com/questions/46804566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8794095/"
] | One thing you should know. For checking whether n is prime if we start checking by division operation then you shouldn't check more than `sqrt(n)`.
```
for (int candidate = 3; candidate < n; ++candidate)
{
bool isPrime = true;
for (int x = 2; x*x < candidate; x++)
{
if (cand... | 1. It's not recommended to use using namespace std; — because this imports all of the identifiers from std. See this question on [Stack Overflow](https://stackoverflow.com/q/1452721).
2. Should the end condition of the second loop be `candidate` instead of `n`, i.e.
```
for (int x = 2; x < candidate; x++)//not before ... |
201,357 | For which $a\in {\bf R}$ is $|x|^a$ differentiable at $x=0$ and what is the derivative there? | 2012/09/23 | [
"https://math.stackexchange.com/questions/201357",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/32940/"
] | **Hint:** Let $a\gt 1$. Calculate $\displaystyle\lim\_{x\to 0} \frac{|x|^a-0}{x-0}$. It is useful to work separately with the limit from the right and the limit from the left.
If $x\gt 0$, then $\dfrac{|x|^a-0}{x-0}=\dfrac{x^a}{x}=x^{a-1}$.
If $x\lt 0$, then $\dfrac{|x|^a-0}{x-0}=\dfrac{|x|^a}{-|x|}=-|x|^{a-1}$.
Now... | By definition, $f$ is called differentiable at the point $x\_0$, if its increment $Δf=f(x\_0+h)−f(x\_0)$ may be represented as $$f(x\_0+h)−f(x\_0)=f'(x\_0)h+α(x\_0,h),$$
where $\alpha$ satisfies
$|\alpha(x\_0,h)|=o(|h|),\quad h\rightarrow 0$. Thus is sufficient to write increment for $f(x)=|x|^\alpha$ at point $x\_0=0... |
8,075,248 | I want to write a macro to write a string, using the compile-time optimisation of knowing the length of a string literal. But I need to detect misuse, using pointers.
Here's what I mean:
```
void transmit(const char *data, int length);
#define tx_string(x) transmit((x), sizeof(x) -1)
void func(char *badmsg) {
tx_st... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8075248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14200/"
] | You can do this:
```
#define tx_string(x) transmit(x, strlen(x)) // No need for extra parentheses
```
GCC will optimize out the `strlen` call, and I'm sure other compilers will too. Don't waste your time on this stuff.
**Test file:**
```
#include <string.h>
void transmit(const char *, size_t);
#define tx_string(x)... | ```
#define tx_string(x) ("i came, i concatenated, i discarded " x, transmit((x), sizeof(x) - 1))
```
Not quite perfect because some joker could call tx\_string(+1) |
84,125 | All of a sudden, the power supply of a server started to smell real bad. One of the hot swappable power supply units died. We replaced it, booted up Windows Server 2003 to find out that 2 out of 4 drives in a RAID 5 configuration had died.
We're also getting MACHINE\_CHECK\_EXCEPTION BSOD's everyone once in a while.
... | 2009/11/12 | [
"https://serverfault.com/questions/84125",
"https://serverfault.com",
"https://serverfault.com/users/24088/"
] | Although it shouldn't happen with a well designed power supply the reality is that this does happen all too often. As the unit is dying it may lose voltage regulation capability, resulting in over-voltage power being supplied to the machine. If you've good cooked drives as a result you need to be prepared for other com... | While it's possible that a bad power supply could potentially damage components I think this is unlikely. If the two drives were the only two drives on a particular power line then I would suspect that the power supply may have sent more than 12v down that line. Otherwise it's probably more likely that you had a few ba... |
22,207,256 | I began making changes to my codebase, not realizing I was on an old topic branch. To transfer them, I wanted to stash them and then apply them to a new branch off of master. I used `git stash pop` to transfer work-in-progress changes to this new branch, forgetting that I hadn't pulled new changes into master before cr... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22207256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/807674/"
] | ```
git checkout -f
```
must work, if your previous state is clean.
CAUTION: Beware–you'll lose all untracked changes to your files. | If you're like me and had **unstaged changes that you want to preserve**, you can avoid losing that work by checking out a known stable version of each individual file from the `stash`. Hopefully those files are different than the ones you were working on. Also, this is why we use small commits as we go, dumb dumb.
``... |
58,601,833 | I'm fresh to GCP and i'm using my company's billing. But i'm not sure if I do those tutorial, it will cost money or not.
[enter image description here](https://i.stack.imgur.com/j6e8Q.png)
So this is one of the tutorial about App Engine Quickstart. It will need to deploy an python app balabalabala.
My question is, ... | 2019/10/29 | [
"https://Stackoverflow.com/questions/58601833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10779399/"
] | Google Cloud Platform (GCP) provides a free tier for [12-months with $300 credits](https://cloud.google.com/free/docs/gcp-free-tier) to spend, also in this documentation you can check the limits. Furthermore, you can spend this credits in any GCP product. | >
>
> >
> > GCP Free Tier
> > The Google Cloud Platform Free Tier gives you free resources to learn about Google Cloud Platform (GCP) services by trying them on your own. Whether you're completely new to the platform and need to learn the basics, or you're an established customer and want to experiment with new sol... |
24,800,843 | Is there any difference between two `SELECTs` from database or single `SELECT with LEFT Join`?
I am limited by number of queries per hour and I am developing my own application.
`"SELECT * FROM table"` represents one query?
`"SELECT * FROM table LEFT JOIN another_table ON table.column=another_table.column2'"` repres... | 2014/07/17 | [
"https://Stackoverflow.com/questions/24800843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2571001/"
] | If you have limited number of queries, than `LEFT JOIN` is better, since it's only one query (one connection to database). And yes, `UPDATE`, `INSERT`, `DELETE` is queries too. But You can insert multiple entries with single query. | Yes, joining tables is one query. Splitting that query and executing separately will take more time. |
54,215,582 | I am solving a challenge on hackerrank. It's printing a number in spiral pattern decreasing it's value at each circle completion.
4 4 4 4 4 4 4
4 3 3 3 3 3 4
4 3 2 2 2 3 4
4 3 2 1 2 3 4
4 3 2 2 2 3 4
4 3 3 3 3 3 4
4 4 4 4 4 4 4
```
//Printing Pattern using Loops
/* for eg. for n = 4
4 4 4 4... | 2019/01/16 | [
"https://Stackoverflow.com/questions/54215582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6475857/"
] | ```
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
int n;
scanf("%d", &n);
for(int i = n; i >= 1; i--){
for(int j = n; j > i; j--)
printf("%d ", j);
for(int j = 1; j <= 2 * i - 1; j++)
printf("%d ", i);
for(int j = ... | ```
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
for(int i = 1; i<n*2; i++)
{
for(int j = 1; j<n*2; j++)
{
int a = i, b = j;
if(a>n) a = n*2-a;
if(b>n) b = n*2-b;
a = (a<b)? a:b;
printf("%d ",n-a+1);
}
... |
36,700,907 | i have a cell (A1) linked to real-time data (=Tickers!Z12). i want to capture all of the price range in a five minute period. my issue is i'm trying to use the Worksheet\_Change method but it wont update when the values change if the cell (A1) is formulated. it works fine if i manually change the values. but i need to ... | 2016/04/18 | [
"https://Stackoverflow.com/questions/36700907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5403867/"
] | **Note**: I changed this answer to reflect an edit of the question. Specifically, I added a `split()` to separate the strings in the nested lists into two strings (`issueId` and `status`).
---
I would use list and dictionary comprehensions to turn your list of lists into a list of dictionaries with the keys `issueId... | You can get the list of the strings by
```
issueId = [y for x in resultList for (i,y) in enumerate(x.split()) if(i%2==0)]
status = [y for x in resultList for (i,y) in enumerate(x.split()) if(i%2==1)]
```
to go through every issueID and corrosponding status you can use
```
for id,st in zip(issueId,status):
print... |
2,690 | I have to download a file from this [link](http://www.vim.org/scripts/download_script.phpsrc_id=11834). The file download is a zip file which I will have to unzip in the current folder.
Normally, I would download it first, then run the unzip command.
```
wget http://www.vim.org/scripts/download_script.php?src_id=1183... | 2010/10/04 | [
"https://unix.stackexchange.com/questions/2690",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/2045/"
] | You have to download your files to a temp file, because (quoting the unzip man page):
>
> Archives read from standard input
> are not yet supported, except with
> funzip (and then only the first
> member of the archive can be
> extracted).
>
>
>
Just bring the commands together:
```
wget "http://www.vim.org... | I don't think you even want to bother piping wget's output into unzip.
From the wikipedia ["ZIP (file format)"](http://en.wikipedia.org/wiki/ZIP_%28file_format%29) article:
>
> A ZIP file is identified by the presence of a central directory located at the end of the file.
>
>
>
wget has to completely finish the ... |
158,821 | I need a world that is hard, but not impossible, to live on but also to be found on. How can I best accomplish this?
I am working on a world sort of like the planet in the movie Predators. In the world I'm working on, a race uses it for military special-ops training. They take a death-row prisoner and drop them on thi... | 2019/10/20 | [
"https://worldbuilding.stackexchange.com/questions/158821",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/69083/"
] | How about some planet with massive amounts of caves or old mines. Little different than jungle. And the underground nature would make things more 3-D. Also would interfere with a lot of radar, IR, lowlevel light surveillance. Also, perhaps interesting physical challenges for pursuers/pursued in terms of the mine/cave s... | I would go with an area (not planet since a single biome world is impossible to sustain a biosphere) of plains. A similar environment to the one we (and possibly the hunters) evolved in would be an ideal hunting/training ground. It is not that easy to survive there for an untrained human, although it would be possible,... |
306,650 | I want to get product details from url key.
Is there a way to get product details from url\_key, I am new to Magento and could not find any such way, please help I tried below code but it is not working properly.
```
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager-... | 2020/03/10 | [
"https://magento.stackexchange.com/questions/306650",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/29706/"
] | ```
$urlKey = "strive-shoulder-pack"; // add your url key which you want
$productCollectionFactory = $objectManager->get('\Magento\Catalog\Model\ResourceModel\Product\Collection');
$productCollectionFactory->addAttributeToFilter('url_key',$urlKey);
$productCollectionFactory->addAttributeToSelect('*');
foreach ($pro... | firstly don't use objectManager you can inject the used class in the construct:
```
public function __construct(\Magento\Catalog\Model\ProductFactory $productFactory)
{
$this->productFactory = $productFactory;
}
```
And after that in your class use loadByAttribute function
```
$product = $this->productFactory-... |
15,605 | We are setting up a new (money) Gemach. To register as a charity, a bank account is now needed. We were told of this on Thursday around noon. We were unable (too busy getting ready for Yom Tov) to get to the bank on Thursday. Friday is a bank holiday. Are we allowed to open the account on Chol HaMoed?
On the one hand... | 2012/04/06 | [
"https://judaism.stackexchange.com/questions/15605",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/730/"
] | The usual rubric for answering this question is whether there's a financial loss involved.
If you can postpone the trip to the bank until after Hol HaMoed without losing money, then you should. If not, then it's mutar to do it on Hol HaMoed. | The Shulchan Aruch in Orach Chaim in [סימן תקמד - דין צרכי רבים בחל המועד](http://www.toratemetfreeware.com/online/f_01975_part_31.html#HtmpReportNum0014_L2) says:
>
> **א** צָרְכֵי רַבִּים מֻתָּר לַעֲשׂוֹתָהּ בְּחֹל הַמּוֹעֵד, כְּגוֹן לְתַקֵּן הַדְּרָכִים וּלְהָסִיר מֵהֶם הַמִּכְשׁוֹלוֹת; וּלְצַיֵּן הַקְּבָרוֹת כְּד... |
46,639,068 | I am trying to display a message once the user logs in.
In the case where number of characters exceed 8, how can I display only the first 8 characters of a name followed by ".." ? (Eg: Monalisa..)
```
new Vue({
el: '#app',
data: {
username: 'AVERYLONGGGNAMMEEE'
}
});
```
Here is my [jsfiddle dem... | 2017/10/09 | [
"https://Stackoverflow.com/questions/46639068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7409294/"
] | you want a computed property that check if the string is > 8 chars and make modifications and use that computed property in your template.
```
new Vue({
el: '#app',
data: {
username: 'AVERYLONGGGNAMMEEE'
},
computed: {
usernameLimited(){
if ( this.username.length > 8 ) {
return this.usern... | Think this way it can take care of one line. And checking for null values to avoid **'[Vue warn]: Error in render: “TypeError: Cannot read property 'length' of null” with .substring()'**
```
{{ username && username.length < 8 ? username : username.substring(0,8)+".." }}
``` |
64,490,249 | I have this code which it needs to throw and exception inside a Lambda:
```java
public static <T, E extends Exception> Consumer<T> consumerWrapper(
Consumer<T> consumer,
Class<E> clazz) {
return i -> {
try {
consumer.accept(i);
} catch (Exception ex) {
try {
E exCa... | 2020/10/22 | [
"https://Stackoverflow.com/questions/64490249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13429959/"
] | In addition to what the other commenters already suggested, you should avoid using "magic" numbers like 97 and 32. Here is a more Pythonic solution:
```
def all_uppercase(s):
shift = ord('A') - ord('a')
return ''.join(chr(ord(c) + shift) if 'a' <= c <= 'z' else c
for c in s)
all_uppercase('H... | You have included the len(s) in the while loop if the index starts from 0
So, change the while loop like this:
```
while x<len(s):
``` |
54,161,034 | I have two tables as below
radcheck
```
+----+-------------------+--------------------+----+--------+
| id | username | attribute | op | value |
+----+-------------------+--------------------+----+--------+
| 1 | userA | Cleartext-Password | := | Apass |
| 2 | userB | Cle... | 2019/01/12 | [
"https://Stackoverflow.com/questions/54161034",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10904992/"
] | Unfortunately it seems that Keras dataset lacks information about topics. You could use nltk version of the same dataset. You can get topic names there too.
Refer to <https://martin-thoma.com/nlp-reuters/> for details. | ```
['cocoa','grain','veg-oil','earn','acq','wheat','copper','housing','money-supply',
'coffee','sugar','trade','reserves','ship','cotton','carcass','crude','nat-gas',
'cpi','money-fx','interest','gnp','meal-feed','alum','oilseed','gold','tin',
'strategic-metal','livestock','retail','ipi','iron-steel','rubber','heat','... |
1,475,580 | I am stuck solving the following limit. I know the answer is 5/4, I just can't get it. This is the steps I have done so far.
$\lim \_ \limits{x\to -\infty \:}\left(\sqrt{4\cdot \:x^2-5\cdot \:x}+2\cdot \:x\right)$
Multiply by Conjugate
$\lim \_ \limits{x\to -\infty \:}\left(\sqrt{4\cdot \:x^2-5\cdot \:x}+2\cdot \:x\... | 2015/10/11 | [
"https://math.stackexchange.com/questions/1475580",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/279249/"
] | \begin{align\*}
\lim\_{x\to-\infty}\sqrt{4x^2-5x}+2x&=\lim\_{x\to-\infty}-2x\sqrt{1-\frac{5}{4x}}+2x\\
&=\lim\_{x\to-\infty}2x\left(1-\sqrt{1-\frac{5}{4x}}\right)\\
&=\lim\_{x\to-\infty}2x\cdot \frac{\frac5{4x}}{1+\sqrt{1-\frac{5}{4x}}}\\
&=5/4.
\end{align\*} | Somehow, you missed a square.
$$
(\sqrt{4x^2-5x})^2-(2x)^2=4x^2-5x-4x^2=-5x
$$
which radically simplifies the ensuing limit calculation,
$$
\lim\_{x\to-\infty}\frac{5|x|}{\sqrt{4x^2+5|x|}+2|x|}
=\lim\_{x\to-\infty}\frac{5}{\sqrt{4+5/|x|}+2}=\frac54
$$ |
31,291,249 | ```
<div class="modal-dialog" role="document">
<div class="modal-content login conatct_main" id="mdlcont">
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<button id="registrsubmit" name="registrsubmit" value="true" class="friends_log pull-right">Register</button>
... | 2015/07/08 | [
"https://Stackoverflow.com/questions/31291249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Judging by your image I'm guessing you're wanting to reposition the modal itself to move it off of the screen, as opposed to moving the viewport (which is what scrollTop would do). Check out [jQuery's offset function](http://api.jquery.com/offset/#offset-coordinates). For example, you could do
```
$('#foo').offset({
... | On bootstrap v5.1.2,
if you have already allowed scrolling by adding the tag `modal-dialog-scrollable`, simply target the modal body as shown below:
```
$('#myModal .modal-body').scrollTop(0);
```
This worked for me |
27,256,062 | Is there ever a situation where it makes more sense to create a functor than to use a lambda?
I know my question is effectively the reverse of [when to use a lambda over a functor](https://stackoverflow.com/questions/4686507/lambda-expression-vs-functor-in-c), but I can't think of a situation in practice where a funct... | 2014/12/02 | [
"https://Stackoverflow.com/questions/27256062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2043536/"
] | I would consider using a functor over a lambda when I
* want more than one instance.
* have to do advanced resource handling.
* need to refer to the functor as a type. For example, to pass it as a template parameter.
* (related) can give a meaningful and generally useful name to the *type* (as opposed to the *instance... | I could think of two cases:
1. When functor carries internal state, thus there is a non-trivial life time issue with the functor. It keeps "something" between the uses
2. When you have to use same code all over the place, writing and keeping it as a functor in its own header might be a good idea from maintenance point... |
36,854,676 | All, I have a jar file. and I know it is built from a swing project. Becuase I already view some source code of class files of the jar. I want to know if there exists any tools help to convert the jar back to the source project in the eclipse? Thanks.
[.
You can also add a jar in Eclipse by right-clicking on the Project → Build Path → Configure Build Path. Uthen under tje L... |
2,902 | I've had my furnace serviced in time for winter, but what other things should I consider doing before the snow and the ice come? | 2010/11/17 | [
"https://diy.stackexchange.com/questions/2902",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/733/"
] | Drain all your garden hoses and insulate external faucets with [these](http://rads.stackoverflow.com/amzn/click/B002GKC2VW).
 | Blow out your sprinkler (irrigation) lines so the water does not freeze and break the line or sprinkler heads. |
18,716,675 | I want to filter the auto complete results from my suggester
Lets say I have a book table
```
Table (Id Guid, BookName String, BookOwner id)
```
I want each user to get a list to autocomplete from its own books.
I want to add something like the
```
http://.../solr/vault/suggest?q=c&fq=BookOwner:3
```
This does... | 2013/09/10 | [
"https://Stackoverflow.com/questions/18716675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/450602/"
] | You need to implement Facebook's client side APIs according to their documentation and the environment you are deploying your client app to (Browser vs iOS vs Android). This includes registering your app with them. Your registered app will direct the user to go through an authentication flow and at the end of it your c... | So I actually tried to implement that custom authentication flow. It seems working fine although there might be further consideration on security side.
First, user go to my application and authenticate with facebook, the application got his user\_id and access\_token. Then the application call auth API to the server ... |
53,894,343 | In my table view cell I have a UIView that shows 5 stars rating. Users can tap it to change the rating. The problem is, when users change the rating the `didSelectRow` on the table view row is triggered. What is the best way of preventing this? Is there a way to block the UIView from passing the touch events to the tab... | 2018/12/22 | [
"https://Stackoverflow.com/questions/53894343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/297131/"
] | 1.If you are using buttons in ratting view for ratting?
if yes then **increase button size**
2.Otherwise you have to **increase cell height** for ratting view clickable.
I request you to provide **screenshot** of your tableview
and Answer if you are using any library for ratting. | You could override `UIResponder`'s `next` property to break the responder chain:
```
extension CosmosView {
open override var next: UIResponder? {
return nil
}
}
```
See <https://developer.apple.com/documentation/uikit/uiresponder/1621099-next>. |
53,079 | Are the 144,000 in Revelation 7 the same as those spoken of in Chapter 14?
While there are similarities there are also differences. The 144,000 of chapter 7 are Jewish as indicated belonging to the 12 tribes with the seal of the Father. The 144,000 of chapter 14 have the Father and Son's seal and were redeemed from th... | 2020/11/17 | [
"https://hermeneutics.stackexchange.com/questions/53079",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/39176/"
] | In the NT the apostle Paul and others are at pains to eliminate the distinction between literal and spiritual Israel, or "Israel of God". We note the following:
* Rom 9:6-8 - It is not as though God’s word has failed. For not all who are descended from Israel are Israel. Nor because they are Abraham’s descendants are ... | No 144000 in chap 7 are specifically named by tribe. The 144000 are distinct, these are the ones who have not been defiled with women for they kept themselves chaste. These are the ones who follow the Lamb wherever He goes. The 144000 were not purchased in chapter 7. 14:4 these have been purchased from among men as fir... |
16,799,769 | Here is my code:
```
<?php
$num1 = 10;
$num2 = 15;
echo "<font color='red'>$num1 + $num2</font>" . "<br>";
?>
```
I expect it to equal "25", when I add a font color it equals "10 + 15". Why? | 2013/05/28 | [
"https://Stackoverflow.com/questions/16799769",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2429886/"
] | change
```
echo "<font color='red'>$num1 + $num2</font>" . "<br>";
```
to
```
echo "<font color='red'>",($num1 + $num2),"</font><br>";
``` | You need to concatenate your string otherwise math will not work
```
echo "<font color='red'>".($num1 + $num2)."</font>" . "<br>";
``` |
14,326,992 | hi I am using the following code to insert a ulabel in a UITableView
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier;
CellIdentifier = [NSString stringWithFormat:@"myTableViewCell %i,%i",
[in... | 2013/01/14 | [
"https://Stackoverflow.com/questions/14326992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1664226/"
] | Try this, you have issues with your cell re-use logic as well as how you're using lblNombre
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier;
// use a single Cell Identifier for re-use!
CellIdentifier = @"myCell";
... | Can you try the following code
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier;
// Was not sure why you had a reuse identifier which was different for each cell. You created a reuse identifier based on the index. Looks like ... |
97,500 | I have buttons for very specific actions. That ends up with button labels like *"Send/Receive all data from sources"* or *"Create predefined calculated channels"*.
Each button has also an icon that goes with it. It results in big ugly buttons that are overloaded with information. The interface is also for tactile so ... | 2016/08/01 | [
"https://ux.stackexchange.com/questions/97500",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/87155/"
] | I would suggest evaluating what is unneeded information. For "Create predefined calculated channels", unless there are other buttons for creating channels in a different way then "Create channels" should be sufficient and further details can be left to documentation.
If there are multiple methods for creating channels... | Related to Rat In A Hat's answer, my choice would be to have the button with just the icon - maybe with a short description if you must have it - and a small icon next to it that can be tapped to expand the information for the button. Tapping the description should make it go away again.
This way, once a user is fami... |
65,728,497 | I have this:
```
* ea626d4 (HEAD -> main) Merging
|\
| * 27069d1 (origin/main, origin/HEAD)
* | 5b02356
|/
* 8978bec
```
I want to remove commit 5b02356 but preserve commit ea626d4
```
* ea626d4 (HEAD -> main) Merging, maybe with changed name
|
* 27069d1 (origin/main, origin/HEAD)
|
* 8978bec
```
How can I d... | 2021/01/14 | [
"https://Stackoverflow.com/questions/65728497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10779391/"
] | ```
git reset --soft 27069d1
git commit
```
With `--soft`, the `reset` command jumps back to the given commit, but without changing the working directory, and leaving the files that differed between the two commits marked as "to be committed". The new commit will have the same content as the original one, but will be... | >
> I want to remove commit 5b02356 but preserve commit ea626d4
>
>
>
If you remove 5b02356 there's no need for a merge.
```
* ea626d4 (HEAD -> main) Merging
|\
| * 27069d1 (origin/main, origin/HEAD)
| |
|/
* 8978bec
```
It might as well be...
```
* 27069d1 (origin/main, origin/HEAD)
|
|
* 8978bec
```
Y... |
35,336 | I think I did something wrong in the Hircine's Ring/Sinding the Werewolf quest because now there seems to be no way to complete it.
After killing the beast and summoning Hircine, I went to kill the other hunters. They were already dead (except one of them who was dying and told me to watch out for the "prey" then die... | 2011/11/12 | [
"https://gaming.stackexchange.com/questions/35336",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/8771/"
] | If you decided to help sinding you had to leave the cave without attacking him after killing all the hunters. when you leave Hircine appears and congratulates you on killing the hunters and gives you the ring | I had a similar issue, being unable to talk to Sinding after killing all the hunters. All I needed to do was exit to the world map. Sinding followed me outside where I was able to talk to him, receive the ring from Hircine, and then kill Sinding to retrieve the Saviours Hide. |
10,169,344 | I have 2 select boxes called 'primaryTag' and 'primaryCategory'
primaryCategory depends on primaryTag
There are also 2 multi-select options called 'tags' and 'categories'.
When a 'primaryTag' changes, the 'tags' should get deselected.
When a 'primaryCategory' changes, the 'categories' multi-select options should ... | 2012/04/16 | [
"https://Stackoverflow.com/questions/10169344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/394514/"
] | `$('document')` has to be `$(document)`. After that remember the default primary category. On *primary tag* change set the default primary category and reset the tag options. On *primary category* change reset the category options.
```
$(document).ready(function() {
var iDefault = $("#primaryCategory").val();
... | There are basically two ways to clear a multi-select box using jQuery:
```
$("#my_select_box").val(null);
```
or
```
$("#my_select_box option").attr("selected",false);
```
The first changes the value of the select element to nothing. The second removes the selected attribute of all of the options in the select el... |
20,212,378 | I need any api or library that can convert some file formats to a PDF file using C#.
The source file format can be: .doc, .docx, .jpg, .png, .tif, .xlsx, .xls, .bmp, .rtf
Is there any library or exe which I can install on my server and it converts the file to pdf as soon as it is uploaded.
I have worked with ffmpeg ... | 2013/11/26 | [
"https://Stackoverflow.com/questions/20212378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/459573/"
] | You're probably getting the exception here:
```
String[] retArray = result.split(" ");
return Float.valueOf(retArray[1]);
```
If you split according to `" "`, sometimes there might be no second element. You need to check that:
```
String[] retArray = result.split(" ");
if(retArray.length >= 2) {
return Float.val... | Check String result, either it will be empty or it will have data which doesn't have space delimiter also check the length of the retArray before access retArray[1] (by retArray[1] actually you are trying to access 2 element in the array.) |
25,127,682 | I have a Spring Batch job that reads from a file and writes to two flat files (in different formats). It uses a CompositeWriter that has two delegates which are custom classes that extend FlatFileItemWriter. Each writer writes only certain records. For example, with 14 input records the GoodFileWriter will write 12 rec... | 2014/08/04 | [
"https://Stackoverflow.com/questions/25127682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3813035/"
] | I am not sure, but according to this(www.w3schools.com/sql/sql\_join\_full.asp) FULL OUTER JOIN returns all rows from the left table and right table
while inner join(www.w3schools.com/sql/sql\_join\_full.asp) selects all rows from both tables as long as there is a match. So with inner join not only
haves to go through... | It's actually somewhat of a complicated question to answer. Yes, there can be a difference in performance when INNER JOINS are written as OUTER JOINS. But I'll read into your question a bit and re-ask it a bit differently:
"Why do I see people writing INNER JOINs as OUTER JOINS?"
People use this technique frequently ... |
50,994,006 | I have an enumerated type and I need to pass an array of this type as parameter:
```
type
TTest = (a,b,c);
procedure DoTest(stest: TArray<TTest>);
```
When I compile
```
DoTest([a]);
```
I receiv the error below:
>
> Error: E2010 Incompatible types: 'System.TArray' and 'Set'\*
>
>
>
So, how can I call `D... | 2018/06/22 | [
"https://Stackoverflow.com/questions/50994006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2399713/"
] | One way to do what you want is to change the parameter to an [open array](http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Open_Arrays) of TTest, i.e.
```
procedure DoTest(const stest: array of TTest);
```
But supposed you don't want to change the parameter, and really want it to be a `TArray<TTest>`, then you can ... | I'm assuming that with "how can I call DoTest without creating a variable of type TArray" you want to avoid declaring and initializing local variable, ie code like
```
var arr: TArray<TTest>;
begin
SetLength(arr, 1);
arr[0] := a;
DoTest(arr);
```
For this you can use the array constructor like:
```
DoTest(TAr... |
5,267,307 | I created a WCF project by going to Add New Project -> WCF service library and when I run it on the development environment, it opens up the WCF test client. How do I install this service on a server that doesn't have Visual Studio installed (I'd like to not host it on IIS). Should I write a new windows service? | 2011/03/10 | [
"https://Stackoverflow.com/questions/5267307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/609866/"
] | Create a Windows Service project.
Add your WCF Service to this project.
In the main Windows Service class (defaults to Service1.cs), add a member:
```
internal static ServiceHost myServiceHost = null;
```
Modify OnStart() to start a new ServiceHost with your WCF Service type:
```
protected override void OnStart(... | You need to create a windows service project and then add reference to your WCF service and host it. In order to install the service, you do not need visual studio, you need to use `installutil.exe`.
Have a look [here](http://msdn.microsoft.com/en-us/library/ms733069.aspx). |
64,509,930 | I want to identify shipments from a table which have routes that have established contracts for the particular route, but the wrong carrier was used.
[](https://i.stack.imgur.com/aobME.png)
[](https://i.stack.im... | 2020/10/24 | [
"https://Stackoverflow.com/questions/64509930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3601357/"
] | You need an additional join to see if the route has a contract and then `CASE` logic:
```
SELECT s.*,
(CASE WHEN cr.route IS NULL THEN 'Route has no contract'
WHEN c.route IS NULL THEN 'Route assigned to wrong carrier'
ELSE 'Correct'
END)
FROM Shipments s LEFT JOIN
Contrac... | ```
SELECT s.*,c.*
FROM Shipments s
LEFT JOIN Contracts c ON s.Route=c.Route and s.Carrier=c.Carrier;
```
if `c.Route` is null, those shipments have no contract. |
35,861,047 | I am using CGAffineTransformMakeRotation to rotate my button.But my button getting scaled(big or small) according to my value to rotate.How to stop scaling of my button? sample code i have used
```
UIView.animateWithDuration(2.5, animations: {
self.btnMeter.transform = CGAffineTransformRotate(CGAffineTransfo... | 2016/03/08 | [
"https://Stackoverflow.com/questions/35861047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599561/"
] | Well you need to decide whether these numbers are meant to be part of the state of your object or not. If they are, make them fields. If they're not, don't. In this case, I'd probably keep them as local variables and change your `NumSelect` code to simply return *one* number entered by the user - and call it twice:
``... | Put your two numbers as `class` fields rather than methods'.
```
int number1 = 0, number2 = 0; //have them as class fields like this
public int NumSelect()
{
number1 = Console.ReadLine();
number2 = Console.ReadLine();
}
```
This way, you could access your `number1` and `number2` across different methods.
M... |
987,000 | I have a program that I intend to install on Linux and Windows machines. I have it cross-compiling fine (with autotools), but at some point I would like the program to be able to update its binaries. The only ways I can think of doing this are:
* Give users write access to "C:\Program Files\Foo Program" or "/usr/bin/f... | 2009/06/12 | [
"https://Stackoverflow.com/questions/987000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/121545/"
] | Sounds like the identity seed got corrupted or reset somehow. Easiest solution will be to reset the seed to the current max value of the identity column:
```
DECLARE @nextid INT;
SET @nextid = (SELECT MAX([columnname]) FROM [tablename]);
DBCC CHECKIDENT ([tablename], RESEED, @nextid);
``` | While I don't have an explanation as to a potential cause, it is certinaly possible to change the seed value of an identity column. If the seed were lowered to where the next value would already exist in the table, then that could certainly cause what you're seeing. Try running `DBCC CHECKIDENT (table_name)` and see wh... |
4,346,399 | How can I tell gnu make not to build some recipe in parallel. Let's say I have the following makefile :
```
sources = a.xxx b.xxx c.xxx
target = program
all : $(target)
$(target) : $(patsubst %.xxx,%.o,$(sources))
$(CXX) -o $@ $<
%.o : %.cpp
$(CXX) -c -o $@ $<
%.cpp : %.xxx
my-pre-processor -o $@ $<
... | 2010/12/03 | [
"https://Stackoverflow.com/questions/4346399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5353/"
] | This is a horrible kludge, but it will do the job:
```
b.cpp: a.cpp
c.cpp: b.cpp
```
Or if there are actually a lot of these, you can have a few stiff drinks and do this:
```
c-sources = $(sources:.xxx=.cpp)
ALLBUTFIRST = $(filter-out $(firstword $(c-sources)), $(c-sources))
ALLBUTLAST = $(filter-out $(lastword $... | You would do well to study the operation of the `ylwrap` tool that comes with `automake`: It solves most of the same problems for old versions of `lex` and `yacc`:
<http://git.savannah.gnu.org/cgit/automake.git/tree/lib/ylwrap> |
7,234,096 | I created a notification at the top of the page that fades in:
HTML/PHP:
```
<?php if ( ! is_user_logged_in() ) : ?>
<div class="notification">
<span><?php _e( 'Welcome to Taiwantalk' ); ?></span>
</div><!-- #container -->
<?php endif; ?>
```
CSS:
```
.notification {
background-c... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7234096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/122536/"
] | Practically the same thing as you already have. Just set height to 0px instead and opacity to 0. Assuming you want it to slide up and fade out. If you just want it to fade out then set opacity to 0. You can also use the jQuery fadeIn/fadeOut methods.
```
<input type="button" value="click" id="mybutton" />
//note that... | I would animate toggle a class instead of setting the height and opacity. You could do this on the document ready event as well. This allows you to keep your style separated from your functionality.
Something like this:
```
$( "#close_button" ).click(function() {
$( ".notification").toggleClass( "notification... |
3,983,943 | >
> **Possible Duplicate:**
>
> [What does a colon in a struct declaration mean, such as :1, :7, :16, or :32?](https://stackoverflow.com/questions/1604968/what-does-a-colon-in-a-struct-declaration-mean-such-as-1-7-16-or-32)
>
>
>
This is C code sample of a reference page.
```
signed int _exponent:8;
`... | 2010/10/21 | [
"https://Stackoverflow.com/questions/3983943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/246776/"
] | It's a bitfield. It's only valid in a `struct` definition, and it means that the system will only use 8 bits for your integer. | When that statement is inside a structure, means [bit fields](http://publib.boulder.ibm.com/infocenter/macxhelp/v6v81/index.jsp?topic=/com.ibm.vacpp6m.doc/language/ref/clrc03defbitf.htm). |
7,652,945 | I have a big maven project with lots of modules. One of the modules is not 'real' development project. It contains data for the final system. The data is deployed to the system using a special jar. The pom now makes sure that the jar is downloaded and all the other data and batch files are packaged into a zip. It uses ... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7652945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/204042/"
] | Objective-C version:
```
NSArray *fileURLs = [NSArray arrayWithObjects:fileURL1, /* ... */ nil];
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:fileURLs];
``` | When opening a file at `path`:
```
NSString* path = @"/Users/user/Downloads/my file"
NSArray *fileURLs = [NSArray arrayWithObjects:[NSURL fileURLWithPath:path], nil];
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:fileURLs];
``` |
68,219 | I saw this sentence on Internet recently written by a native speaker, so I wondered why native speakers tend to use this grammar.
Explain to me why I should I use "is" instead of "are"? Is it grammatically correct?
>
> "There is rice, meat and tomatoes on my plate"
>
>
>
Why "There are rice, meat and tomatoes o... | 2015/09/16 | [
"https://ell.stackexchange.com/questions/68219",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/24318/"
] | I think there is some confusion here between *"X and Y is/are Z"* and *"There is/are X and Y on Z"*; in the former case 'is/are' should agree with X and Y, but in the latter case 'is/are' should theoretically agree with 'There', though as we'll see this does not always sound right.
First compare:
>
> '*My fish and c... | To answer the question provided (In the examples provided) either could be used. Generally the US apply plurality to the sentence whereas in the UK we do not.
Unfortunately, English has a lot of subtleties and the sentence does not sound correct in the first place to my ear. Most folks would state "I have rice, meat an... |
33,142,657 | I got a really annoying problem with calendar class. I have two JTextFields to enter a period of date (txtStart & txtEnd). If start date begins at the first day of month (01.), I set the end date to "last day of month".
Now the user can change change the period by clicking a plus or minus button, then I want to increa... | 2015/10/15 | [
"https://Stackoverflow.com/questions/33142657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3118667/"
] | The end date is incorrect in the first example, as well. It shows 30/12 whereas the last day of December is the 31st. When you add +1 to the month you don't check whether the following month has the same number of days.
November has 30 days. Therefore, incrementing October 31st gives November "31st" which is actually... | After you have incremented or decremented the month of the start date, use
```
int lastDayOfMonth = startDate.getActualMaximum(Calendar.DAY_OF_MONTH);
```
and use startDate in combination with day-of-month set to this value as the endDate.
```
Calendar sd = new GregorianCalendar( 2015, 1, 1 );
int last = sd.getActu... |
12 | There are some really great security questions asked on Stack Overflow / Superuser sites, with some really excellent answers. Had this site been around back then, here would have been a much more natural place for it.
Should we migrate those questions to here, in order to consolidate? Just copy the core points over?... | 2010/11/12 | [
"https://security.meta.stackexchange.com/questions/12",
"https://security.meta.stackexchange.com",
"https://security.meta.stackexchange.com/users/33/"
] | Sure, better would if all security related questions are gathered in one place - here. But doubling them could bring some disorder. Ideal solution would be just to move them here and maybe leave notice about this replacement on the place of previous topic.
Simply, there are big chances that those question will be aske... | Even if there are duplicates, I'm sure the tone and response will be geared for this specific community as it grows. I'll find the different perspectives educational, just as I currently do when I compare the overlap in the existing sites. |
2,007,540 | i found a way to send plain text email using intent:
```
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new
String[]{"example@mail.com"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUB... | 2010/01/05 | [
"https://Stackoverflow.com/questions/2007540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/238123/"
] | You can pass `Spanned` text in your extra. To ensure that the intent resolves only to activities that handle email (e.g. Gmail and Email apps), you can use `ACTION_SENDTO` with a Uri beginning with the mailto scheme. This will also work if you don't know the recipient beforehand:
```
final Intent shareIntent = new Int... | I haven't (yet) started Android development, but the [documentation](http://developer.android.com/reference/android/content/Intent.html#ACTION_SEND) for the intent says that if you use EXTRA\_TEXT, the MIME type should be text/plain. Seems like if you want to see HTML, you'd have to use EXTRA\_STREAM instead... |
303,510 | I found a nice blueprint for an assault rifle as well as some augments. I researched both, but now I don't see any option to actually apply the augment to the assault rifle.
[](https://i.stack.imgur.com/NzY5g.jpg)
From the description in-game I would... | 2017/03/19 | [
"https://gaming.stackexchange.com/questions/303510",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/4103/"
] | Slots for augmentations only appear on higher level versions of items.
Augmentations are added during the development of the item by selecting the augment slots in the same way as you would when adding mods on the load out screen:
[](http... | Most weapon at lvl 2 got augmentation slot. The first lvl for all weapon do not have. You will need to research the second lvl for that rifle. |
4,781,669 | I have an group of checkboxes with id's starting with `somename` and i want catch the click event of these checkboxes. Previously i have done this through jquery. i.e. `$("input[id^='somename']").click(function(){
// my code follows here
})`
but this is not working this time around. why?
P.S. The element is created vi... | 2011/01/24 | [
"https://Stackoverflow.com/questions/4781669",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/546779/"
] | I believe that because you want this applied to dynamically created elements in the DOM you are going to have to use the the jQuery .[live()](http://api.jquery.com/live/) method:
```
$("input[id^='somename']").live('click', function(e) {
// Your code
});
``` | Instead of `.click()` try `.change()` event. |
67,945,097 | I am using AlphaVantage API to download data points, which I then convert to a pandas DataFrame.
I want to plot the new DataFrame with a Scatter/Line graph using Plotly.
The graphs seems to come out perfect when plotting them in Google Colab, however, I seem to be unable to replicate my results in PyCharm and Jupiter ... | 2021/06/12 | [
"https://Stackoverflow.com/questions/67945097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15757379/"
] | I received an answer to my question on plotly and decided to share. I used a combination of both of the following techniques:
>
> The error is due to the data types of your columns in your dataframe.
> dtypes The values are of type object.
>
>
> However this was not a problem is previous versions of plotly (which
>... | The error lies in the data type of your y-axis values. I would guess they are currently strings. Try converting the values to float, and that should solve the problem. To convert all the values in your y-axis to float (which would be the 'CLOSE' column in the dataframe), you can do:
`weekly_data['CLOSE'] = weekly_data... |
43,708,661 | I want to initializes a dataframe and set its column and index as shown below but I face some issues while do like this:
```
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
record = pd.DataFrame(MAE, columns=dataset, index=classifier).transpose()
plt.figure(figsize=(8, 8)... | 2017/04/30 | [
"https://Stackoverflow.com/questions/43708661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Using only what you would know from, "Automate the Boring Stuff with Python."
```
spam = ['apples', 'bananas' , 'tofu', 'cats']
def commaCode(listValue):
for i in range(len(listValue)-1):
print(listValue[i], end=', ') # the end keyword argument was presented in ch.(3)
print('and ' + listValue[-1])
co... | There is another short way of compiling a simple code for this task:
```
def CommaCode(list):
h = list[-2] + ' and ' + list[-1]
for i in list[0:len(list)-2]:
print(str(i), end = ', ')
print(h)
```
And if you run it with the spam list to check:
```
CommaCode(spam)
apples, bananas, tofu and cats
... |
2,695,202 | If you have an HTML `<select multiple>` of a certain width and height (set in CSS), if there are more values then you can possibly fit in that height, then the browser adds a vertical scroll bar. Now if the text is longer than the available width, is it possible to instruct the browser to add a horizontal scrollbar? | 2010/04/22 | [
"https://Stackoverflow.com/questions/2695202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5295/"
] | Although it is an old question and OP asked for CallByName in a standard module, the correct pieces of advice are scattered through answers and comments, and some may not be that accurate, at least in 2020.
As SlowLearner stated, Application.run DOES return a Variant, and in that way both branchs below are equivalent, ... | Modules in VB6 and VBA are something like static classes, but unfortunately VB doesn't accept Module1 as an object. You can write Module1.Func1 like C.Func1 (C being an instance of some Class1), but this is obviously done by the Compiler, not at runtime.
Idea: Convert the Module1 to a class, Create a "Public Module1 a... |
57,810,879 | Is there a parameter or a setting for running pipelines in sequence in azure devops?
I currently have a single dev pipeline in my azure DevOps project. I use this for infrastructure because I build, test, and deploy using scripts in multiple stages in my pipeline.
My issue is that my stages are sequential, but my pip... | 2019/09/05 | [
"https://Stackoverflow.com/questions/57810879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8672160/"
] | There is a new update to Azure DevOps that will allow sequential pipeline runs. All you need to do is add a lockBehavior parameter to your YAML.
<https://learn.microsoft.com/en-us/azure/devops/release-notes/2021/sprint-190-update> | Bevan's solution can achieve what you want, but there has an disadvantage that you need to change the parallel number manually **back and forth** if sometimes need parallel job and other times need running in sequence. This is little unconvenient.
Until now, there's no directly configuration to forbid the pipeline run... |
14,206 | I'm looking to gather some more background, context, sources and opinions, regarding Mordechai's religiousness, or lack thereof.
This was the topic of a recent comment thread on [Was Darius Jewish?](https://judaism.stackexchange.com/q/13095/459), specifically on [@avi](https://judaism.stackexchange.com/users/597/avi)... | 2012/02/12 | [
"https://judaism.stackexchange.com/questions/14206",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/459/"
] | There was [Nechemia 7:7](http://www.chabad.org/library/bible_cdo/aid/16514/jewish/Chapter-7.htm) Which lists Mordechai amongst the leaders of Israel. And also [Ezra 2:2](http://www.chabad.org/library/bible_cdo/aid/16499/jewish/Chapter-2.htm) Which does likewise. | Here is a book you may be interested in: [Yoram Hazony, *The Dawn. Political Teachings of the Book of Esther*](http://rads.stackoverflow.com/amzn/click/9657052068). I recommend it. It is well-reasearched and is based on the classical Jewish sources. It probably won't sit well with the ultra-orthodox public (I'm not bei... |
18,688 | Is there any thing that Buddhism can add to a Stoic Pursuit?
Below is a friendly laid-back discourse between a Stoic and a Buddhist, which could be used as a guide to what I’m trying to compare.
Buddhist: *Birth is suffering, aging is suffering, death is suffering; sorrow, lamentation, pain, grief, & despair are su... | 2016/12/30 | [
"https://buddhism.stackexchange.com/questions/18688",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/-1/"
] | Stoicism is straight to the point, which is nice, but Buddhism covers a bit more territory. Also, Stoicism requires less etymology to understand.
There are a few kinds of attachments that cause mental anguish. Buddhism attempts to end all forms of this, plus increase insight and awareness, and allow one to experience ... | I don't know Stoicism well enough, but your question seems to wonder how to add something that somehow enhances Stoicism. This is the wrong approach.
Eg: rebirth is a central tenet of Buddhism IMHO, what does Stoicism say about that? Helping other, creating merit and virtue, cultivating the mind are central to Mahayan... |
15,488,354 | I dont know why I am getting this error, I think this morning i ran this query without errors and it worked.. I am trying to merge two different tables into one table, the tables have the same fields, but different values.
I am using:
```
create table jos_properties_merged engine = MERGE UNION =
(mergecasas.jos_prope... | 2013/03/18 | [
"https://Stackoverflow.com/questions/15488354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2105729/"
] | according to [this link](http://dev.mysql.com/doc/refman/5.0/en/merge-storage-engine.html) you need to specify the exact same columns existing in your 2 tables:
>
> CREATE TABLE t1 (
> a INT NOT NULL AUTO\_INCREMENT PRIMARY KEY,
> message CHAR(20)) ENGINE=MyISAM;
>
>
> CREATE TABLE t2 (
> a INT NOT NULL AUTO\_I... | ```
CREATE TABLE [IF NOT EXISTS] table_name(
column_1_definition,
column_2_definition,
...,
table_constraints
) ENGINE=storage_engine;
```
>
> Or: (example)
>
>
> mysql>
>
>
>
```sql
Create Table films (
name varchar(20),
production varchar(20),
language varchar(20)
);... |
47,223,183 | I am unable to grep a file from a shell script written. Below is the code
```
#!/bin/bash
startline6=`cat /root/storelinenumber/linestitch6.txt`
endline6="$(wc -l < /mnt/logs/arcfilechunk-aim-stitch6.log.2017-11-08)"
awk 'NR>=$startline6 && NR<=$endline6' /mnt/logs/arcfilechunk-aim-stitch6.log.2017-11-08 | grep -C 10... | 2017/11/10 | [
"https://Stackoverflow.com/questions/47223183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4042248/"
] | According with how the log4j works, it will log everything that matches the filter into the file.
But the root logger will still log all related "INFO" from all the sources....
So its not possible to remove from the root logger this behavior. What you can do is: put something more detailed for the filter and interchan... | From [documentation](https://logback.qos.ch/manual/configuration.html):
>
> logger has its additivity flag set to false such that its logging output will be sent to the appender named FILE but not to any appender attached **higher** in the hierarchy
>
>
>
So, it's all about ordering of appenders and loggers in yo... |
49,381 | My native iPhone Contacts show not only my contacts with phone numbers, but also any email address I’ve ever sent an email to or received an email from. I really would rather not have email contacts save into my contact list automatically. Is there a way to stop this from happening? | 2012/04/22 | [
"https://apple.stackexchange.com/questions/49381",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/21962/"
] | In Gmail Settings, under General, check the following option:
[](https://i.stack.imgur.com/1DbCC.png)
Then go to Contacts and delete all the Other Contacts that were previously added automatically. Performing this action in Gmail will be faster than on y... | Go to Phone then select Contacts, or select the Contacts app directly. In the upper left corner select Groups, then remove Suggested Contacts from the list of synced contacts. |
6,366,411 | I have some object, which extends movie clip:
```
public class MyClass extends MovieClip { ... }
```
Now, I want to put two of this in the stage:
```
var obj:MyClass = new MyClass();
addChild(obj);
```
That would put one, but the other I want it to be exactly the same as the first, so I just need to add a "refere... | 2011/06/16 | [
"https://Stackoverflow.com/questions/6366411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/488229/"
] | If you're going to create multiple instance simultaneously, just use a for loop:
```
var i:uint = 0;
for(i; i<2; i++)
{
var t:MyClass = new MyClass();
// properties of t
addChild(t);
}
```
If you want to do it later on down the track, you could try something like this:
```
function getCopy(taget:MyCla... | You can't. You have to create 2 instances. |
233,158 | I use Ubuntu 9.10 (Karmic) and I have a directory with many files, among them these two files:
```
./baer.jpg
./bär.jpg
```
I would like to delete `bär.jpg` but I can't.
If I type `rm b` and hit `TAB`, it shows me both files, if I append `ä` and hit `TAB`, nothing gets displayed.
What must be done in order to dele... | 2012/12/27 | [
"https://askubuntu.com/questions/233158",
"https://askubuntu.com",
"https://askubuntu.com/users/10561/"
] | I just found out how to delete such files witch special characters:
1. `cd <directory with that file>`
2. `ls -ali`
3. At the very left of the directory listing you see the ID of the inode of each file.
4. Delete your file via inode ID:
`find . -inum <inode ID of your file> -exec rm -i {} \;`
This worked fine for my... | You could use [bash wildcards](http://www.tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm) with
```
rm b?r.jpg
```
where `?` stands for exactly one character. An alternative (if both file names were the same length) would be
```
rm b[!e]r.jpg
```
where `[!e]` means any character except "e". |
15,744,424 | ya'll I have a bit of a structural/procedural question for ya.
So I have a pretty simple ember app, trying to use ember-data and I'm just not sure if I'm 'doing it right'. So the user hits my index template, I grab their location coordinates and encode a hash of it (that part works). Then on my server I have a db tha... | 2013/04/01 | [
"https://Stackoverflow.com/questions/15744424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/910296/"
] | If you use pipe to redirect contents to your function/script it will run your command in a sub-shell and set stdin (`0`) to a pipe, which can be checked by
```sh
$ ls -l /dev/fd/
lr-x------ 1 root root 64 May 27 14:08 0 -> pipe:[2033522138]
lrwx------ 1 root root 64 May 27 14:08 1 -> /dev/pts/11
lrwx------ 1 root root... | Seems I'm late to the party, but `echo -n "Your prompt" && sed 1q` does the trick on a POSIX-compliant shell.
This prints a prompt, and grabs a line from STDIN.
Alternatively, you could expand that input into a variable:
```
echo -n "Your prompt"
YOUR_VAR=$(sed 1q)
``` |
9,153,084 | I'm trying to parse the result string from a system command to an external program.
```
[status,result] = system(cmd);
```
result prints out on my console with its lines correctly broken out, i.e.
line1
line2
...
But it's actually just a single long character array, and there are no newline characters anywhere. ... | 2012/02/05 | [
"https://Stackoverflow.com/questions/9153084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1122623/"
] | Further to Andrey's answer, you can split the string into a cell array using the following command:
```
split_result = regexp(result, '\n', 'split');
```
This uses regular expressions to split the string at each newline character.
You can then access each line of the system command output using:
```
split_result{... | As of Matlab R2016b you may also use the command `splitlines()` which will automatically handle the newline definitions for you. |
59,060,791 | I was finally able to get the array copied and reversed instead of replaced and reversed. what can I try next?
```js
function copyAndReverseArray(array) {
array.slice(0).reverse().map(function(reversed) {
return reversed;
});
}
//Don't change below this line
const original = [1, 2, 9, 8];
const reverse... | 2019/11/26 | [
"https://Stackoverflow.com/questions/59060791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10665079/"
] | Your code its ok, just dont forget the scope theory.
The map actually reversed the list as you spect and return the reversed list, but that result only live into the fuction scope (copyAndReverseArray), so you need to return that value again for got it in a superior scope: global scope in this case. If not return the ... | Does this work for you?
```
function copyAndReverseArray(array){
reversedArray = Object.assign([],array)
return reversedArray.reverse()
}
``` |
31,885,207 | I would like to disable the seekbar but keep the pause and play buttons in a media controller object. I don't want users to be able to skip through the video, but they can pause if needed.
I've looked at other questions like this but they didn't make sense to me. If I could get any help on this that would be great! | 2015/08/07 | [
"https://Stackoverflow.com/questions/31885207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5203393/"
] | In order to use WebSockets you first need to get a `token` calling the `authorization` api. Then you will add that `token` into the `url`.
The Websocket url is:
```
wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize?watson-token=TOKEN
```
Where `TOKEN` can be created by doing (example in curl):
```
... | Watson's Speech-to-Text Service does not support Web Sockets. [A detailed explanation can be found here](https://developer.ibm.com/answers/questions/174846/using-websockets-in-speech-to-text.html).
You are going to need to use a different protocol. A guide to connecting to Watson's API via Node.js can be found [here](... |
49,655,473 | ```
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
@Injectable()
export class ProductoServiceService {
constructor(private http:Http) {}
//Generamos las funciones que nos serviran para manipular nuestras entidades
listar() {
return
```
this.http.get('<http://localhost:42... | 2018/04/04 | [
"https://Stackoverflow.com/questions/49655473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7393514/"
] | You can do chain:
```
if (apple && apple.details && apple.details.price) { ... }
```
But it's not convenient if the chain is long. Instead you can use [lodash.get method](https://lodash.com/docs/4.17.5#get)
With lodash:
```
if (get(apple, 'details.price')) { ... }
``` | You may try solution of @Sphinx
I would also suggest \_.get(apple, 'details.price') of [lodash](http://lodash.com), but surely it is not worth to include whole library for simple project or few tasks.
\_.get() function also prevents from throwing error, when even apple variable is not defined (undefined) |
80,148 | There are numerous Christians hymns and references in Christian literature that Jesus was "forsaken by all mankind, yet to be in Heaven' enthroned", etc.
In essence, there is this powerful image of Christ hanging crucified on the cross bearing the sins of all mankind, totally abandoned. (cf. Mark 15:34)
The Gospels, ... | 2020/12/21 | [
"https://christianity.stackexchange.com/questions/80148",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/18392/"
] | Many hymns get some of their lyrics wrong, either stretching, or glossing over a point to make the meter fit the tune, and there is always the danger of wrong theology when deviating from the actual words of scripture. The line you quote is a case in point. Witnessing Christ’s crucifixion was his mother, Mary, her sist... | Luke 23 (KJV):
>
> 39 And one of the malefactors which were hanged railed on him, saying,
> If thou be Christ, save thyself and us.
>
>
> 40 But the other answering rebuked him, saying, Dost not thou fear
> God, seeing thou art in the same condemnation?
>
>
> 41 And we indeed justly; for we receive the due reward... |
6,691,979 | I have a Gmap that has to zoom in bit by bit. To achieve this I need the Google map zoom level to be formatted like this '4.001'. I tried doing this by simply add this value as zoom level but it doesn't work.
So my question is how to achieve a Google map zoom level using multiple numbers behind the decimal. Is it eve... | 2011/07/14 | [
"https://Stackoverflow.com/questions/6691979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/475362/"
] | You can gradually CSS-zoom the map canvas from 1 to 2, perhaps also masking the surroundings with elements.
Then in one call change the css-zoom back to 1 and decrease the maps-zoom by one.
You will see that streets, names and lines zoom along during the zoom, which is an unwanted artefact, but it sure looks smoother... | In the Chrome browser, a workaround is to alternate zooming between the GMaps + and - and using "Ctrl -" and "Ctrl +" on your keyboard. This latter zoom is within Chrome.
Between the two methods you can get a more customized zoom level. One benefit from going back and forth is that you can optimize text size at the sam... |
54,540,928 | I have a field which is a varchar(20)
When this query is executed, it is fast (Uses index seek):
```
SELECT * FROM [dbo].[phone] WHERE phone = '5554474477'
```
But this one is slow (uses index scan).
```
SELECT * FROM [dbo].[phone] WHERE phone = N'5554474477'
```
I am guessing that if I change the field to an nv... | 2019/02/05 | [
"https://Stackoverflow.com/questions/54540928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425823/"
] | Because `nvarchar` has higher [datatype precedence](https://learn.microsoft.com/en-us/sql/t-sql/data-types/data-type-precedence-transact-sql?view=sql-server-2017) than `varchar` so it needs to perform an implicit cast of the column to `nvarchar` and this prevents an index seek.
Under some collations it is able to stil... | Other answers already explain *what* happens; we've seen `NVARCHAR` has higher type precedence than `VARCHAR`. I want to explain **why** the database must cast every row for the column as an `NVARCHAR`, rather than casting the single supplied value as `VARCHAR`, even though the second option is clearly much faster, bot... |
3,561,894 | I am having trouble calculating the following integral:
$$ {\int \sqrt{c-\cos(t)} dt} $$
where $c$ is a constant.
In the very specific case where $c=1$, it is rather easy, but I cannot seem to be able to generalize that.
I tried running it with Wolfram but it produces higher-than-my-paygrade math ([example](https:/... | 2020/02/27 | [
"https://math.stackexchange.com/questions/3561894",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/349202/"
] | No, it is not easier than that. Wolfram showing you "weird" functions is a sure sign, if not a proof\*.
The elliptic integrals have become very classical. <https://en.wikipedia.org/wiki/Elliptic_integral>
It is easy to understand why the case of $c=1$ is simpler. In the plots you see that the blue curve *is* a (recti... | For the specific case where $~=1~$, this integral is rather easy because here you can use a trigonometric formula $~1-\cos t~=~2\sin^2\left(\frac{t}{2}\right)~$ directly in the second line and got a known trigonometric function $\big($here it is $\sin\left(\frac{t}{2}\right)\big)$ which can be integrable by known formu... |
190,086 | I am a software developer with 10 years of professional experience. In order to gain experience leading a team, I have decided to be involved in a side project with a friend who switched careers via a coding bootcamp, people he met there and some fresh college grads. This friend has over a decade of experience in other... | 2023/02/17 | [
"https://workplace.stackexchange.com/questions/190086",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | Incremental Learning only works if there's something to increment on.
The poor guy has nothing. The DEV environment isn't working, the configuration instructions are incomplete, and he has no idea what's going on, since setting up the DEV environment is really a Systems Administration task.
Without a working environm... | It seems like your friend hasn't moved past the "tutorial hell" stage.
One way to move past that stage is to find a project that has been done a thousand times before, so you can find many good tutorials on it and many github repos on it.
Then the person must start the project, only using general documentation, witho... |
612,897 | In my early days as KVM admin, when I had to do a backup of a VM image, I followed the next steps:
1. Pause the VM
2. Snapshot LVM volume
3. Resume the VM
4. Copy image
5. Remove LVM snapshot
Now I've got some machines in EC2, but I'm facing a doubt:
Amazon official documentation says
>
> "you should stop the ins... | 2014/07/16 | [
"https://serverfault.com/questions/612897",
"https://serverfault.com",
"https://serverfault.com/users/212052/"
] | No, it cannot be paused.
I also make snapshots on live servers and have yet to run into an issue, and I agree that it would be nice to be able to suspend writes during that time.
The other option is to use 'Create AMI from this instance' which seems to do something similar to a pause, in that it temporarily stops the... | No, you can't pause an EC2 instance, only stop.
Pausing a VM does not guarantee a consistent snapshot. In fact, pausing a VM to take an underlying snapshot is worse than taking a local LVM snapshot from a running system. Running an LVM snapshot will at least flush it's write buffers and wait for running writes to fin... |
15,879,147 | I have this:
```
long int addsquares(int n, ...)
```
How can I access the parameters?
I can't use `va_start` and `va_arg`... | 2013/04/08 | [
"https://Stackoverflow.com/questions/15879147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2000363/"
] | If you are saying that you have a variadic function, and you're not allowed to use the variable argument macros (`va_xxx`) then you'd have to rewrite the content of those macro's yourself.
Unless you can change the function prototype, but I'm guessing that's now allowed either. | Check out the discussion in this thread... [How does the C compiler implement functions with Variable numbers of arguments?](https://stackoverflow.com/questions/2739496/how-does-the-c-compiler-implement-functions-with-variable-numbers-of-arguments)
I think you'll find it gets you going in the right direction. Pay part... |
6,450,901 | I am working on a project where I need to run Google chromium over Linux FrameBuffer, I need to run it without any windowing system dependency ( It should draw on the buffer we provide it to draw, this will make its porting to any embedded system very easy) , I do not need its multi-tab GUI, I just need its renderer wi... | 2011/06/23 | [
"https://Stackoverflow.com/questions/6450901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148869/"
] | try to port [webkit](http://www.webkit.org/) engine to the [netsurf framebuffer-based](http://www.netsurf-browser.org/about/screenshots/#framebuffer) code.
HTH | You could buy one of the remaining 10 (or so) OGD1 boards.
<http://en.wikipedia.org/wiki/Open_Graphics_Project>
Then you can talk directly to hardware using libpci.
However you will still need code that draws a picture into a memory buffer.
I realize this answer is more a shameless plug.
But people who are intereste... |
922,052 | I'm trying list all of the monospaced fonts available on a user's machine. I can get all of the font families in Swing via:
```
String[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment()
.getAvailableFontFamilyNames();
```
Is there a way to figure out which of these are mo... | 2009/05/28 | [
"https://Stackoverflow.com/questions/922052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | A simpler method that doesn't require making a BufferedImage to get a Graphics object etc.:
```
Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
List<Font> monoFonts1 = new ArrayList<>();
FontRenderContext frc = new FontRenderContext(null, RenderingHints.VALUE_TEXT_ANTIALIAS... | Probably not applicable for your case, but if you simply want to set the font to a monospaced font, use the logical font name:
```
Font mono = new Font("Monospaced", Font.PLAIN, 12);
```
This will be a guaranteed monospaced font on your system. |
11,862,479 | We're setting up a new project and decided to use eclipselink for JPA. When creating our domain model we ran into a problem.
We have a base class called organisation. We also have Supplier and Customer which both extend organisation. When JPA created the tables I saw that it uses a discriminator, the problem with thi... | 2012/08/08 | [
"https://Stackoverflow.com/questions/11862479",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/755949/"
] | This is from a project and isn't tested, but one of these should work.
```
$select->from(array("table_name" => "table_name"), array("my_col" => "COUNT(id)"));
```
**OR**
```
$select->from(array("table_name"), array("my_col" => "COUNT(id)"));
```
This is the same as
```
SELECT COUNT(id) as my_col FROM table_name ... | To use a mysql command in a select, you need to use Zend\_Db\_Expr:
```
$select = $this->select()
->from('myTable', new Zend_Db_Expr('COUNT(id) as count'));
echo $select; //SELECT COUNT(id) as count FROM myTable;
``` |
18,793,827 | I need some help with following problem:
**Problem:**
In the design view frames that appear around selected Swing-elements are not displayed at their correct positions. Also the content pane is not located at its right position inside the window (JFrame). It seems no matter whether layout is used (e. a. BorderLayout... | 2013/09/13 | [
"https://Stackoverflow.com/questions/18793827",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2777610/"
] | If you need to support IE7 you can use:
```
div > div > div > div + div + div,
div > div > div > div:first-child {
color: orange;
}
```
<http://jsfiddle.net/4TYcb/1/> | ```
div div div :not(:nth-child(2))
```
will select just those divs |
2,093,792 | There are $10$ white and $10$ black balls in the first box, and $8$ white and $10$ black balls in the second box. Two balls are put from the first to the second box, then we choose one ball from the second box. What is the probability that the chosen ball from the second box is white?
From the first box, we can choose... | 2017/01/11 | [
"https://math.stackexchange.com/questions/2093792",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/222321/"
] | It suffices to take the inverse of a continuous bijection (whose inverse fails to be continuous).
Here, then, is my go-to example: consider $S^1 \subset \Bbb R^2$, and the map
$$
f:S^1 \subset \Bbb R^2 \to (-\pi,\pi]\\
(\cos( x), \sin(x)) \mapsto x
$$
If we extend this example to the whole plane, we get something clas... | All you have to do is take the identity function onto the discrete topology on the same space. All discrete topologies are metrizable. |
31,227,055 | How should I go about detecting if typing has stopped in a `UITextField`? Should I use the `UITextFieldTextDidEndEditingNotification` function of some sorts? I a trying to create a instagram like search where it will display the results after a second of not typing. | 2015/07/05 | [
"https://Stackoverflow.com/questions/31227055",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4335880/"
] | This approach uses an NSTimer to schedule a search 1 second after the text field changes. If a new character is typed before that second is up, the timer starts over. This way, the search is only triggered starts after the last change.
**First things first, make sure the ViewController is conforms to the UITextFieldDe... | swift
xcode - 10
```swift
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange,
replacementString string: String) -> Bool {
NSObject.cancelPreviousPerformRequests(
withTarget: self,
selector: #selector(self.getHintsFromTextField),
object: textFi... |
527,849 | I have an asp form that has a checkbox and dropdown menu. If the checkbox in not selected then I need to make sure the dropdown is either not selected or disabled. | 2009/02/09 | [
"https://Stackoverflow.com/questions/527849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64134/"
] | Are you sure you're pointing your unit tests at the instrumented classes for the external method call? | Can't help you with Emma. But what you need is a code coverage tool that can combine test coverage data from multiple projects into a coherent whole.
SD's test coverage tools (including the one for Java) can do this out of the box. This allows one to keep lots of "projects" that each make up a significant part of a mu... |
38,854 | I'm looking for an understandable book about mathematical proofs.
As an engineer/computer scientist major I'm used to do higher math on a daily base, but whenever I'm asked in an exercise to "show" something I get the "where should I start? and what exactly do they want me to do?" syndrome. | 2011/05/13 | [
"https://math.stackexchange.com/questions/38854",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/10224/"
] | Read Pólya's [How to Solve It](http://en.wikipedia.org/wiki/How_to_solve_it). See also these [slides](http://cs.swan.ac.uk/~csgs/howtoproveit.pdf). | You can search for "thoughts - Alpha" this is a free downloadable online PDF book for mathematical proofs. the book is a compilation of proofs for basic mathematics (Trigonometric Identities, logarithms, basic series, volumes and surfaces, basic calculus)
Book's webpage:
<http://thoughtsseries.weebly.com/>
Author's s... |
60,091,570 | Is there any way to create the homepage Home.aspx in Sharepoint under the template Team Site using CSOM in C# ? | 2020/02/06 | [
"https://Stackoverflow.com/questions/60091570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9939945/"
] | The following code snippet for your reference.
```
string siteUrl = "https://*****.sharepoint.com/sites/team";
string userName = "admin@****.onmicrosoft.com";
string password = "***";
OfficeDevPnP.Core.AuthenticationManager authMgr = new OfficeDevPnP.Core.AuthenticationManager();
#region O365
using (var ctx = authMg... | Try this approach:
```
OfficeDevPnP.Core.AuthenticationManager authMgr = new OfficeDevPnP.Core.AuthenticationManager();
string siteUrl = "https://******.sharepoint.com/sites/CommunitySite";
string userName = "userh@******.onmicrosoft.com";
string password = "******";
... |
22,401,464 | Hi I want to autowire boolean value from properties file have referred following link with maps url
[Spring properties (property-placeholder) autowiring](https://stackoverflow.com/questions/2882545/spring-properties-property-placeholder-autowiring)
but I want to auto wire a boolean property, also have referred questio... | 2014/03/14 | [
"https://Stackoverflow.com/questions/22401464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2320457/"
] | It doesn't work for me with primitive boolean. But it does with Boolean type.
This is my spring configuration declaration of the properties file:
```
<context:property-placeholder location="classpath:path/to/file/configuracion.properties" />
```
This is what i have in my properties file:
```
my.property=false
```... | At least from Spring 5 (I didn't test previous versions), you can autowire boolean primitive.
In application properties:
```
my.property=true
```
In your class:
```
@Value("${my.property}")
private boolean myProperty;
``` |
9,616,165 | I am currently working on making a multiplayer Snake game in HTML5 Canvas with Javascript.
The code below is function that handles the random placement of food for the snake. The problem with the piece of code is that it give me the x and y in while(map[x][y]); back as something he can not read even though it does ge... | 2012/03/08 | [
"https://Stackoverflow.com/questions/9616165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1180646/"
] | ```
XDocument xDoc = XDocument.Load(.....);
xDoc.Descendants("Title").First().Value = "New Value";
xDoc.Save(...)
``` | ```
XmlDocument xml = new XmlDocument();
xml.Load(...);
var newTitle = "MODIFIED";
var title_node = xml.GetElementsByTagName("Title");
if(!string.IsNullOrEmpty(newTitle) && title_node.Count > 0)
{
title_node[0].InnerText = newTitle;
}
``` |
37,161,695 | [](https://i.stack.imgur.com/BEPi7.png)
The HTML code for this form (left hand side) is like below.
```
<div class="lp-element lp-pom-form" id="lp-pom-form-410">
<form action="#" method="POST">
... | 2016/05/11 | [
"https://Stackoverflow.com/questions/37161695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3560248/"
] | Try this:
```
<asp:LinkButton runat="server" ID="btnGetDemo" CssClass="lp-element lp-pom-button lp-pom-button-411"><span class="label">GET MY DEMO</span></asp:LinkButton>
```
My guess is that the "label" class on the span has something to do with it.
EDIT:
I changed the LinkButton markup a bit AND do change the CS... | Use this:
```
<form id="form1" runat="server">
<asp:Panel runat="server" ID="uxForm">
<div class="lp-pom-form-field clearfix" id="container_name">
<asp:TextBox ID="uxName" runat="server" CssClass="text form_elem_name" placeholder="Name" />
</div>
<div class="lp-pom-form-field c... |
69,222,896 | In Snowflake there is a number column storing values like: 8,123,456. I am struggling determining how to structure select statement to return a value like: 00008123456.
In SQL SERVER you can do something like this:
```
right(replicate('0', 11) + convert(varchar(11), job_no), 11) AS job_no
```
I understand Snowflake... | 2021/09/17 | [
"https://Stackoverflow.com/questions/69222896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/331896/"
] | Just add a format string on to\_varchar():
```
select to_varchar(8123456, '00000000000');
``` | a solution provided by Greg Pavlik saved me.
I just switched from DB2 to Snowflake.
So, `TO_VARCHAR( <numeric_expr> [, '<format>' ] )` worked. |
49,602,983 | I managed to build AV1 codec <https://aomedia.googlesource.com/aom/> with visual studio thanks to the command
```
cmake path/to/aom -G "Visual Studio 15 2017 Win64"
```
however the encoder only use one thread even with the option --threads, in the code it seems to use pthread. Do I need to do a different build with... | 2018/04/01 | [
"https://Stackoverflow.com/questions/49602983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/664329/"
] | i make AOM AV1 encoder to work in parallel by adding tiles `--tile-columns=1 --tile-rows=0` , where `--tile-columns` and `--tile-rows` denote log2 of tile columns and rows. | hmm, well av1 is missing multi-threading, should arrive when they get around finishing specs lol |
23,339,922 | Suppose an array *arr[1..N]* of integers. The array is changed in two ways:
* Values are being overwritten
* Items are considered invalid (by setting special value `-1`, for example)
I am looking for a data structure that gives answer to "What is the *k*-th valid item?" quickly.
With single invalid value, this is tr... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23339922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/402141/"
] | Its `undefined` because, `console.log(response)` runs before `doCall(urlToCall);` is finished. You have to pass in a callback function aswell, that runs when your *request* is done.
First, your function. Pass it a callback:
```
function doCall(urlToCall, callback) {
urllib.request(urlToCall, { wd: 'nodejs' }, fun... | If what you want is to get your code working without modifying too much. You can try this solution which **gets rid of callbacks** and **keeps the same code workflow**:
Given that you are using Node.js, you can use [co](https://github.com/tj/co) and [co-request](https://github.com/denys/co-request) to achieve the same... |
186,573 | Recently I had a paper sent back to me (rejected) with two referee reports. This is not that surprising as this was a very good journal. The problem is that the identity of one of the referees is revealed even though it's supposed to be a single-blind system. This wouldn't be too much of a problem usually, but the iden... | 2022/07/01 | [
"https://academia.stackexchange.com/questions/186573",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/143051/"
] | Let it go.
They were doing their job. If their commentary was fair there is nothing for you to do here, but forget about the incident. This is a rather explicit case, but in the future there will be many cases where you can quite accurately infer the identity of a referee. Some of those referees will be people you kno... | There is a good rule: "If in doubt, do nothing."
Other people believe that you should notify the editor. I wouldn't do that, as you cannot be sure the editor would not notify the referee, and that would be more awkward :-)
I don't see how the current situation is awkward for you, unless you let the referee know what ... |
131,666 | What is the right place to store program data files which are the same for every user but have to be writeable for the program? What would be the equivalent location on MS Windows XP? I have read that C:\ProgramData is not writeable after installation by normal users. Is that true? How can I retrieve that directory pro... | 2008/09/25 | [
"https://Stackoverflow.com/questions/131666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21683/"
] | `SHGetFolderPath()` with CSIDL of `CSIDL_COMMON_APPDATA`.
Read more at <http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx>
If you need the path in a batch file, you can also use the `%ALLUSERSPROFILE%` environment variable. | Actually [`SHGetFolderPath`](http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx) is deprecated.
[`SHGetKnownFolderPath`](http://msdn.microsoft.com/en-us/library/bb762188(VS.85).aspx) should be used instead. |
943,330 | I have some action methods behind an Authorize like:
```
[AcceptVerbs(HttpVerbs.Post), Authorize]
public ActionResult Create(int siteId, Comment comment) {
```
The problem I have is that I'm sending a request through AJAX to Comment/Create with
```
X-Requested-With=XMLHttpRequest
```
which helps identify the requ... | 2009/06/03 | [
"https://Stackoverflow.com/questions/943330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6068/"
] | Thanks to Lewis comments I was able to reach this solution (which is far from perfect, posted with my own comments, if you have the fixes feel free to edit and remove this phrase), but it works:
```
public class AjaxAuthorizeAttribute : AuthorizeAttribute {
override public void OnAuthorization(AuthorizationContext... | Recently I ran into exactly the same problem and used the code posted by J. Pablo Fernández
with a modification to account for return URLs. Here it is:
```
public class AuthorizeAttribute : System.Web.Mvc.AuthorizeAttribute
{
override public void OnAuthorization(AuthorizationContext filterContext)
{
ba... |
7,424,959 | I want to make simple project which play flash video file from online.
I've searched some articles and read carefully.
But I can't understand, how to play flash video files on iPad by Code.
So I need help from you.
Please. | 2011/09/15 | [
"https://Stackoverflow.com/questions/7424959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931872/"
] | Simply put, without being jailbroken, No you cannot.
The closest thing to being able to view flash in iOS is Frash, and I am not even sure if it is actively being developed or supported any more.
You can always check out the [open source project for **Frash**](https://github.com/comex/frash). by Comex. | At the end of the day, the Flash video format is a container for a movie that’s been compressed by some codec. If you can get to the source file, you know the format of the container, you know the codec that was used to encode the video, and you know how to write code to convert that into audio streams and video frames... |
6,160 | I just got following entities Employee, Client and Company. Where Employee and Client have one to many relationship with Company ie A single employee may be mapped to attend to many companies and same for clients too. How would i design a optimized table for this situation.
I had thought of below
**Employee:**
-------... | 2011/09/26 | [
"https://dba.stackexchange.com/questions/6160",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/592/"
] | You have a many-many (aka link or junction) table between the 2
EmployeeCompany
Columns:
* EmployeeID
* CompanyID
Keys:
* Primary key is (EmployeeID, CompanyID)
* Add a unique index (CompanyID, EmployeeID)
* EmployeeID has FK to Employeetable
* CompanyID has FK to Company table
**Do not** store a CSV in a column:... | Assuming a `company` can be "attended to" by more than one `employee`, and likewise for `client`, you would model like this:

So both relations are 'many:many'. As gbn also said, adding "comma separated ids" would be something of a disaster in database design: you wou... |
125,388 | I've downloaded jmeter and put it in my Applications folder.
I've made it executable.
I can cd to /Applications/apache-jmeter-2.11/bin and can run it in a terminal with
```
$ ./jmeter
```
or by double-clicking the icon from the finder.
How can I add the program as a shortcut (icon) on the main application ic... | 2014/03/24 | [
"https://apple.stackexchange.com/questions/125388",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/24565/"
] | You can use AppleScript to make a `.app` file for this (That is the only file type that can go in the left side of the dock). It is in `/Applications/Utilities/AppleScript Editor` and when you make a new file you can put in `do shell script "/Applications/apache-jmeter-2.11/bin/jmeter"`. I do this all the time for shel... | Such binaries can't be added to the left side of the Dock where applications are stored.
**Add it to the right side of the Dock instead**
Right of the separator:
 |
14,290,413 | apology for this newbie question.
I have created an html page (dash.html) that uses the same `header` as the other pages.
it calls this PHP function `<?php include 'header.php'; ?>`
the dash.html contains a special `<div>` made specially for that page; and it must be placed inside the `header.php`
im trying to figur... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14290413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1933824/"
] | If you trying to create a hierarchy of views like this, you should probably be using these:
```
[self.navigationController pushViewController:ViewController animated:BOOL completion:nil];
[self.navigationController popViewControllerAnimated:BOOL completion:nil];
```
Instead of:
```
[self presentViewController:ViewC... | I'm a little confused about what you're trying to do. If you're using a navigation controller, you should be doing pushes and pops, not presenting and dismissing. If you want to use navigation controllers, then you can use popToViewController:animated: to go back to any particular controller without passing through the... |
51,994 | My line manager does not have any computational skills: no advanced data analysis, no scripting, no programming. Recently he switched the frequency of our meetings to weekly (from one every 2 weeks) and he wants to check my code week after week.
Background: he's not technical and he's mainly trying to monopolise acces... | 2015/08/11 | [
"https://workplace.stackexchange.com/questions/51994",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | >
> Should I allow my manager to do this?
>
>
>
**Yes, almost certainly.** If you are in a normal employment relationship, the code you write belongs to your company and you have no right to refuse that your manager sees your code. Refusing would almost certainly be seen as unreasonable or suspicious and could tri... | Strange sounding question.
Normally for software development you always have a version control system where everyone who has the rights can access the code and see its development history. Your question sounds like either you have your code local or in a non-accessible repository (*which is an extremely bad idea by it... |
3,689,027 | I have a Time column in a database table. The date is not important, we just want a time in the day. What type would be best to represent it in C#? I was going to use a DateTime, but I don't like the idea of having a date. | 2010/09/10 | [
"https://Stackoverflow.com/questions/3689027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62642/"
] | You could use a [TimeSpan](http://msdn.microsoft.com/en-us/library/system.timespan.aspx) structure to represent a time in .NET. | We actually rolled our own Time class. The issue we ran into is TimeSpan has no knowledge of timezone offsets which we still needed. So We created a TimeSpanOffset class. Kind of analogous to the DateTimeOffset class. If timezone is not important than I would definitely stick with the TimeSpan. |
43,157,095 | How do you output all images in a directory to the same pdf output using fpdf. I can get the last file in the folder to output as a pdf or output multiple pdfs for each image, but not all images in the same pdf like a catalog. I'm sure it is the for loop but can't sort it out properly.
```
from fpdf import FPDF
from P... | 2017/04/01 | [
"https://Stackoverflow.com/questions/43157095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7801566/"
] | Still not sure why fpdf was not grouping the iteration of image files as a single PDF output but img2pdf accepted a list of file names worked very nicely.
```
import img2pdf
imagefiles = ["test1.jpg", "test2.png"]
with open("images.pdf","wb") as f:
f.write(img2pdf.convert(imagefiles))
``` | You will have to start a new page for every picture in the beginning of the for loop and end with writing everything to the PDF.
```
pdf = FPDF()
imagefiles = ["test1.png","test2.png"]
for one_image in imagefiles:
pdf.add_page()
pdf.image(one_image,x,y,w,h)
pdf.output("out.pdf")
``` |
583,673 | I add new folder (actually I cloned it from another repo, and forgot that), then I did some changes there. Additionally I did a lot of changes in another places, when I tried to do git add
```
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <fi... | 2013/04/16 | [
"https://superuser.com/questions/583673",
"https://superuser.com",
"https://superuser.com/users/119595/"
] | I happened to do exactly what this user did: Add an existing git repository inside another one.
The symptom was that git recognised that directory as a file, and thus was unable to add the directory's files.
To solve that question, I deleted the `.git` folder in the folder, moved that folder in another directory, cle... | Try adding a file in that directory.
```
$ git add my-dir/index.html
```
If you see a output like the below:
```
The following paths are ignored by one of your .gitignore files:
my-dir/index.html
Use -f if you really want to add them.
fatal: no files added
```
There's a rule in one of your gitignores that prevent... |
15,116,675 | I have a little problem with CSS.
I'm following a book to learn CSS3 and I just discovered the function Transition.
So I decided to make an attempt and I can not figure out where I'm wrong, I hope you can help me.
This is my Index.html file
```
<html>
<head>
<title>My Test</title>
<link rel="stylesheet" type=... | 2013/02/27 | [
"https://Stackoverflow.com/questions/15116675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1875391/"
] | You're missing the measurements from the `width` property, but your markup won't allow what you're trying to achieve.
`.box:hover .ssin` will only make trigger when `.ssin` is a child of `.box`. If you want to animate the width of `.ssin` when `.box` is hovered, you'll have to use the adjacent sibling selector in CSS ... | Since you are trying to look into CSS3 Transition, I will assume you are trying to increase the size of the box. SO, your markup is slightly wrong. The `ssin` should be inside the `.box`
```
<div class="box">
<div class="ssin"></div>
</div>
```
And add the transition css to your code
```
.ssin {
-webkit-tr... |
20,126,882 | I have two `<a>` in a `<p>` and I want to assign them different borders when selected.
When the user clicks on a `<a>` a JavaScript sets the class to `"selected"` and the border shall turn to green if it is the first `<a>` but if the second `<a>` is clicked and assigned class="selected" the border shall turn to red.
... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20126882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2217238/"
] | I originally thought your css was slightly off, you needed the pseudo element at the end. That appears to be wrong in the case of pseudo classes. Thanks to @BoltClock's a Unicorn
```
a.selected:first-child {border-color:green}
a.selected {border-color:red}
```
However I have to ask if your css sets the border to app... | Shouldn't it be
a.selected:first-child
?
Edit: Boltclock is right, the ordering doesn't matter.
It's to do with the exact behaviour of the [:first-child](http://www.w3schools.com/cssref/sel_firstchild.asp) selector.
```
a:first-child
```
refers to the ***a*** tag that is the first child of it's parent element a... |
25,959,049 | I have the following class:
package ajia.messaging;
```
public class MessageCommunicator {
public void deliver(String message) {
System.out.println(message);
}
public void deliver(String person, String message) {
System.out.println(person + ", " + message);
}
}
```
And the following... | 2014/09/21 | [
"https://Stackoverflow.com/questions/25959049",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1125515/"
] | ```
var addedLis=0
$(function(){
$("#myList").on("click",".myButton",function(){
addedLis++;
var _newLI='<li id="addedItem'+addedLis+'">Added Item '+addedLis+' <a href="javascript:void(0)" class="myButton">Add</a></li>'
$(this).parent().after(_newLI);
});
});
```
`**[Example](http:... | ```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<ul id="myList">
<li id="item1">Item 1 <a onclick='$(this).append("<li>a</li>");' class="myButton">Add</a></li>
<li id="item2">Item 2 <a onclick='$(this).append("<li>a</li>");' class="myButton">Add</a></li>
... |
10,991,455 | Spreadsheet based Apps that were published as services had URLs of this form:
https: //spreadsheets3.google.com/a/macros/my-domain.com/exec?service=AKfycbwly1SYZhdnPOoKfkH\_xB7oMKDeYifYm8M
Today, these URLs are resulting in an error page with a Google Drive logo and the message "Google Docs has encountered a server er... | 2012/06/12 | [
"https://Stackoverflow.com/questions/10991455",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/298650/"
] | Sounds like you want everything in `array2` *except* what's in `array1`:
```
var onlyInArray2 = array2.Except(array1);
```
Of course, if you *also* wanted to know what was only in `array1` you could use:
```
var onlyInArray1 = array1.Except(array2);
```
(This all requires .NET 3.5 or higher, or an alternative LIN... | You could use [IEnumerable.Except](http://msdn.microsoft.com/en-us/library/system.linq.enumerable.except.aspx). |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.