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 |
|---|---|---|---|---|---|
53,675,806 | I'm working on accessibility and thought "I'll just make `alt` a required attribute in my project." My aim is for all `img` tags in my react app to complain if an `alt` attribute has not been provided. So, I created a `.d.ts` file where I have added the following:
```
import { HTMLAttributes } from 'react';
declare m... | 2018/12/07 | [
"https://Stackoverflow.com/questions/53675806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/967405/"
] | There was an issue for this in the babel-eslint repo: <https://github.com/babel/babel-eslint/pull/523>
It's recently been resolved and the fix is released in `babel-eslint@11.0.0-beta.0` [source](https://github.com/babel/babel-eslint/pull/711#issuecomment-456203896)
Once `babel-eslint@11.0.0` is available, you can up... | It is October now but `babel-eslint@11.0.0` still not released yet. In the meantime, you can apply the solution below, which currently working for me
1. Install theses packages
* `@babel/plugin-proposal-class-properties`
* `@babel/plugin-proposal-private-methods`
* `@babel/eslint-parser`
2. Enable `classPrivateProp... |
23,818,538 | I have several files with this pattern: `prefix.1.*`, `prefix.2.*`, `prefix.3.*`, etc... and I want their name to be changed, respectively, to `prefix.01.*`, `prefix.02.*`, `prefix.03.*`, etc. With that, they will be properly sorted by name as there are filenames with already two digits (e.g. `prefix.27.*`) in the set.... | 2014/05/22 | [
"https://Stackoverflow.com/questions/23818538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1642012/"
] | Note a pure `bash` solution, but a little more concise(\*):
```
printf '%s\0' prefix.[0-9].* |
xargs -0 -I % bash -c 'f="%"; mv "$f" "${f/\./.0}"'
```
This assumes that glob `prefix.[0-9].*` expands to at least 1 actual filename.
If it's possible that NO files match, execute `shopt -s nullglob` first (and, if ... | Great answers so far. If the extension is same of all the files. Just use following. Here the extension is `.jpg`
you can change `prefix_` to your choice of prefix.
Also if you want more leading zeros just change %02 to %03 and so on.
```
rename -n -e 's/\d+/sprintf("prefix_%02d",$&)/e' -- *.jpg
``` |
22,252,491 | I have a UIImageView, with scaling Center, so it's size changes according to the UIImage inside, however, by setting a nil UIImage, the constraints break, as no content size can be calculated
**How to handle the autolayout with nil UIImage (the size should be changed to 0,0)?** | 2014/03/07 | [
"https://Stackoverflow.com/questions/22252491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/533422/"
] | The problem is that `UIImageView` returns {-1, -1} as intrinsicContentSize when no image is set. Use subclass of `UIImageView` with implementation like this:
```
@implementation MyImageView
- (CGSize)intrinsicContentSize
{
if (self.image)
{
return [super intrinsicContentSize];
}
return CGSize... | [@nikita-ivaniushchenko's answer](https://stackoverflow.com/a/26122574) gave me an idea to add `Width` constraint with `Low (250)` priority equals to `0` to `UIImageView`, so it is applied when `UIImage` is set to `nil`.

>
> Note: I added... |
33,856 | I'm using Drupal 7 and Clean theme. And when created a node, show date top on node. No problem. But i want remove only hour and min. tab.
How can i solve this? | 2012/06/12 | [
"https://drupal.stackexchange.com/questions/33856",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/6822/"
] | I think you want to have your node show *June 12, 2012*
If that is the case, you can do this:
```
function THEME_preprocess_node(&$variables) {
if ($variables['submitted']) {
$variables['submitted'] = t('Posted: !datetime', array( '!datetime' => format_date($variables['node']->created, 'custom', 'F j, Y')));
... | I would disable the created date display under the content type settings, and then just add a new [date](http://drupal.org/project/date) field whose display settings you can alter just like any other field.
The other option would be to change it by overriding [hook\_tokens](http://api.drupal.org/api/drupal/modules!sys... |
43,817,737 | I am calling two api call in single page. but if i use one api call its working fine. But if i use two api call in same page. I'm getting below error at Runtime.
>
> Error Uncaught (in promise): removeView was not found`.
>
>
>
And i have one doubt too. Where ever i go to any screens. If i want to come back to my... | 2017/05/06 | [
"https://Stackoverflow.com/questions/43817737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7967576/"
] | I know this question asked more than a month ago!
I was going through the same scenario with same problem and i sorted out this issue.
And i have posted the [answer](https://stackoverflow.com/questions/43828359/ionic-error-uncaught-in-promise-removeview-was-not-found/44515433#44515433) in another stackoverflow [Quest... | I had the same error which was caused by accidentally having two handlers firing. One was part of the form as an ngSubmit attribute, the other one was on a custom save button. Removing one of the two solved it. |
37,771,387 | Consider the following [plunker](http://plnkr.co/edit/rJyLj077H76PdqmdRfic?p=preview)
[](https://i.stack.imgur.com/KyaNa.png)
I have a list of tile that I want to fade in one by one using `ng-repeat` however the animation fade the entire tile set all... | 2016/06/12 | [
"https://Stackoverflow.com/questions/37771387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5628302/"
] | here is my pragmatic solution to eliminate newlines in Google Docs, or, more exact, to eliminate newlines from Gmail message.getPlainBody().
It looks that Google uses '\r\n\r\n' as a plain EOL and '\r\n' as a manuell Linefeed (Shift-Enter). The code should be self explainable.
It might help to get alone with the newlin... | I have now found out through much trial and error -- **and some much needed help from Wiktor Stribiżew (see other answer)** -- that there is a solution to this, but it relies on the fact that Google Script does not recognise `\n` or `\r` in regex searches. The solution is as follows:
```
function removeLineBreaks() {
... |
52,833,259 | In the folowing list:
```
tab1 = [['D001', None, None, None, 'Donald Duck', 'Organise a meeting with Scrooge McDuck', 'todo', None],
['D002', None, None, None, 'Mickey Mouse','Organise a meeting with Minerva Mouse', 'done', None],
['D003', None, None, None, 'Mickey Mouse', 'Organise a meeting with Daisy Duck', 'to... | 2018/10/16 | [
"https://Stackoverflow.com/questions/52833259",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6239557/"
] | You were creating just one list, instead of a list of lists:
```
bar = []
for row in tab1:
foo = []
if row[0] is not None:
for cell in row:
if cell is None:
cell = "..."
foo.append(cell)
bar.append(foo)
print(bar)
``` | Traverse the list based on index values.
```
foo = tab1[:]
for row in range(0,len(tab1)):
if tab1[row][0] is not None:
for cell in range(0,len(tab1[row])):
if tab1[row][cell] is None:
foo[row][cell] = "..."
``` |
35,000,687 | I have a binary file ([link](https://drive.google.com/file/d/0BwwhEMUIYGyTWW9ndF9MNWxOQWs/view?usp=sharing)) that I would like to open and read contents of with Python. How are such binary files opened and read with Python? Any specific modules to use for such an operation. | 2016/01/25 | [
"https://Stackoverflow.com/questions/35000687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4576447/"
] | Here is an Example:
```
with open('somefile.bin', 'rb') as f: #the second parameter "rb" is used only when reading binary files. Term "rb" stands for "read binary".
data = f.read() #we are assigning a variable which will read whatever in the file and it will be stored in the variable called data.
print(data)
``` | Reading a file in python is trivial (as mentioned above); however, it turns out that if you want to read a binary file and decode it correctly you need to know how it was encoded in the first place.
I found a helpful example that provided some insight at <https://www.devdungeon.com/content/working-binary-data-python>,... |
3,927,936 | Suppose I have a class like
```
class A {
int x;
int y;
public:
getSum1() const {
return getx() + y;
}
getSum2() const {
return y + getx();
}
getx() const {
return x;
}
}
```
And then I have
```
int main(int argc, char **argv) {
A *a = 0;
switch(argc... | 2010/10/13 | [
"https://Stackoverflow.com/questions/3927936",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/371623/"
] | When you called those functions on a null pointer, you got [undefined behavior](https://stackoverflow.com/questions/2474018/when-does-invoking-a-member-function-on-a-null-instance-result-in-undefined-behav). That's really all that should be said; anything can happen, don't do it.
The reason it segfaults is because the... | "When is the segfault thrown?" Sometimes is **never** thrown, when should be thrown.
Base of **most implementation** is Operation System with **protection of memory**. When OS is absent (embedded), or is very simply (CP/M, DOS), or has "low profile" goal (embedded), or CPU haven't such functionality (<80186) problem i... |
12,628,315 | I have a 202 byte key and that is used to decrypt a binary file.
```
StringSource keyStr( key, Z3_KEY_LENGTH, true );
AutoSeededRandomPool rng;
ECIES<ECP>::Decryptor ellipticalEnc( keyStr );
unsigned char *tmpBuffer( new unsigned char[ src.Size() ] );
DecodingResult dr = ellipticalEnc.Decrypt( rng, src.Data(), src.Siz... | 2012/09/27 | [
"https://Stackoverflow.com/questions/12628315",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1704330/"
] | Well, I don't really know what you are trying to do in your code. I'll try and answer some of the questions.
---
>
> Convert ECIES ECP CryptoPP to JAVA
>
>
>
To get the point out of Crypto++, its about as hard as:
```
// Assuming your key was DER Encoded
byte key[Z3_KEY_LENGTH] = ...;
ECIES<ECP>::Decryptor dec... | Have you tried adding some empty bytes to the end of your key so that it is 208 bytes long? That might fix your block size error. |
18,130,548 | i'd like to store into a mailbox table the folder, the message should be inside as an int. Like 0 is inbox, 1 is outbox, ...
Is there a way to make the result of the query give me back a result like 'INBOX' for the stored value of 0?
Greetings | 2013/08/08 | [
"https://Stackoverflow.com/questions/18130548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You may store them as `ENUM('INBOX', 'OUTBOX')`. They will be stored as integers.
It'll be possible to write them as strings and as integer representation. They will be read as text by default. | You can use a nested IF statement:
```
select if(folder=0, 'Outbox', if(folder=1, 'Inbox', 'Sent')) as folder, msg_id,... from messages;
``` |
23,283,853 | I am unable to figure out reason for NullPointer exception in my Spring project. Sometime project works fine but some time its throwing null pointer Exception here is full stacktrace.
```
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServ... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23283853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3413684/"
] | The exception actually comes when the redirect page requires session and the page context setup machanism (PageContextImpl.java:146) tries to create a session. However the session id generator is somehow null this time
```
ManagerBase.java:807.....
protected String generateSessionId() {
String r... | Have you configured the view resolver in application context for the jsp? like below
```
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/pages/" />
<property name="suffix" value=".jsp" />
<pr... |
51,544 | This may seem like a weird question, but something got me thinking about it just recently.
The Sun's core is composed of mainly hydrogen and helium, and is present in the form of a extremely hot supercrushed plasma. The Sun's core is mind-bogglingly dense, about 150,000 kg/m3 (about 15x denser than lead, 7x denser tha... | 2023/01/08 | [
"https://astronomy.stackexchange.com/questions/51544",
"https://astronomy.stackexchange.com",
"https://astronomy.stackexchange.com/users/47665/"
] | It is not solid. But it is hard. Its Young's modulus is about $10^{16.5}\text{ Pa}$. It is thousands or millions of times more than the Young's modulus of any ordinary solid matter. For comparison, the largest Young's modulus is approximately $10^{12}\text{ Pa}$ for diamond. | >
> The Sun's core is mind-bogglingly dense, about 150,000 kg/m3 (about
> 15x denser than lead, 7x denser than uranium, 6x denser than osmium).
>
>
>
Such a high pressure would compress matter into a [wigner crystal](https://en.wikipedia.org/wiki/Wigner_crystal) (but with nuclei against an electron background inst... |
10,713 | I'm interested in running a promotion ...
I'd like to make a product free if the customer's cart total is $10.
I was able to do that with this module: <http://drupal.org/project/uc_discounts_alt>
Everything is working great, but I don't want my customer to be able to add the product to their cart unless they are buy... | 2011/09/06 | [
"https://drupal.stackexchange.com/questions/10713",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1813/"
] | To prevent your customers to add the product to their cart if it's $10 with regular products, You can use ubercart [hook\_add\_to\_cart](http://drupalcontrib.org/api/drupal/contributions!ubercart!docs!hooks.php/function/hook_add_to_cart/6) .
for example:
```
function MODULENAME_add_to_cart($nid, $qty, $data) {
$con... | Learning the Rules framework could really help you here.
there is an excellent tutorial [here](http://nodeone.se/en/learn-the-rules-framework) by Johan Falk
just follow along and you will be able to do the above in no time. |
2,389,735 | The variance is defined as
$$\sigma^2 = \frac{\sum\_{i=1}^n (x\_i - \bar x)^2}{n}$$
where, $\bar x = \frac{\sum\_{i=1}^n x\_i}{n}$
If someone wants to estimate this parameter from a sample (s)he must do
$$s^2 = \frac{\sum\_{i=1}^n (x\_i - \bar x)^2}{n-1}$$
as the variance (as would be calculated by $\sigma^2$) of ... | 2017/08/11 | [
"https://math.stackexchange.com/questions/2389735",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/87728/"
] | $\newcommand{\v}{\operatorname{var}} \newcommand{\e}{\operatorname{E}} \newcommand{\c}{\operatorname{cov}}$
The linear nature of expectation tells us that
$$
\e\left( \sum\_{i=1}^n (X\_i - \bar X)^2 \right) = \sum\_{i=1}^n \e \left( (X\_i-\bar X)^2 \right) = n\e\left( (X\_1- \bar X)^2 \right) \tag 0
$$
where the second... | The statement that $\displaystyle\sigma^2 = \frac{\sum\_{i=1}^n (x\_i - \bar x)}{n}$ is true only if each value $x\_i$ has the same probability $1/n$ and $x\_1,\ldots,x\_n$ includes every member of the population exactly once.
The usual argument for the proposition that $\displaystyle \frac{\sum\_{i=1}^n (x\_i-\bar x)... |
11,220,121 | I basically need a way of guaranteed O(log n) deletion. Can this be done with a binary tree, or is it always worst case O(n)?
What if I balance the tree everytime?
please help | 2012/06/27 | [
"https://Stackoverflow.com/questions/11220121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/809240/"
] | If you are looking for a balanced binary tree, you could use the "heap"
<http://en.wikipedia.org/wiki/Heap_(data_structure>) | You need a [Binary Search Tree](http://en.wikipedia.org/wiki/Binary_search_tree#Deletion)
As the wiki page above said:
*thus in the worst case it requires time proportional to the height of the tree*
which means if you can make it always balanced, you can get O(logN) for deletion |
386,297 | $$\frac{12}{15} = 0.8\\
\frac{15}{12} = 1.25$$
If $15$ divided by $12 = 1.25$ shouldn't $12$ divided by $15$ be the same as $\frac{15}{12}$ and have the same result?
Can someone please explain this step by step thank you. | 2013/05/09 | [
"https://math.stackexchange.com/questions/386297",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/76951/"
] | Are you using division as the operation? If so, then this example may help:
(1) I have 12 cookies, but there are 15 people in the room. I don't have enough cookies, but if I still want to share evenly, how many cookies should each person get?
(2) Now reverse, I have 15 cookies, but there are only 12 people in the ro... | $\frac{12}{15}$ has 15 as the divisor and thus is less than 1 and is in fact the same as $\frac{4}{5}=.8$ while the flip of this is $\frac{5}{4}=1.25$ which is the same as $1+\frac{1}{4} = 1 + 0.25$ where 12 is the divisor in this case. |
33,887,289 | I am working on a windows form application where i have some textboxes values and two buttons, one is **SAVE** and the other is **EDIT**. The buttons code for saving record upon **CLICK** is working very fine. But now i want to add the **keyboard shortcut** keys to SAVE and EDIT record by **pressing CTRL+S for SAVE** a... | 2015/11/24 | [
"https://Stackoverflow.com/questions/33887289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4623453/"
] | At first, you should set the `Form.KeyPreview` property of your `Form` to `true`.
Cause `Form.KeyPreview` property([as MSDN says](https://msdn.microsoft.com/en-us/library/system.windows.forms.form_properties(v=vs.110).aspx)):
>
> Gets or sets a value indicating whether the form will receive key
> events before the e... | Add a `MenuStrip` to your form. Add two `ToolStripMenuItem` Save and Edit, attach them your EventHandler button clicks. Assign the desired values (Ctrl+S, Ctrl+E) to the `ShortcutKeys` property.
If your application does not require main menu then you can hide it (`Visible` = false). |
41,016,861 | I need your advice on the best way to traverse through and return values from a database (as shown below). The structure of the database is set by another application.
How the system currently returns the value of a user with ID=6 in this case:
Look for item instance and item module (1 and training) and return the r... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41016861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2381087/"
] | Just join them together :
```
SELECT g.*
FROM grade_items g
JOIN grade_grades g2
ON(g2.id = g.itemid)
WHERE g2.itemmodule = 'training' and g2.iteminstance = '1'
```
Or alternatively , use `IN()` :
```
SELECT g.*
FROM grade_items g
WHERE g.itemid IN(SELECT g2.id FROM grade_grades g2
WHERE g2.item... | Use **JOIN** which is combine rows from two or more tables
```
SELECT *
FROM grade_grades
JOIN grade_items ON grade_grades.id = grade_items.itemid
WHERE itemid = 4
``` |
976,754 | I am having a frustrating time trying to do something with Perl that would take a couple of lines of code in C#, namely to call a web service on a Windows server that requires Integrated Windows Authentication.
The most likely candidate I've found for success is a module called LWP::Authen::Ntlm, but all the examples ... | 2009/06/10 | [
"https://Stackoverflow.com/questions/976754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Here's an idea: start an iexplore process to call a script on a server, since Internet Explorer uses the logged on user as a default logon when accessing servers on the same domain.
Maybe you can achieve something using OLE with the Win32 Modules listed [here](http://win32.perl.org/wiki/index.php?title=Win32_Perl_Modu... | I think heeen is on a good path with Win32::API, and I suspect that you'll need to roll your own user agent to manage the NTLM handshake with the IIS server. That's not all that bad, the interaction is well understood.
This smells a little like something that Samba could help you with, too. Searching around, there's a... |
756 | Here at Japanese SE, we see many questions along the lines of "Do you know any books/programs/websites that would help me learn XYZ in Japanese?", even though [we](https://japanese.meta.stackexchange.com/a/797/29) (and the stack exchange network [in general](http://blog.stackoverflow.com/2010/11/qa-is-hard-lets-go-shop... | 2012/04/19 | [
"https://japanese.meta.stackexchange.com/questions/756",
"https://japanese.meta.stackexchange.com",
"https://japanese.meta.stackexchange.com/users/1272/"
] | Online Dictionaries
===================
---
### Monolingual Dictionaries
* 三省堂 大辞林 第三版 *Sanseidō Daijirin, 3rd ed.* - [kotobank.jp](https://kotobank.jp/) - [weblio.jp](http://www.weblio.jp/)
* 小学館 大辞泉 第二版 *Shōgakukan Daijisen, 2nd ed.* - [goo.ne.jp](http://dictionary.goo.ne.jp/jn/) - [kotobank.jp](https://kotobank.j... | Learning Classical and Medieval Japanese
========================================
* [Getting started with Edo literature](http://no-sword.jp/blog/2011/01/reading.html)
* [文語 Bungo](http://kafkafuura.wordpress.com/classical-japanese/)
* [Reading kuzushiji, kanbun, and other premodern Japanese](http://avery.morrow.name/... |
36,908,161 | I'm trying to print a char array after a for loop to see the output to make sure it's correct. However, it won't print the string. Why won't it print the string? Am I missing something? It prints the index println string but not the Tag bit won't print. What am I missing?
Here is my code
```
char *getTag(char *addres... | 2016/04/28 | [
"https://Stackoverflow.com/questions/36908161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5386926/"
] | You write to`resultTag` starting from an offset `INDEX`, but attempt to print it from the initialised start. If the start happens to contain zero, it will print nothing.
Moreover, the final print does not end in a *newline* and the output stream is not flushed so will not be displayed immediately on some systems. | You need to flush stdout, or add a \n (stdout autoflush on new-line)
```
printf("Tag Bit %s\n", resultsTag); //<-----Won't print the string
fflush (stdout);
``` |
16,193,499 | I need a select statement which always returns at least one record. Something like this
```
SELECT id, date FROM mytable WHERE id = <INPUT_ID> AND date = <INPUT_DATE>
UNION ALL
SELECT VALUE_FROM_FILTER(id), VALUE_FROM_FILTER(date) WHERE NOT EXISTS (SELECT * FROM mytable WHERE id = <INPUT_ID> AND date = <INPUT_DATE>)
... | 2013/04/24 | [
"https://Stackoverflow.com/questions/16193499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970707/"
] | >
> Do I have to iterate "manually" through all rows to find these max and
> min values?
>
>
>
Define *manually*. Yes, you have to calculate the `Min` and `Max` values by enumerating all `DataRows`. But that can be done either with the old `DataTable.Compute` method or with
[**Linq**](http://msdn.microsoft.com/... | Try this:
```
var min = myTable.AsEnumerable().Min(x => (int)x["column"]);
var max = myTable.AsEnumerable().Max(x => (int)x["column"]);
```
You'll need to make sure you have a reference to `System.Data.DataSetExtensions`, which is not added to new projects by default. |
7,253,217 | I'm making a WP7 app, which is consuming an ASMX which I can't touch, nor adapt, since I'm not the creator, nor the provider, I'm just consuming it.
When I add the service reference to my WP7 solution (not mango - but it's the same behaviour in mango), I'll uncheck the "Reuse types in referenced assemblies" because I ... | 2011/08/31 | [
"https://Stackoverflow.com/questions/7253217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/921042/"
] | What's happening here is that the sum is being evaluated from left to right and this is causing a different type of addition to be performed than what you would expect. In C#, you can add two strings. If you add `"foo"` to `"bar"` then this will give you the string `"foobar"`. If you add a string and a number together,... | You have 2 problems here. The first one is the "" at the beginning. When you do the first +, textBox1.Text is first parsed, then converted to string again by the string concatenating operator. I'd prefer something like this:
```
textBox4.Text = (int.Parse(textBox1.Text) + int.Parse(textBox2.Text) + int.Parse(textBox3.... |
77,817 | Why are the names of these letters so different from how they are actually used in words ?
1. **F** - there are no words that start with an "F" that use the pronunciation "ɛf".
2. **L** - there are no words that start with an "L" that use the pronunciation " ɛl"
Similarly, **M** (ɛm), **N** (ɛn), **H** (etʃ), **... | 2016/01/04 | [
"https://ell.stackexchange.com/questions/77817",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/27122/"
] | The names of most consonants in English contain a common sound of the consonant, plus enough of a vowel sound that the name is a syllable. In some consonant names, the vowel sound precedes the consonant sound. In other consonant names, the vowel sound follows the consonant sound. There are three exceptions. "H"'s name ... | This answer might complement the previous ones.
Names of letters should be taught with less strenght than sounds, we may say. Which is important is to know how a sound correspond with a particular symbol, and the inverse in order for the language to be complete.
In any alphabet we write some symbols:
>
> a, b, c, ... |
16,171,223 | I have an issue with [the site](http://jsfiddle.net/Jxrw7/2) I am working on.
The top logo seems to have some kind of margin to the top, even though I have specifically set it to have no margin and its parents' have no padding.
```
body{
margin: 0;
padding: 0;
min-width: 320px;
background-image: url... | 2013/04/23 | [
"https://Stackoverflow.com/questions/16171223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It's line 98 in main.css thats causing your issue.
```
.menuAvatar {
vertical-align: middle; // THIS LINE
margin: 0 5px 0 -15px;
}
```
When vertical align is removed the image aligns correctly. You can either find a different way to accomplish what you are using the `vertical-align` for, or you can use the following... | On line 98 of `main.css`, you have the following rule:
```
.menuAvatar{
vertical-align: middle;
margin: 0 5px 0 -15px;;
}
```
I would recommend setting `vertical-align` to `top`, resulting in:
```
.menuAvatar{
vertical-align: top;
margin: 0 5px 0 -15px;
}
``` |
779,642 | We had a file in our repository that we deleted several revisions ago. How do we get it back using TortoiseSVN without reverting our entire repository? | 2009/04/22 | [
"https://Stackoverflow.com/questions/779642",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72631/"
] | Go to the Show Log screen, and search for the revision when the file was deleted, then right click the file and select **Save revision to...**
 | In the repo browser, there is a menu that says some to the effect of goto version. From here you can browse the field that was available in that revision and drag and drop the file out. i would check the actual program bur I'm currently on my phone.
Hope this helps |
19,316,178 | Database: Oracle 11g
I am working on a greenfield project and designing a database schema. I have an audit table which, as the name suggests,
will grow to hold huge number of records eventually. Following is the table definition (after pruning the extraneous columns).
```
create table ClientAudit (
id ... | 2013/10/11 | [
"https://Stackoverflow.com/questions/19316178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/846051/"
] | The key is to let your MVC application (consumer) impersonate the calling user and then issue the HTTP requests synchronously (i.e. without spawning a new thread). You should not have to concern yourself with low-level implementation details, such as NTLM vs Kerberos.
Consumer
========
Configure your MVC application ... | The key issue with double hop is delegation of user credential to second call. I want to elaborate a little bit about it. C1 = client browser , S1 = First Server , S2 = Second Server.
Suppose our complete system support window authentication. When user access S1 from browser , its default window credential pass to se... |
85,947 | I have some questions about the Hill cipher.
1. There is a rule for key K:
`Determinant of matrix and number of characters of the alphabet must be coprime.` What does this rule say? Why it must be like this? So If I had determinant 5 and characters 30, it would not work?
2. Let's assume I have key K which should be 3x... | 2020/11/02 | [
"https://crypto.stackexchange.com/questions/85947",
"https://crypto.stackexchange.com",
"https://crypto.stackexchange.com/users/84613/"
] | The Hill Cipher as one of the classical cipher is [invented by Lester S. Hill in 1929](https://web.archive.org/web/20110719235517/http://w08.middlebury.edu/INTD1065A/Lectures/Hill%20Cipher%20Folder/Hill1.pdf). It is the first polygraphic cipher that can operate more than one letter at a time.
>
> 1. There is a rule f... | when you are encrypting a five letter word using a 3x3 matrix key, you are supposed to add letters X and Y to the lonely character for instance the word ENCRYPT will be ENC RYP TXY. |
57,160,634 | I have an issue with my site; I cannot find a way to make my content stop overlapping when the actual display size is smaller than the original display size - `1920x1080`.
I would like to know how I could either scale down the whole page or just make my content not overlap.
Thanks in advance for any help provided!
``... | 2019/07/23 | [
"https://Stackoverflow.com/questions/57160634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10647155/"
] | I'd use this more efficient version using [`String.Substring`](https://learn.microsoft.com/en-us/dotnet/api/system.string.substring?view=netframework-4.8#System_String_Substring_System_Int32_) and the [string constructor](https://learn.microsoft.com/en-us/dotnet/api/system.string.-ctor?view=netframework-4.8#System_Stri... | I suggest you use the original array for iterating so that you can make use of its index to create the mask. A `String.Join()` may help you to produce the masked output. The code would be something like this:
```
string maskedInput = String.Join("", str.Select((c, index) => index < 10? '*' : c));
```
Here is a [work... |
50,765,848 | When I make a get request to get all tournaments I have paginated, I receive this kind of json.
```
{
"data": [...],
"links": {...},
"meta": {...}
}
```
Now My Component, I get all the tournaments
```
getTournaments(): void {
this.tournamentService.all()
.subscribe(tournaments => this.tournaments = tournament... | 2018/06/08 | [
"https://Stackoverflow.com/questions/50765848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1956558/"
] | If you look at the error, it is from the component.html, You need to use safe navigation operator or \*ngIf inorder to handle the delay of response from your asynchronous request,
Also since youw want to count the number of eleemnts in the arrya, change your template as,
```
{{ tournaments?.meta?.total }}
``` | I cant see your html but it sounds like you need to make sure the data exists before you use it. using `*ngIf`... here are a few examples
```
<div *ngIf="tournaments">
<div *ngFor="let item of tournaments;">
<div *ngIf="item?.meta">
{{item.meta}}
</div>
</div>
</div>
``` |
24,355,976 | I was wondering how I can change the line length in IntelliJ.
Since I use a pretty high resolution, I get that line that shows 120 characters straight through the middle of the screen. Can I change it from 120 to, say, 250? | 2014/06/22 | [
"https://Stackoverflow.com/questions/24355976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3685412/"
] | It seems like Jetbrains made some renaming and moved settings around so the accepted answer is no longer 100% valid anymore.
**Intellij 2018.3**:
`hard wrap` - idea will automatically wrap the line as you type, this is not what the OP was asking for
`visual guide` - just a vertical line indicating a characters limi... | Open `.editorconfig` in the root of your project (or create one if you don't have any) and add:
```
max_line_length = 80
```
The IDE should pick it up immediately (works in phpStorm, developed by the same company). As a bonus, it can be committed to GIT and will stay consistent across different editors you may be us... |
1,370,163 | Studying forcing I came across different definitions of the forcing relation $\Vdash$:
* the *outer* forcing relation $\Vdash^M$ where we define $p \Vdash^M \varphi(\tau\_0,\dotsc,\tau\_n)$ to hold if for every generic $G$ with $p \in G$ we have $\varphi^{M[G]}(\tau\_0^G,\dotsc,\tau\_n^G)$.
* the *inner* forcing relat... | 2015/07/22 | [
"https://math.stackexchange.com/questions/1370163",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/111080/"
] | The recursive definition is the common way of proving that the forcing relation is definable in the ground model, which is not at all clear from the generic filter definition.
When one wants to analyze both the ground model and some generic extension, the definability of the forcing relation is used. For instance, if... | Try avoiding internal forcing while showing the following: In every Cohen real extension, every $\omega$-sequence of ordinals equals a ground model $\omega$-sequence infintely often.
Let me know if this seems boring and I will give you harder ZFC facts. |
553,362 | For some reason, my root crontab does not seem to be running.
Trying to reboot the device every night at midnight.
Should be the following as root:
```
crontab -e
```
Then add:
```
0 0 * * * /sbin/shutdown -r now
```
When I test using some values close current time, nothing happens. I installed NTP and made sur... | 2014/11/24 | [
"https://askubuntu.com/questions/553362",
"https://askubuntu.com",
"https://askubuntu.com/users/177227/"
] | I have three solution suggestions for you.
1. Invoke the crontab with `crontab -e -u root`
2. Make sure that you have an empty line at the end of the cronjob file, meaning that every line ends with a newline.
3. You might need to redirect the output to devnull: `shutdown -r now > /dev/null`
Here are two helpful webpa... | 36 17 \* \* \* etc ..
36 17 is not a way to specify the right time in your cron.
check via date command to see if your system is working in US time or Europ time
use 17 36 if europ time and if your system use 24 H time
or
5 36 if your system use US TIME and 12 H time |
55,173,819 | **Update : I re-worded and re-thought through this, and I think the question is better asked like this.**
So I've been hacking at this forever with no luck. Here is an example of what I am looking to do.
I am starting off with a dataframe:
```
df = data.frame("one" = c(1,11), "two" = c(2,22), "three" = c(3,33))
one... | 2019/03/15 | [
"https://Stackoverflow.com/questions/55173819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8355471/"
] | I think this should just be a `Map` exercise:
```
df$new <- Map(c, df$two, df$three)
df
# one two three new
#1 1 2 3 2, 3
#2 11 22 33 22, 33
library(jsonlite)
toJSON(df[c("one","new")])
#[{"one":1,"new":[2,3]},{"one":11,"new":[22,33]}]
```
If you've got many variables, you can wrap it in `do.call... | In python, using `pandas`:
```
import pandas as pd
df = pd.DataFrame([[1,2,3],[11,22,33]], columns=["one", "two","three"])
one two three
0 1 2 3
1 11 22 33
df['new'] = list(zip(df.two, df.three))
df[['one','new']].to_json(orient='records')
# '[{"one":1,"new":[2,3]},{"one":11,"new":[22,33]}]'... |
586,175 | I am more in mechanics then in electrical engineering so sorry if this question sounds silly for you.
I have a little CNC machine with NEMA 17 stepper motors but their power is not enough for me, so I decided to change them for NEMA 23 stepper motors. I am not sure if my current adapter of **12V and 5A** is enough to ... | 2021/09/10 | [
"https://electronics.stackexchange.com/questions/586175",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/295586/"
] | This question highlights the need to understand the problem space and shows that leaving out information makes providing accurate answers very difficult.
To summarize the question with most of the necessary information:
**I have a little CNC machine with NEMA 17 stepper motors and a 12V/5A power supply but their power... | You can calculate that 3 motors requiring 3 A each require 3x3 = 9 amps. Even two motors would require 2x3 = 6 amps.
Your power supply is therefore only adequate to run one motor, making no other assumptions.
Sometimes stepper motor drivers are set up to use a lower holding current than their stepping current, so wou... |
1,361,946 | I must verify if the real part of the following expression
$$z = \frac{1 + i}{\sigma \delta \left[ 1 - e^{-(1 + i)t/\delta} \right] }$$
is
$$\Re(z) = \frac{1}{\sigma \delta} \frac{1}{1 - e^{-t/\delta}}$$
where $t, \sigma, \delta$ are real, positive quantities and $i$ is the imaginary unit.
1) First of all, I thin... | 2015/07/15 | [
"https://math.stackexchange.com/questions/1361946",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/132192/"
] | I've checked my answer with Mathematica and it gives me the same, it's much more complicated as you thought, so your answer isn't good!
---
$$z = \frac{1 + i}{\sigma \delta \left(1 - e^{-(1 + i)t/\delta} \right)}=
\frac{1 + i}{\sigma \delta \left(1 - e^{-\frac{(1+i)t}{\delta}} \right)}$$
Assuming $\sigma,\delta,t\in... | **Without computing**:
The denominator of $z$ has non-trivial roots (when the argument of the exponential is $i2k\pi$); not the denominator of $\Re(z)$. |
1,755,124 | How can I add a Button column to a Datagrid programmatically? I want to do this through code in the code-behind file.
Also i want to selectively enable or disable this button based on record (If status is Open then Enable it else disable this button). Here Status is a Column in the DataSource.
Thanks,
Abhi | 2009/11/18 | [
"https://Stackoverflow.com/questions/1755124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/213658/"
] | Xaml :
```
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Click="Details">Details</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate... | XAML:
```
<DataGrid.Columns>
<DataGridTemplateColumn Header="Check">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox x:Name="chkName" IsChecked="{Binding IsChecked , UpdateSourceTrigger=PropertyChanged}" Click="c... |
5,016,181 | I am wondering about the following code:
```
<html>
<head>
<title>Test HTML</title>
<link rel="stylesheet" type="text/css" href="test.css">
</head>
<body>
<table class=foo cellpadding="2" cellspacing="2">
<tr>
<td><b>Contingency Table:</b></td>
<td><ta... | 2011/02/16 | [
"https://Stackoverflow.com/questions/5016181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271775/"
] | xzyfer's reasoning is right. A simple workaround could be to *add*
```
table table.bar td { background-color: green !important; }
```
Assuming your nesting is at most 2 levels, this works fine, because it overrides the cascading effect described (i.e. the rule applied is no longer dependant on the order the rules ar... | If you only want yto effect the direct children of table foo you need some child selectors.
You might need to look thees up as I know they can be used as a work around for older browsers. Additionally I'd advise adding tbody to your table as firefox does this automatically and it messed up my testing of the child selec... |
1,448,858 | How can I color Java output?
For example in C and other languages I can use ANSI-escape like `\033[0m` to do this. But in Java it doesn't work.
```
public static void main(String[] x) {
System.out.println("\033[0m BLABLA \033[0m\n");
}
``` | 2009/09/19 | [
"https://Stackoverflow.com/questions/1448858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/173787/"
] | Check This Out: i used ANSI values with escape code and it probably not work in windows command prompt but in IDEs and Unix shell.
you can also check 'Jansi' library [here](https://github.com/fusesource/jansi) for windows support.
```
System.out.println("\u001B[35m" + "This text is PURPLE!" + "\u001B[0m");
``` | I've written a library called [AnsiScape](https://github.com/nomemory/ansiscape) that allows you to write coloured output in a more structured way:
Example:
```
AnsiScape ansiScape = new AnsiScape();
String colors = ansiScape.format("{red {blueBg Red text with blue background}} {b Bold text}");
System.out.println(col... |
19,779,139 | I need to be able to dynamically retrieve the current action and controller name of whatever page you're on, and actually use them to create a new HTML.ActionLink that links to the same action and controller name, but in a different area. So I guess I need to retrieve the current action and controller name as variables... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19779139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1637341/"
] | Use `ViewContext.RouteData` to determine current Controller and Action:
```
@Html.ActionLink("Spanish Version",
ViewContext.RouteData.Values["action"] as String,
ViewContext.RouteData.Values["controller"] as String,
new { Area = "es" })
``` | If the actionName is only for `@Html.ActionLink()`, you can simply pass `"null"` as the actionName. The current actionName will be used. |
10,010,604 | I have defined a sencha List as below
```
Ext.List({
itemTpl: '<div class={filterClass}></div>{filterType}',
id: 'sFilter',
width: 200,
cls: 'sFilter',
grouped: false,
indexBar: false,
... | 2012/04/04 | [
"https://Stackoverflow.com/questions/10010604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214647/"
] | You can split that into 3 lines for understanding
```
StringBuffer reverseBuffer = new StringBuffer(name); // Creating new StringBuffer object
reverseBuffer = reverseBuffer.reverse(); //Reversing the content using StringBuffer
String reverse = reverseBuffer.toString(); // Converting StringBuffer to String and saving ... | From the JAVA API
public StringBuffer reverse()
Causes this character sequence to be replaced by the reverse of the sequence. If there are any surrogate pairs included in the sequence, these are treated as single characters for the reverse operation. Thus, the order of the high-low surrogates is never reversed. Let n... |
31,335,601 | In the following expression, what conversion happens?
```
long long a;
long long b;
double c;
b=a*c;
```
suppose the `long long` type is 8-byte.
If `a` and `b` are both `int`, then in the expression `b = a * c`, `a` will be converted to `double` and does multiplication with `c`, and the result will be converted to ... | 2015/07/10 | [
"https://Stackoverflow.com/questions/31335601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/668249/"
] | ```
b=a*c;
```
is equivalent to:
```
b=(long long) ( (double)a * c );
```
So there are two conversions involved, first from `long long` to `double` and second from `double` result to `long long`
For more details check [this page from Joachim Pileborg's](https://stackoverflow.com/questions/31335601/what-conversion... | As per `C11` standard, chapter §6.3.1.8, *Usual arithmetic conversions*
>
> ....Otherwise, if the corresponding real type of either operand is double, the other
> operand is converted, without change of type domain, to a type whose
> corresponding real type is `double`.
>
>
>
So, your statement is essentially,
... |
34,436,146 | Guys i have an html div and here is the code
```
<div id="mainBody"></div>
```
I gave it a background image in css and here is the code
```
#mainBody{background : url(../images/index/optimizedBackground.jpg) repeat 0 0;}
```
I want to add a color on it but this color is opacity and view the background image.
so... | 2015/12/23 | [
"https://Stackoverflow.com/questions/34436146",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5683473/"
] | Add `clear: left;` on the `.navbar hr` and it works.
When using floats, you always want to 'clear' the floats after that to stop bad things happening to your design. Take a look at <https://css-tricks.com/the-how-and-why-of-clearing-floats/>
```css
li {
list-style-type: none;
margin: 0;
padding: 0;
float... | Change the css according to the code and it will work
```
.navbar hr {
border-color: #cc9900;
float: left;
display: block;
width: 100%;
}
``` |
14,113,788 | It is known that Metacello first or main target was Pharo, but it seems now that [Squeak 4 is supported](https://github.com/dalehenrich/metacello-work/blob/master/docs/MetacelloScriptingAPI.md). I've tried but fails due a missing method. From the Transcript:
```
Starting atomic load
Loaded -> OSProcess-dtl.65 --- ... | 2013/01/01 | [
"https://Stackoverflow.com/questions/14113788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1000565/"
] | The above solution is no longer valid
u need to get it using this below code
```
(Installer monticello http:'http://seaside.gemtalksystems.com/ss')
project: 'metacello';
install: 'ConfigurationOfMetacello'.
((Smalltalk at: #ConfigurationOfMetacello) project
latestVersion) load.
``` | I just ran this (as proposed by the install doc on Github) in 4.4 and had no problems whatsoever:
```
Installer gemsource
project: 'metacello';
install: 'ConfigurationOfMetacello'.
((Smalltalk at: #ConfigurationOfMetacello) project
version: '1.0-beta.32') load.
```
What code are you using? |
2,702,017 | Jquery - How do I change the parent of an element from an H1 to a P?
I have `<h1>heading</h1>`, how do I change it to `<p>heading</p>`
I think I could `$.unwrap` then `$.wrap`, but is there a better way? | 2010/04/23 | [
"https://Stackoverflow.com/questions/2702017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/243494/"
] | This question is pretty close (I would consider it a duplicate) of [How do I change an element (e.g. h1 -> h2) using jQuery / plain old javascript?](https://stackoverflow.com/questions/240467/how-do-i-change-an-element-e-g-h1-h2-using-jquery-plain-old-javascript)
Using this solution, your answer would resemble
```
va... | HTML:
```
<h1 id="a">heading</h1>
```
jQuery:
```
var $a = $('#a');
var contents = $a.contents();
$a.remove();
$('body').append('<p>' + contents + '</p>');
```
`$.unwrap` would remove the parent of the matched element. In other words, if `#a` were the child of a `div`, the `div` would be removed and not the `h1... |
59,990,814 | I've followed the instructions here [gatsby tutorial:3](https://www.gatsbyjs.org/tutorial/part-three/) under the "Using Gatsby Plugins" section. But I can't get the fairy theme to appear. The `<style>` element never gets added to the `<head>` element. My only guess is this warning I get within the typography.js:
Could... | 2020/01/30 | [
"https://Stackoverflow.com/questions/59990814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1352833/"
] | You have become a victim of [operator precedence](https://en.cppreference.com/w/cpp/language/operator_precedence).
First dereference to get a `Point*`, then use `->`
```
(*ptrPtrPoint)->displayCoord();
```
The compiler reads the original code as
```
*(ptrPtrPoint->displayCoord());
``` | The problem is the ***operator precedence***.
You need first to dereference the pointer to pointer and then call the function with the `->`. The right line of code is this:
```
(*ptrPtrPoint)->displayCoord();
```
pay attention to the operator precedence because in this case the compiler give you an error, but this... |
43,344,912 | Hi i'm new in React Native.
I am trying to create two columns layout with space beetween using react native component called flatList.
Here is my view Code:
```
<View style={styles.container}>
<FlatList
data={db}
keyExtractor={ (item, index) => item.id }
numColumns={2}
... | 2017/04/11 | [
"https://Stackoverflow.com/questions/43344912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559599/"
] | Just add some margin to the style of the list Item.
```js
listItem: {
margin: 10,
}
``` | How to create two columns with equal spacing between items:
```
<FlatList
data={DATA}
renderItem={renderItem}
keyExtractor={(item) => item.id}
horizontal={false} // you must include this line when using numColumns [per the documentation][1]
numColumns={2} // creates two... |
220,274 | **The task**
is taken from [leetcode](https://leetcode.com/problems/reverse-integer/)
>
> Given a 32-bit signed integer, reverse digits of an integer.
>
>
> **Example 1:**
>
>
>
> ```
> Input: 123
>
> Output: 321
>
> ```
>
> **Example 2:**
>
>
>
> ```
> Input: -123
>
> Output: -321
>
> ```
>
> **Example... | 2019/05/15 | [
"https://codereview.stackexchange.com/questions/220274",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/54442/"
] | * The question states that the input is a number 32 signed int so checking for `undefined` or `null` is a waste of time.
The solution is a little long. Some of it due to not being familiar with some old school short cuts.
* To get the sign of a number use [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/Jav... | Both answers require you to use `Math.sign`. To avoid compatibility issues with some browsers, you could add the following script in your solution.
```
if (Math.sign === undefined) {
Math.sign = function ( x ) {
return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : +x;
};
}
``` |
22,849,037 | I'm not sure how to add the target=\_blank to my code below. I am using Codeigniter and my image below contains an external link and works like a charm. I would love to have it open in a new window or tab but I'm unsure how to do it. I haven't found anything so far of anyone else using this method. Any suggestions are ... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22849037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2434412/"
] | Err, pass the attribute as the third argument to `anchor()`
```
<?php
echo anchor(
'http://www.facebook.com/artisticconcretegroup',
img(array(
'src'=>base_url().'images/facebook.png',
'width'=>'32',
'height'=>'32',
'id'=>'facebook',
'alt'=>'Facebook Logo'
)),
['t... | simply add `'target="_blank"'`
eg. `echo anchor("url",'click here','target="_blank"')` |
22,668,047 | I have a button that is pressed after user enters email information. I have an alert view that is displayed when there is no email entered but if there is I want the button to segue to another view controller.
The following code causes my app to crash. I have no idea why. Please help.
(note: I have tried "sender:self... | 2014/03/26 | [
"https://Stackoverflow.com/questions/22668047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3460321/"
] | There are three overwhelmingly likely possibilities:
* Perhaps the storyboard really has no segue named "next" emerging from the FirstViewController scene. Be careful: spaces and capitalization and things like that matter.
* Perhaps the storyboard has a segue named "next" but it emerges from a different scene (a diffe... | Crashing can also occur if the view controller cannot load from the NIB. For example if there is an incorrectly named User Defined Runtime Attribute.
For example `QBFlatButton` changed their API today and my app started crashing. This is why we use semantic versioning :-) |
2,276 | So I am looking into upgrading the gear I use to do a boil. Currently I have a 5 gallon stainless steal pot, I use an electric range to heat the water, and my kitchen sink to cool down the wort. It works, but I have had problems with my wort boiling over lately. I have tried putting less water in for the boil, then top... | 2010/06/25 | [
"https://homebrew.stackexchange.com/questions/2276",
"https://homebrew.stackexchange.com",
"https://homebrew.stackexchange.com/users/573/"
] | I've been contemplating this myself recently. I've looked into induction hotplates, but I've found that they're too expensive for my blood. Here's what's on my list right now:
Just grab a [turkey fryer from Walmart](http://www.walmart.com/ip/King-Kooker-30-Quart-Turkey-Fryer-and-Outdoor-Cooker/10661034) that comes wit... | Bad news:
I doubt you can do the whole shebang for under 150.
According to [Northern Brewer](http://www.northernbrewer.com/brewing), burners range between 50 and 140 bucks, chillers range between 60 and 200 bucks. Kettles are going to be a problem. I don't see anything (in the 8-10 gallon range) for less than 150.
... |
20,207,199 | I have an array in Matlab, let say of (256, 256). Now i need to build a new array of dimensions (3, 256\*256) containing in each row the value, and the index of the value in the original array. I.e:
```
test = [1,2,3;4,5,6;7,8,9]
test =
1 2 3
4 5 6
7 8 9
```
I need as result:
```
[1, 1,... | 2013/11/26 | [
"https://Stackoverflow.com/questions/20207199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/950379/"
] | What you want is the output of `meshgrid`
```
[C,B]=meshgrid(1:size(test,1),1:size(test,2))
M=test;
M(:,:,2)=B;
M(:,:,3)=C;
``` | here's what i came up with
```
test = [1,2,3;4,5,6;7,8,9]; % orig matrix
[m, n] = size(test); % example 1, breaks with value zero elems
o = find(test);
test1 = [o, reshape(test, m*n, 1), o]
```
Elapsed time is 0.004104 seconds.
```
% one liner from above
% (depending on data size might want to avoid dual find call... |
9,731,928 | Not sure if I'm being too clear with the title. Sorry, it's late and I don't think I have a cleared mind.
Anyway what I want this to do is..
1. When the div(manager) is clicked, the div(managerp) appears.
2. The div(manager) moves to the area the same time managerp moves there. Almost as though they move as one div e... | 2012/03/16 | [
"https://Stackoverflow.com/questions/9731928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1267786/"
] | How about this:
```
$(document).ready(function() {
$("#manager").click(function() {
$("#managerp").toggle("slow", function() {
if($("#managerp").is(':visible')){
$("span").html("«");
$("#manager").css({'margin-left' : '0px', 'border-left... | Hope this helps ...
You need to reset Margin-Left to 0. Also hide the div ManagerP at the start.
```
<html>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#managerp").hide();
$("#manager").click(function() {
$("#m... |
38,781,189 | i am windows user and trying to update firebase version using
**npm install -g firebase-tools** but when i run **firebase --version**
it shows the same version.
I also run npm uninstall **firebase --save** and check **firebase --version** it shows same.
what should i do to update my firebase version? | 2016/08/05 | [
"https://Stackoverflow.com/questions/38781189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6349039/"
] | `npm update -g firebase-tools`
or
`npm install -g firebase-tools@3.12.0` to install a specific version
And make sure to restart your **terminal/IDE** otherwise, it won't take effect. | it works to me...
standalone binary: Download the new version, then replace it on your system
if you are using the standalone.[Download the new version](https://firebase.google.com/docs/cli#windows) |
21,759,423 | I have a variable containing the list of selects, then I'd need to filter and find only those that has dependsOn attribute with the value of 'EventType'.
I tried the below but it doesn't find the select and returns 0:
```
var selects = $("select");
var count = selects.find("[dependsOn='EventType']").length
alert(coun... | 2014/02/13 | [
"https://Stackoverflow.com/questions/21759423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133212/"
] | If that attribute is on the actual `select` tag, just do:
```
var selects = $("select[dependsOn='EventType']");
```
Although, `dependsOn` doesn't seem like a valid attribute. Check out custom `data-*` attributes to have completely valid HTML. | try with you'r browser's console (I'm using chrome) and use this:
```
selects = $("select[dependsOn='EventType']");
```
It worked just fine for me.
Hope it helps!! |
18,983,071 | 1. I know you shouldn't, in general, use Regex with HTML. I am using it as a one time tool to strip some data quickly out of a file that has a constant pattern and it will never be used again. I want to use Regex for this task. **I understand that you should not parse HTML with Regex.**
2. No I do not want to use an XM... | 2013/09/24 | [
"https://Stackoverflow.com/questions/18983071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/783284/"
] | This should do it. See this [working demo](https://eval.in/50433)
```
matches = re.findall(r'<b[^>]+>(.*?)</b>(.*?)</p>', str)
```
Regular expression:
```
<b match start of tag '<b'
[^>]+ any character except: '>' (1 or more times)
> match enclosed '>'
( group and capture ... | It's your leading .\* that's causing the last-match. The \* and + qualifiers will match as many as possible of the preceding item while still producing a match
Use the "non-greedy" \*? in place of each \*, and +? in place of each + to get the shortest possible sequence that produces a match.
See: <http://docs.python... |
11,777,921 | I have a Facebook app that I want to use to post on my customer's Facebook Page Walls on their behalf. I have it setup now so that when they authenticate my app I get the Access token, but when I go to post to the wall I am getting the following error: "OAuthException: Error validating access token: The session is inva... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11777921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892221/"
] | I don't any `@Equal` contraint in other Java framework neither in the JSR 303.
To check for password, it's not difficult: in your form object, just write a `public String validate()` method:
```
public class SignupForm {
@Min(6)
public String password;
@Min(6)
public String confirmPassword;
pub... | The below code returns global error.
```
public String validate() {
if(!password.equals(confirmPassword)) {
return "Password mismatch";
}
return null;
}
```
But the snippet below more specifically returns error specific to confirmPassword field.
```
public List<ValidationError> validate(){
List<V... |
6,246,108 | Im having a issue with my code i am working on. I am trying to get a include loaded depending on the status of the user (if they paid and if they have a invalid email. The NULL value is being pulled form the database however it only sends to the entermail.php
Here is my code does anyone see whats wrong?
```
function... | 2011/06/05 | [
"https://Stackoverflow.com/questions/6246108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Try this in the `validemail` function:
```
if (!is_null($validemail)) {
return true;
} else {
return false;
}
``` | Your functions are not using any parameters. And please use parametrized queries or escaping. |
28,721,877 | Im trying to write a Batch script that will log onto a bunch of xp computers (from a supplied list) and get the file modifed info for a particular file. (Same file and location on each Pc)
When the script runs it completes and logs onto each PC ok, but for some reason it passes a null value to `%filename%` and in the ... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28721877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4601062/"
] | I solved it by using the load callback function in steead of the when/done structure.
```
$('.lightbox').after('<div id="insertnationalcontent"></div>')
$('#insertnationalcontent').load(loadlink, function() {
$('#insertnationalcontent .lightbox').remove();
});
``` | `remove` should end properly with a `semi-colon` as it's a statement inside an anonymous function in `done` unlike the arguments you pass to `when`
```
$('#eucontentpage #country-choice .lang-ico').click(function(){
$.when(
$('.lightbox').after('<div id="insertnationalcontent"></div>')
).done(function... |
15,080,557 | I have a ListView with a onListItemListener, I have it so if you tap a ListView Item it removes it, but for some reason if I remove the last item form the list, the app crashes and gives me this error `(java.lang.IndexOutOfBoundsException: Invalid index 3, size is 3)`
Does anyone have any idea what that means?
This ... | 2013/02/26 | [
"https://Stackoverflow.com/questions/15080557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1262576/"
] | I believe I've figured it out, all the answers that said that the `pos` variable was one number too high seemed logical, but I tried them all and they didn't work.
It seems what was wrong was, when I would remove the last item from the list, it would try to refresh the ListView but there wouldn't be anything in it to... | According to the [documentation](http://developer.android.com/reference/android/app/ListActivity.html#onListItemClick%28android.widget.ListView,%20android.view.View,%20int,%20long%29) you should have been using id as the value to remove the item.
like this:
```
adapter.remove(adapter.getItem(id));
``` |
44,105,427 | I want to display my date as day/month/year.
example 31st October 2011
```
echo '<h4>Date Of Birth: '.$row['dob'].'</br></h4>';
``` | 2017/05/22 | [
"https://Stackoverflow.com/questions/44105427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7425144/"
] | You can try below code ::-
```
echo '<h4>Date Of Birth: '.date('dS F Y', strtotime($row['dob'])).'</br></h4>';
// ^^^^^^^ Here the is format of date, in which format you want.
```
**Output will be ::-**
>
> 31st October 2011
>
>
>
For more you can refer [click here](http://php.net... | So if you have that data stored as or you can convert it to 3 variables representing DD MM YYYY then I'd suggest creating array of months and an array of *post-fixes*(don't know how to call it, but in your example it's 31**st**) and getting DD % 10 to use reminder for *post-fix* array
```
$month = ['January','February... |
26,471,239 | How do I place a constant in an Interface in typescript. Like in java it is:
```
interface OlympicMedal {
static final String GOLD = "Gold";
static final String SILVER = "Silver";
static final String BRONZE = "Bronze";
}
``` | 2014/10/20 | [
"https://Stackoverflow.com/questions/26471239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2658276/"
] | You cannot declare values in an interface.
You can declare values in a module:
```
module OlympicMedal {
export var GOLD = "Gold";
export var SILVER = "Silver";
}
```
In an upcoming release of TypeScript, you will be able to use `const`:
```
module OlympicMedal {
export const GOLD = "Gold";
export ... | Since nobody gave the actual answer of how to do it with an `interface` (to be used in interface/class merging for example).
```
interface Medals {
GOLD: 'gold';
SILVER: 'silver';
BRONZE: 'bronze';
}
```
This will make
```
const a: Medals = { ... }
// type of a.GOLD is the literal 'gold'
```
Although you sh... |
71,725,758 | [MDN says](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/marker-end) you can use CSS to define a `marker-end` value for an SVG `<path>`, but all the examples use a `url(#...)` syntax which refers to an existing element in the drawing.
Is it possible to define a marker completely inside the CSS, such that ... | 2022/04/03 | [
"https://Stackoverflow.com/questions/71725758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/472388/"
] | It's not completely impossible, but there are some obstacles. You can style the marker shape with CSS, but not by changing the style of the path that uses the marker. You need to change the style of the marker definition itself. Consequently, you would need a unique marker for every path you want to decorate, otherwise... | Here's a marker encoded as a data URL.
It works on Firefox but it seems [Chrome still doesn't support external markers](https://bugs.chromium.org/p/chromium/issues/detail?id=109212).
```html
<svg viewBox="0 50 120 120" xmlns="http://www.w3.org/2000/svg">
<polyline fill="none" stroke="black"
points="40,60 70,8... |
17,965,626 | I have two class, `User` and `Status`, while a user will have a number of status, this is naturally `Many-to-One` relation and can be easily mapped to DB Tables.
However, the requirement also need User to maintain its “current” status, i.e., in the `User` Table, it need to have a foreign-key to the `Status` table. The... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17965626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/185668/"
] | you should use model without inheriting from `ActiveRecord::Base` class.
```
class ContactPageMessage
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
attr_accessor :whatever
validates :whatever, :presence => true
def initialize(attributes = {})
attribute... | In your model you can add the below which will just set getter and setter method for message and you can have validation on message without having a column in the db
```
attr_accessor :message
validates :message, presence: true
``` |
37,811,034 | I have an HTML `<table>` with many columns, so when my web page is displayed on a mobile browser, it's too small. So I'm creating a media query and I want to remove some columns (That are not important).
So how to remove an html column using only css ?
For example, how to remove the column "B" in the middle of the ta... | 2016/06/14 | [
"https://Stackoverflow.com/questions/37811034",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5456540/"
] | The proper way is using `col` elements with `visibility: collapse`.
```html
<colgroup>
<col />
<col />
<col />
</colgroup>
```
```css
col:nth-child(2) {
visibility: collapse;
}
```
```css
table, th, td, tr {
border: 1px solid black;
}
table {
width: 100%;
}
col:nth-child(2) {
visibility: colla... | To remove the second column:
```
table tr>th:nth-of-type(2), table tr>td:nth-of-type(2){
display: none;
}
```
```css
table,
th,
td,
tr {
border: 1px solid black;
}
table {
width: 100%;
}
@media (max-width: 900px){ /* use your media breakpoint */
table tr>th:nth-of-type(2), table tr>td:nth-o... |
37,579,134 | Need help with splitting the below.
```
100GB@sdb,100GB@sdc
```
Into this
```
sdb sdc
```
Everything I've tried keeps giving me
```
sdb 100GB
``` | 2016/06/01 | [
"https://Stackoverflow.com/questions/37579134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5849019/"
] | **Update**
This is not relevant anymore in the new V3-beta.2 router.
**Original**
Change
```
@Routes([
{path: '', component: SchoolyearsHomeComponent},
{path: '/create', component: CreateSchoolyearComponent}
])
```
to
```
@Routes([
{path: '/create', component: CreateSchoolyearComponent},
{path: '', compo... | You need to inject the router into the app component, something like this:
```
export class AppComponent {
constructor(private router: Router) {}
}
```
This is normally needed when the template associated with this component does not use the `<router-link>` directive. A recent change to Angular does not load th... |
45,914,596 | How to make primary key of one table, the foreign key of the same table?
I have table `vendors` with these attributes:
```
vendor_id,
company_name
rep_first
rep_last
referredby
```
Do I want to make `vendor_id` as the foreign key of that table?
Here is what I have tried:
```
create table vendors(
vendor_id char... | 2017/08/28 | [
"https://Stackoverflow.com/questions/45914596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8445781/"
] | Constraints is also part of the table and thus have to go along with table definition like
```
vendor_id char(5) Not Null primary key,
company_name varchar(255),
rep_first varchar(255),
rep_last varchar(255),
refferedby char(5),
constraint vendors_REF_FK foreign key (refferedby) references vendors(vendor_id ));
`... | You may use `ALTER TABLE` as well
```
ALTER TABLE Vendors
ADD CONSTRAINT vendors_REF_FK FOREIGN KEY (refferedby) REFERENCES Vendors(vendor_id );
``` |
26,782,235 | We have an application that uses Azure SQL for the database backend. Under normal load/conditions this database can successfully run on a Premium 1 plan. However, during the early morning hours we have jobs that run that increase database load. During these few hours we need to move to a Premium 3 plan. The cost of a P... | 2014/11/06 | [
"https://Stackoverflow.com/questions/26782235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1090359/"
] | After digging through the articles in @ErikEJ's answer (Thanks!) I was able to find the following, which appears to be newly published with the release of the Elastic Scale preview:
[Changing Database Service Tiers and Performance Levels](http://msdn.microsoft.com/library/azure/dn369872.aspx)
The following REST APIs ... | Another way to do it is using Azure automation and using run book below:
```
param
(
# Desired Azure SQL Database edition {Basic, Standard, Premium}
[parameter(Mandatory=$true)]
[string] $Edition,
# Desired performance level {Basic, S0, S1, S2, P1, P2, P3}
[parameter(Mandatory=$true)]
[strin... |
35,739,975 | I have two apps, App1 and App2.
I,m saving some data in App2 and accessing in App1. So when i,m coming back to App1 from App2 using backpress, shared pref data will not refresh that i,m accessing from App2.
On removing App1 from background and coming back to same page will do the work.
So, what should I do such that,... | 2016/03/02 | [
"https://Stackoverflow.com/questions/35739975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5986048/"
] | You can assign an IAM role to your instance using the following workaround:
* Create an AMI for your instance;
* Terminate your old instance;
* Re-deploy it again from previously created AMI and assing an IAM role during the process. | Assigning an IAM (Identity and Access Management) **Role** to an Amazon EC2 instance is a way of securely providing rotating credentials to applications running on an EC2 instance. Such roles must be assigned **when the instance is first launched**.
If the instance you would like to use has already been launched, eith... |
19,664,273 | I have the method below writen in Delphi:
`function acceptPutNF(const aJSONObject: TJSONObject; const aJSONArray: TJSONArray): TJSONObject;`
I'm trying to send a PUT request, but I don't know how to specify the second parameter/object data `aJSONArray` with python. I tried this:
```
nfe = {'CodigoUsuario':1,'CodigoE... | 2013/10/29 | [
"https://Stackoverflow.com/questions/19664273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/995464/"
] | What you pass to data should be encoded. You are encoding the two structures then building an unencoded structure around it. Try this
```
r = requests.put(url, data=json.dumps([nfe, nfe_itens])
``` | I ended up using just one object data parameter with a "sub-object", and then I manage it on my server. I think it is the better way to use more of available features that JSON provides. |
1,327,951 | In the course of my study of metric spaces I've come across some terminology which I can't seem to understand completely.
So, assuming $X=\mathbb{R}$, and $\mathbb{Q}\subset X$ is the set of the rational numbers, what exactly are:
* $\mathbb{Q}^\circ$
* int $\mathbb{Q}$
* $\partial\mathbb{Q}$
* $\bar{\mathbb{Q}}$
Ev... | 2015/06/16 | [
"https://math.stackexchange.com/questions/1327951",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/212451/"
] | I believe the first two denote interior, the third boundary, and the fourth closure.
The *interior* of a set is the largest open set included in it. Equivalently, it is the union of all open sets included in it: $$\operatorname{int} S\equiv\bigcup\{U\,|\,U\text{ is open and }U\subseteq S\}.$$
Analogously, the *closur... | Int $\mathbb{Q} = \emptyset$, since, if you have an arbitrary $x \in \mathbb{Q}$, no matter how you choose an $r>0$, the x-centered ball($B(x,r)$), with $r$ radius will always contain an irrational number, therefore it is not an internal point. Since our $x$ was arbitrary, the set of interal points must be empty. $\rig... |
5,372,680 | Im trying to send keystrokes and mouse movements to a Java program but once the applicaton has focus nothing is sent. It's as if the Java application takes focus of everything because Autohotkey stops responding. Everything works fine in a regular Windows app (e.g. Notepad).
I've tried using various send methods (Sen... | 2011/03/21 | [
"https://Stackoverflow.com/questions/5372680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/322772/"
] | Some playing around I've discovered that TOS on Mac OSX can be controlled via scripting with [Keyboard Maestro](http://www.keyboardmaestro.com). It's a ugly, hacked solution, but it works. You can edit text boxes and click stuff if you know the X,Y position of elements.
Keyboard Maestro can be run via scripts (AppleS... | I suggest you use Easy Macro Recorder
<http://download.cnet.com/Easy-Macro-Recorder/3000-2094_4-10414139.html>
Its a great tool to automate keystrokes and mouse movements.
Hope this helps :) |
2,179,263 | I would like to learn a functional programming language to see a different programming paradigm.
My background in programming: Java (I have just passed the SCJP exam), some ruby and very limited Rails. I use bash for basic sysadmin tasks. I use Ubuntu 9.04.
As a second goal I would like to use fp to show kids (14-18 ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2179263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/260145/"
] | If your primary goal is to work with teens, it makes sense to use the functional-language pedagogy and technology that is proven to work with teens, and that is [PLT Scheme](http://plt-scheme.org/) (aka DrScheme) with the [How To Design Programs](http://htdp.org/) book (also free online). These guys have got great resu... | My question is what approach is likely to be best for the teens you're working with. If they're willing to learn something new and different, Scheme is an excellent choice as a functional language. It's as basic as they come. If you want to keep to a more familiar syntax, Haskell might be your answer. |
20,475 | I'm trying to prove that ${n \choose r}$ is equal to ${{n-1} \choose {r-1}}+{{n-1} \choose r}$ when $1\leq r\leq n$.
I suppose I could use the counting rules in probability, perhaps combination= ${{n} \choose {r}}=\frac{n!}{r!(n-r!)}$.
I want to see an actual proof behind this equation. Does anyone have any ideas? | 2011/02/04 | [
"https://math.stackexchange.com/questions/20475",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | See this Wikipedia page:
* <http://en.wikipedia.org/wiki/Binomial_coefficient>
Under the subsection **Recursion formula**, *HINT* for proving this formula is given. Hope you can do it from there.
>
> The formula follows either from tracing the contributions to $X^{k}$ in $(1 + X)^{n−1}(1 + X)$, or by counting k-com... | Consider,
$$ (1+x)(1+x)(1+x)(1+x).. \text{n times}$$
Notice that sequence of each factor is given as:
$$ \{a\_i \} = \{ 1,1, 0, 0... \}$$
By $b\_i^j$ denote the coefficents of $x^i$ term in the product of $j$ factors, from cauchy product rule:
$$ b\_0^0 =1$$
$$ b\_k^1= \sum\_{i=0}^k b\_i^0 a\_{k-i}$$
$$ b\_k^2 = \... |
8,985,869 | I'm trying to get camera preview data, but I don't want to show the preview. Unfortunatelly
```
setPreviewCallback( PreviewCallback )
```
doesn't work unless you call
```
setPreviewDisplay(SurfaceHolder)
```
Is it possible to pass this in any way - start callbacks without setting the preview display, or any way ... | 2012/01/24 | [
"https://Stackoverflow.com/questions/8985869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/972896/"
] | **Update**
As noted in the comments, versions of the SDK after Windows 7's do not include the build tools. If you want to use Microsoft's most recent tools you have to install Visual Studio. Once installed, you can use the tools from the command-line.
At the moment the free versions are the "Community" versions, e.g.... | You have to figure out where NVIDIA GPU Computing Toolkit is installed.
In my system it's in "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe" Then
1. "Edit Environment Variables" on Windows.
2. Click on New...
3. Variable name: NVCC
Variable Value: C:\Program Files\NVIDIA GPU Computing Toolkit\CU... |
23,781,034 | I'm trying to load a JavaScript array with an array from my model. Its seems to me that this should be possible.
Neither of the below ways work.
Cannot create a JavaScript loop and increment through Model Array with JavaScript variable
```
for(var j=0; j<255; j++)
{
jsArray = (@(Model.data[j])));
}
```
Cannot ... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23781034",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3660362/"
] | I was integrating a slider and needed to get all the files in the folder and was having same situationof C# array to javascript array.This solution by @heymega worked perfectly except my javascript parser was annoyed on `var` use in `foreach` loop. So i did a little work around avoiding the loop.
```
var allowedExtens... | ```
@functions
{
string GetStringArray()
{
var stringArray = "[";
for (int i = 0; i < Model.List.Count; i++)
{
if (i != Model.List.Count - 1)
{
stringArray += $"'{Model.List[i]}', ";
}
else
{
str... |
13,118,418 | I set the background color of the outer div to blue but it is not displayed. Why?
A demo of it:
```css
.question-template {
width: auto;
height: auto;
background-color: blue;
}
.question {
float: left;
margin: 10px;
}
.participants {
background-color: green;
float: left;
ma... | 2012/10/29 | [
"https://Stackoverflow.com/questions/13118418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/337934/"
] | Try like this..
```
.question-template {
width: auto;
height: auto;
background-color: blue;
overflow:auto;
}
``` | ***[Live demo](http://jsfiddle.net/4zjtp/1/)***...........
Hi now define your **parent div** `.question-template overflow:hidden;`
```
.question-template{
overflow:hidden;
}
```
---
**Method two**
now clear your parent
**Css**
```
.clr{
clear:both;
}
```
**HTML**
```
<div class="question-template">
<div cla... |
38,634,766 | I am using IntelliJ IDEA, learning Java. All went well until yesterday, when the mentioned error occurred.
I didn't make any changes. I was looking for the solution the following ways:
1. reboot the pc
2. restart IntelliJ.
3. delete the project directory and use another one (both on desktop)
nothing helps. buy runni... | 2016/07/28 | [
"https://Stackoverflow.com/questions/38634766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6479494/"
] | One reason for this to happen is if you have print statement somewhere on the body of the class, and not inside a method.
Here is an example:
[](https://i.stack.imgur.com/WRl4X.png)
But if the print is inside a method, it should work fine.
Here is ... | case 1: if all sdk setup is complete and perfect
then
file -> invalidated caches / Restart
this could work
case 2 : if something missing in sdk setup of intelij
then goto
1.file->project structure->libraries
2.click on + button
3. add location of lib folder of tomcat directory
C:\xampp\tomcat\lib
[to add lib directory ... |
1,538,801 | Also part of the problem:
Show that:
$$\int\_0^{n\pi} f(\cos^2 x)dx=n\int\_0^{\pi} f(\cos^2 x)dx$$ It may be important to note that I have taken a few semester of calculus prior to this, and that this problem was brought up in my math analysis course. Additionally, my class has only taught as far as Riemannian integr... | 2015/11/20 | [
"https://math.stackexchange.com/questions/1538801",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/274111/"
] | \begin{align\*}\int\_0^{n\pi}f(\cos^2(x))\mathrm{d}x &= \sum\_{i=0}^{n-1}\int\_{i\pi}^{(i+1)\pi}f(\cos^2(x))\mathrm{d}x \\ &= \sum\_{i=0}^{n-1}\int\_0^\pi f(\cos^2(x))\mathrm{d}x \\ &=n\int\_0^\pi f(\cos^2(x))\mathrm{d}x
\end{align\*}
You should ask yourself why the third equality is true. | First: $\int\_0^{\pi/2}f(\sin x) dx = \int\_0^{\pi/2}f(\cos y)dy$. (Note the change of the name of the variable. That is only for convenience.) This is solved by doing the substitution $x \mapsto \frac{\pi}{2} - y$. We get
$$
\int\_0^{\pi/2}f(\sin x)dx = \int\_{\pi/2}^0-f\big(\sin(\pi/2 - y)\big)dy\\
= \int\_0^{\pi/2}f... |
62,727,314 | How to convert a camelcased string to sentence cased without excluding any special characters?
Suggest a regex for converting camelcased string with special characters and numbers to sentence case?:
```
const string = `includes:SummaryFromDetailHistory1990-AsAbstract`
```
Expected outcome:
```
Includes : Summary F... | 2020/07/04 | [
"https://Stackoverflow.com/questions/62727314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13324968/"
] | The wanted result doesn't seem to be regular, some special characters are supposed to be preceeded with a space and some are not. Treating the parenthesis like you want is a bit tricky. You can use function to handle the parenthesis, like this:
```js
let parenth = 0;
const str = `thisIsA100CharactersLong:SampleStringC... | This is impossible. You cannot do this in regex. You will have to consider exceptions... |
69,882,148 | I'm trying to execute a LINQ query within a plugin, using the OrganizationServiceContext, to retrieve some quotes. On these quotes, I'm using .Select() to only select the value for the field cgk\_totalnetprice, as shown below:
```cs
quotes = OrganizationServiceContext.QuoteSet
.Where(_ =>
_.OpportunityId != n... | 2021/11/08 | [
"https://Stackoverflow.com/questions/69882148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9396654/"
] | Queries on `OrganizationServiceContext` rely on LINQ for CRM, which in turn translates LINQ expressions into `QueryExpression` objects. LINQ for CRM comes with a few weaknesses:
* it does not implement all capabilities of the underlying `QueryExpression`,
* it only supports a limited set of LINQ constructs (see [MS Do... | I generally use the query syntax for Dynamics LINQ queries. I'd suggest standard query troubleshooting - start with no conditions and add them one-by-one.
Below is an idea of how my query would look. I'd keep adding / modifying the `where` clauses until the query returned what I expected.
We could use `&&` operators i... |
435,810 | I am in the process of implementing onion / clean architecture, and would like to understand better how and when to map to my domain entities.
So if we take a specific example where we have a `Post` and we would like to update a `status` on this object.
Am I correct in thinking that when I receive data in the control... | 2022/01/07 | [
"https://softwareengineering.stackexchange.com/questions/435810",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/261048/"
] | It depends on where you draw the line. (Von Neumann) Computers are by definition finite state machines in an infinite loop. Most programs aren’t modeled this way because, well, it’s hella tedious and impractical to list all of the states of an integer to make math work.
But *parsers* very often are implemented this wa... | Your example of a scanner is not a program, it would be a tiny subroutine in a much larger program. If you use it as a co-routine, it would have internal state, but likely not enough to call it a “state-machine”.
Many applications have the goal of not being modal. At any point, the user should be able to take any acti... |
62,760,670 | I'm working on the following user table, where role = 2 means the user is an instructor, and role = 3 means that the user is a student.
```
+--------+------+---------------+
| name | role | creation_date |
+--------+------+---------------+
| Tom | 2 | 2020-07-01 |
| Diana | 3 | 2020-07-01 |
| Rachel ... | 2020/07/06 | [
"https://Stackoverflow.com/questions/62760670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11380315/"
] | Use conditional aggregation:
```
SELECT
creation_date,
COUNT(CASE WHEN role = 2 THEN 1 END) AS totalInstructors,
COUNT(CASE WHEN role = 3 THEN 1 END) AS totalStudents
FROM yourTable
GROUP BY
creation_date;
```
[](https://i.sta... | Please use below query,
```
select
case when role = 2 then count(1) end as totalInstructors,
case when role = 3 then count(1) end as totalStudents,
creation_date
from table_name
group by creation_date;
```
You can use `COALESCE()` to replace null with 0
```
select COALESCE(totalInstructors, 0) as totalInstructors... |
31,433,579 | I store my session id Redis, my session id is global unique, every time login will generate a new session id, so even same user will still have different session id. So I have no way to destroy the user's session because I have no way to locate it. So how can I design, so as to satisfy my need? | 2015/07/15 | [
"https://Stackoverflow.com/questions/31433579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1063434/"
] | You could specifically test for null and undefined
```
var b = {
items: ('undefined' === typeof a || null === a) ? null : +a
};
``` | This should work as well:
```
var b = {
items: a != null? +a : null
};
```
Based on <https://stackoverflow.com/a/15992131/1494833> |
783,536 | Here's the question: Prove that $\lim\_{n \to \infty} (\sqrt{n^2+n}-n) = \frac{1}{2}.$
Here's my attempt at a solution, but for some reason, the $N$ that I arrive at is incorrect (I ran a computer program to test my solution against some test cases, and it spits out an error). Can anyone spot the error for me?
$\left... | 2014/05/06 | [
"https://math.stackexchange.com/questions/783536",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/140755/"
] | From $a^2-b^2=(a+b)(a-b)$ we have
$$\sqrt{n^2+n}-n=\frac{n^2+n-n^2}{\sqrt{n^2+n}+n}=\frac{n}{\sqrt{n^2+n}+n}=
\frac{1}{\sqrt{1+\frac{1}{n}}+1}$$
from which the result follows immediately. | Using the [fractional binomial theorem](https://brilliant.org/wiki/fractional-binomial-theorem/) we have
$$
\Bigl(1+\frac{1}{n}\Bigr)^{1/2}=1+\frac{1}{2n}+o\Bigl(\frac{1}{n}\Bigr)
$$
where $o(1/n)$ denotes a quantity that grows asymptotically slower than $1/n$ as $n\to\infty$. Multiplying through by $n$ yields
$$
\sqrt... |
62,621,788 | I am working on a Blazor server-side project for which I am currently creating a customized sign in page. Since I don't know that much about web apps (which is why I'm using blazor) possible solutions posted on the stackoverflow/github have not worked for me so far.
To the point: I want the built-in `SignInManager` to... | 2020/06/28 | [
"https://Stackoverflow.com/questions/62621788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9172408/"
] | As you noted, strings are immutable. All of the instance methods on the `string` type (at least those related to "modifying" it) return a new string. This means that calling something like the following returns a new string which is immediately discarded:
```
// value is discarded
searchQuery.Substring(0, searchQuery.... | Any method you use to manipulate the string will return the new string so you need to capture that.
`string newString = searchQuery.Substring(0, searchQuery.Length -1);` |
220,773 | Has anybody who administers email servers or spam filtering noticed that in last couple of weeks the spam volume has dropped significantly? Is there a chart provided by one of the major spam filtering companies?
**Edit:** Based on our internal stats, although it varies, on the two weeks starting the day after Christma... | 2011/01/10 | [
"https://serverfault.com/questions/220773",
"https://serverfault.com",
"https://serverfault.com/users/58001/"
] | You are trying to forward emails from a domain that has SPF records, but that domain does not list your server as a valid source of email for that domain.
Your choices are:
1. Contact somedomain.co.uk and tell them you're forwarding their mail and want to be added to their SPF record.
2. Contact the "external mailbox... | Your mail server is not a fault here, but there is a conceptual fault in SPF, that breaks email forwarding.
Explanation:
In this case your mail server is a standard non sender rewriting forwarding service, that is in the mail delivery path. This is completely valid according to [RFC\_822 (page 18)](http://www.ietf.org... |
6,581,162 | I suppress a few warnings, 1591 is the XML comments warning. It's not that I don't use the comments, there are some false positives.
Now to find the fact that XML comments warning is 1591 took a whole load of googling. Is there a list somewhere? Or a way to display the error number in Visual Studio itself?
Thanks | 2011/07/05 | [
"https://Stackoverflow.com/questions/6581162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/518551/"
] | You can find a whole list of them here:
[Compiler and Warning messages for C/C++](http://msdn.microsoft.com/en-us/library/8x5x43k7%28v=VS.80%29.aspx)
[Compiler and Warning messages for C#](http://msdn.microsoft.com/en-us/library/ms228296.aspx) | I stumbled on this thread while trying to sort out how to find these in VS2015 with Beckhoff TwinCAT and found the Beckhoff-specific ones under Project->Properties, in the Compiler Warnings tab (as below in [1](https://i.stack.imgur.com/ALa5r.png)).
[screencap of TwinCAT project properties' compiler warning list](http... |
55,871,387 | I have a question for my assignment. I have a database with sqlite in my android app and the location updates come and writes to the sql db, but there is some same data with the coming updates. I want to check if there is same location in my db, the system skips or overwrites the existing location info in db as x,y I h... | 2019/04/26 | [
"https://Stackoverflow.com/questions/55871387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | When `var b = a;` is executed, `b` does not "refer" to `a`. It becomes a number whose value is `a`'s value at this moment.
---
However, if you use an **Object**, the attribution will use the **reference** of `a`, and not its value:
```
a = { value: 23 };
b = a;
a.value = 46;
console.log(b);
```
```
// console
Obj... | Look at this [answer](https://stackoverflow.com/questions/518000/is-javascript-a-pass-by-reference-or-pass-by-value-language/51523031#51523031). Primitives are passed by values and objects are passed by reference. As a and b are primitives, they are passed by values. And when a is changed that will not be reflected in ... |
653,106 | I was watching this video by Ben Eater on building an 8-bit computer: [Youtube Video](https://www.youtube.com/watch?v=CiMaWbz_6E8&list=PLowKtXNTBypGqImE405J2565dvjafglHU&index=12) time: 1:51.
He has this circuit:
[](https://i.stack.imgur.com/UgIUk.jp... | 2023/02/07 | [
"https://electronics.stackexchange.com/questions/653106",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/314255/"
] | You should maybe ask Ben Eater about his circuits. We have not checked if the circuit matches the schematic or if that is just a block diagram and not the actual schematics. We also don't know the LED color which plays an important part here.
So first thing is to be absolutely sure that there are no resistors in the v... | Do not do that!
Always use a resistor in series with an LED to limit the current.
(Anything between 330 Ohm to 2.2 kOhm will work there.)
Once you do, your question becomes moot. |
33,877,915 | I want two lists inside one list:
```
x = [1,2]
y = [3,4]
```
I need them to turn out like:
```
z = [[1,2][3,4]]
```
But I have no idea how to do that.
Thanks so much for your consideration and help. | 2015/11/23 | [
"https://Stackoverflow.com/questions/33877915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3958253/"
] | Make a new list which contains the first two lists.
```
z = [x, y]
```
This will make each element of `z` a reference to the original list. If you don't want that to happen you can do the following.
```
from copy import copy
z = [copy(x), copy(y)]
print z
``` | If you don't want references to the original list objects:
```
z = [x[:], y[:]]
``` |
62,826,678 | Everything is working except the button. The submit button is not being clicked. Can anyone help me out? I believe it may have to do with the fact that I changed the frame to "top". But, I am unsure how to change it back.
Code:
```
from selenium import webdriver
from selenium.webdriver.common.by import By
from seleni... | 2020/07/10 | [
"https://Stackoverflow.com/questions/62826678",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12585735/"
] | above your activity class you must add annotation @AndroidEntryPoint
as below:
@AndroidEntryPoint
class MainActivity : AppCompatActivity() { | ```
class MainViewModel @ViewModelInject constructor(private val repository: HomePageRepository,
@Assisted private val savedStateHandle: SavedStateHandle)
: ViewModel(){}
```
and intead of initializing the viewmodel like this :
private lateinit var viewModel: MainViewM... |
8,731,426 | I'm writing a userscript for a page which has this HTML code block..
```
<span id="mediaSetUfiLikeLink">
<button class="like_link stat_elem as_link" title="Like this item" type="submit" name="like">
<span class="default_message">Like</span>
<span class="saving_message">Unlike</span>
</button>
<... | 2012/01/04 | [
"https://Stackoverflow.com/questions/8731426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1077789/"
] | As far as I know this is not possible without changing the Jenkins code, but I think you could achieve the same goal with minimal maintenance using [build slaves.](https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds) Different builds can run concurrently on the slaves, or even on the same slave if you define... | What you want can only be accomplished by running a separate Jenkins master for each project.
Usually people think a Jenkins master has more administrative overhead than a slave, but if that does not hold for you, you can run multiple masters on a server, just assign them different ports.
If this isn't good for you... |
178,154 | I'm a senior developer on a project. Because I'm the most senior, I was given the role of an informal dev lead to control and guide the dev team when needed. Apart from that we are doing scrum.
The Product Owner - who's the only person responsible for backlog selection and prioritisation - now told me that I'm burning... | 2021/09/06 | [
"https://workplace.stackexchange.com/questions/178154",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/120073/"
] | Well that's unfortunate. Let's break this down.
You the tech lead do not get to say what are you working on. The way you influence that is that you take in the spec and draft a sensible way to go about it. Managers want feature Z before feature X, which is a totally ridiculous thing to do architecturally? Instead of h... | The push / pushback dynamic between product owners ("the business") and development is not a new one, and agile techniques were in part an attempt to defuse it and turn it into something more productive. I agree with some of the other answers that you should keep the dialogue going with the Product Owner. You should cl... |
4,978,640 | I would like to create my logout view for many reasons but the main reason is avoid the `request.session.flush()` the logout is automatically calling. That's not good for my application since I would like to keep alive some of the session variables even if the user logs out. What session variable(s) do I have to delete... | 2011/02/12 | [
"https://Stackoverflow.com/questions/4978640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/509807/"
] | Besides `request.session.flush()` it seems django sets the `request.user` object to an `AnonymousUser():`
```
from django.contrib.auth.models import AnonymousUser
request.user = AnonymousUser()
``` | you can also do it by using `delete_test_cookie()` within your view. [check more here](http://www.djangobook.com/en/beta/chapter12/) |
161,700 | I have an HTC One M8 running Marshmallow 6.0, kernel 3.4.0-perf-gd7aafa47 and build MRA58K.H15, unlocked bootloader but non-rooted device. The device is a tab over 2 years old now, and the system has been shutting down on its own when the battery charge gets closer to 10%. Yesterday, after charging up and powering on, ... | 2016/11/07 | [
"https://android.stackexchange.com/questions/161700",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/195423/"
] | yeah there's [Google Handwriting Input](https://play.google.com/store/apps/details?id=com.google.android.apps.handwriting.ime&hl=en) available on PlayStore. get it. | Tried Google Translate App? It can do such things[](https://i.stack.imgur.com/9ofAg.jpg) |
19,016,924 | I have read through various Stackover flow Questions and contents on the web on similar problem. However, I couldnt find useful hints that would allow me to narrow down on my problem. Here is my usecase which results in this error.
>
> 2 entities Campus and Programs --> One-to-many relation from Campus to
> Program... | 2013/09/25 | [
"https://Stackoverflow.com/questions/19016924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425575/"
] | I see you had a pool setting which validates connection on borrow, and from the stack trace I can see this validation failed (seem to timeout). There are 2 possible causes I can think of:
1. Network connection between your app and db server was broken. This could be due to connection lost, firewall setting change, sta... | I ran into a similar error today.
I have a similar setting: "datasource.maxactive=50", which means no more than 50 connections at a time. I have n threads, each uses a connection. When n is 50 or close, this exception happens a lot. There are a few things that can be done; 2 that I found helpful:
* Adjust n to be sm... |
22,594,093 | I am creating a website that will demonstrate the dangers of XSS. Users will attempt to get JavaScript to execute using an XSS vulnerability.
However, I am running into problems in determining if JavaScript is actually being executed so that I can record that the user was successful. I will be running these checks on... | 2014/03/23 | [
"https://Stackoverflow.com/questions/22594093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/516476/"
] | You could use the [esprima](http://esprima.org/) javascript parser to see if the string is valid javascript syntax.
Install using `npm install esprima`.
To use:
```
var esprima = require('esprima');
var userStringToTest = 'var a = 10;';
var isValid = isValidJs(userStringToTest);
if(isValid) {
console.log('its v... | What you need is a JavaScript sandbox, which will isolate their code from the code running it.
There are several to choose from. I've used "Sandbox" before: <http://gf3.github.io/sandbox/>
Execute their code in the sandbox, see if there were errors, return the output. |
60,136,235 | Sorry, my understanding of how packaging works in `Angular` is terrible!! I want to use a `WYSIWYG` editor in my `Angular6` application. I have zeroed down to `quill.js`. <https://quilljs.com/docs/quickstart/>
But I am confused how I can include it in my project. I have added it as a dependency in my `package.json`.
... | 2020/02/09 | [
"https://Stackoverflow.com/questions/60136235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6703783/"
] | Try using the [ngx-quill](https://www.npmjs.com/package/ngx-quill) wrapper. | Thanks the answer from Sathiamoorthy. That helps me a lot.
I want to add more comments here during my quill setup.
Since my Angular CLI version is 12.0. I have to identify the specific version to make it work. (I spent 6 hours to figure this out)
Like:
npm install quill@**1.3.7**
npm install ngx-quill@**13.0.1**
np... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.