qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
27,060,296 | Good afternoon, I'm working on a section of the installer where I want to insert an image with a link in wpInstalling section but I don't manage to do it, I know how to insert text but I don't know how to do what I said before. I hope you can help me.
;
var
ErrorCode: Integer;
... | You can find more information in this project (made by a japanese dvp). He creates a web control in InnoSetup.
* Blog here : [Innosetup webctrl v2.1](http://restools.hanzify.org/article.asp?id=90)
* Download here : [inno\_webctrl\_v2.1.zip](http://restools.hanzify.org/inno/webctrl/inno_webctrl_v2.1.zip) |
60,697 | Since upgrading from **Magento CE 1.7.0.2** to **1.9.1** its not showing any visitors. Google is activated and I use the **Fooman extension**.
Any ideas why its not tracking visitors?
Thanks. | 2015/03/13 | [
"https://magento.stackexchange.com/questions/60697",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/6124/"
] | Magento 1.9.1 uses universal analytics. You need to enable universal analytics on google if you haven't already.
Probably the fooman extension is outdated. Old version didnt support UA. Now it does. Update extension and make sure UA is enabled on google.
<http://www.magentocommerce.com/magento-connect/google-analytic... | +1 on Ladle3000, a good idea also is to checkout Blue Acorn's Univeral analytics extension which enables your site voor enhanced e-commerce.
This will give your much more insight in the performance and potential problems in your store.
More info on Enhanced e-commerce: <http://analytics.blogspot.nl/2014/05/better-dat... |
60,697 | Since upgrading from **Magento CE 1.7.0.2** to **1.9.1** its not showing any visitors. Google is activated and I use the **Fooman extension**.
Any ideas why its not tracking visitors?
Thanks. | 2015/03/13 | [
"https://magento.stackexchange.com/questions/60697",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/6124/"
] | In version **1.9.1**, Magento added an admin configuration setting for setting different Google Analytics code types. You can see this setting by going to:
>
> **Admin > Configuration > Sales > Google API > Google Analytics > Type**
>
>
>
There should be two options here "Universal Analytics" and "Google Analyti... | Magento 1.9.1 uses universal analytics. You need to enable universal analytics on google if you haven't already.
Probably the fooman extension is outdated. Old version didnt support UA. Now it does. Update extension and make sure UA is enabled on google.
<http://www.magentocommerce.com/magento-connect/google-analytic... |
60,697 | Since upgrading from **Magento CE 1.7.0.2** to **1.9.1** its not showing any visitors. Google is activated and I use the **Fooman extension**.
Any ideas why its not tracking visitors?
Thanks. | 2015/03/13 | [
"https://magento.stackexchange.com/questions/60697",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/6124/"
] | In version **1.9.1**, Magento added an admin configuration setting for setting different Google Analytics code types. You can see this setting by going to:
>
> **Admin > Configuration > Sales > Google API > Google Analytics > Type**
>
>
>
There should be two options here "Universal Analytics" and "Google Analyti... | +1 on Ladle3000, a good idea also is to checkout Blue Acorn's Univeral analytics extension which enables your site voor enhanced e-commerce.
This will give your much more insight in the performance and potential problems in your store.
More info on Enhanced e-commerce: <http://analytics.blogspot.nl/2014/05/better-dat... |
18,258,731 | Take the following struct and class:
```
struct TestStruct
{
};
class TestClass
{
public:
TestStruct* testStruct;
};
```
Do the following in `main`:
```
TestClass testClass;
if (testClass.testStruct == NULL)
cout << "It is NULL." << endl;
else
cout << "It is NOT NULL.";
```
The output will be: `It is... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18258731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1819815/"
] | Your pointer is not initialized when you declare `testClass`. You experience here an undefined behaviour. The value of the pointer will be the last value that was contain in the memory section where it is stored.
If you wanted it to **always** be `NULL`, you would need to initialize it in the constructor of your class... | The `testStruct` will sometimes be NULL and sometimes not be NULL.
Make sure your constructor clears the pointer. Variables in C++ are not default to NULL/0. |
18,258,731 | Take the following struct and class:
```
struct TestStruct
{
};
class TestClass
{
public:
TestStruct* testStruct;
};
```
Do the following in `main`:
```
TestClass testClass;
if (testClass.testStruct == NULL)
cout << "It is NULL." << endl;
else
cout << "It is NOT NULL.";
```
The output will be: `It is... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18258731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1819815/"
] | Your pointer is not initialized when you declare `testClass`. You experience here an undefined behaviour. The value of the pointer will be the last value that was contain in the memory section where it is stored.
If you wanted it to **always** be `NULL`, you would need to initialize it in the constructor of your class... | Well, the Pointer doesn't get initialized by default. You'll have to do that in the constructor. It just contains what's in your RAM. On usual 32 bit systems the propability of it being NULL is around 0,2e-9. on 64 bit systems ( in 64 bit assemblies) it will be even lower. |
18,258,731 | Take the following struct and class:
```
struct TestStruct
{
};
class TestClass
{
public:
TestStruct* testStruct;
};
```
Do the following in `main`:
```
TestClass testClass;
if (testClass.testStruct == NULL)
cout << "It is NULL." << endl;
else
cout << "It is NOT NULL.";
```
The output will be: `It is... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18258731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1819815/"
] | Your pointer is not initialized when you declare `testClass`. You experience here an undefined behaviour. The value of the pointer will be the last value that was contain in the memory section where it is stored.
If you wanted it to **always** be `NULL`, you would need to initialize it in the constructor of your class... | It is because you didn't initialized the `testStruct` member. You have an *Undefined behaviour* here. It contains garbage value.
If you want it to be always initialized to `NULL`, you can do :
```
class TestClass
{
public:
TestClass(): testStruct(NULL) {}
TestStruct* testStruct;
};
```
Or with the **c++11**... |
18,258,731 | Take the following struct and class:
```
struct TestStruct
{
};
class TestClass
{
public:
TestStruct* testStruct;
};
```
Do the following in `main`:
```
TestClass testClass;
if (testClass.testStruct == NULL)
cout << "It is NULL." << endl;
else
cout << "It is NOT NULL.";
```
The output will be: `It is... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18258731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1819815/"
] | Your pointer is not initialized when you declare `testClass`. You experience here an undefined behaviour. The value of the pointer will be the last value that was contain in the memory section where it is stored.
If you wanted it to **always** be `NULL`, you would need to initialize it in the constructor of your class... | ***Answer***
------------
For me it displays **"It is NOT NULL"** in both questions and **sometimes you may get it as NULL**
The reason for above scenario to occur is that C++ doesn't automatically assign anything to a variable, Therefore it contains an unknown value
so that unknown value may be NULL sometimes but ... |
3,964,478 | >
> Find all the functions $f :\mathbb R \to \mathbb R$ that satisfy the
> conditions:
>
>
> 1. $$f(x+y)=f(x)+f(y), \enspace \forall x,y \in \mathbb R;$$
> 2. $$\exists \lim\_{x\to \infty}f(x).$$
>
>
>
This problem is important for the community because on the forum I only saw the case where $f$ is continuous, b... | 2020/12/28 | [
"https://math.stackexchange.com/questions/3964478",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/463062/"
] | So we have that lim $f = +\infty $.
Let's $x<y$ be real numbers. Then $f(y)-f(x) = f(y-x)$, so $n(f(y)-f(x)) = f(n(y-x))$.
Since $f(n(y-x)) \rightarrow +\infty$ when $n\rightarrow +\infty$, it is positive for $n$ big enough.
So $n(f(y)-f(x))$ is positive for $n$ big enough. But the sign of $n(f(y)-f(x))$ does not de... | I do not think you need the increasing property and can argue more directly:
As before, $f(qx)=qf(x)$ for $q\in \Bbb Q$ and $x \in\Bbb R$, and let $a=f(1)$
Let $y\notin\Bbb Q$. Assume $f(y)\ne ay$, say $\epsilon:=\left|\frac{f(y)}y-a\right|>0$. By density of $\Bbb Q$ in $\Bbb R$, we find $u,v\in \Bbb Q$ with $y-\epsilo... |
165,349 | I want to add a class to a menu - doing it in hook\_menu won't work because I'm adding an icon with the icon API, and this seems to override any classes put on the menu items.
I have this preprocess function:
```
/**
* hook_preprocess_page().
*/
function MYMODULE_preprocess_page(&$vars) {
$vars['main_menu']['menu... | 2015/07/14 | [
"https://drupal.stackexchange.com/questions/165349",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/6491/"
] | To add class in navigation's `<ul>` element, include below code in template.php
```
function THEMENAME_menu_tree__menu_MENUNAME($variables) {
return '<ul class="CLASSNAME YOU WANT TO ADD">' . $variables['tree'] . '</ul>';
}
``` | I was able to apply a class to the menu item this way:
```
function MYMODULE_preprocess_menu_link(&$variables) {
if($variables['element']['#original_link']['link_title'] == "Messages") {
$variables['element']['#attributes']['class'][] = "no-message";
}
}
``` |
31,975,529 | I have some images in a feature image slider. I need to make these programmable by date so that i don't have to go online to change these during the weekend or so on. I want to put a start date and an end date in the object. How do you use a date in an object (not as a string)?
```
var bannerOne = {dateStart:"08/12/2... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31975529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1985504/"
] | You case comparison should be something like below, if you are testing `P.TEST` value based on `S.SWITCH` case.
```
AND (
P.TEST =
CASE
WHEN S.SWITCH = 'A' THEN T.OPTION_1
WHEN S.SWITCH = 'C' THEN T.OPTION_1 + T.OPTION_2
WHEN S.SWITCH = 'G' THEN T.OPTION_3
WHEN S.SWITCH = 'N'... | Boolean expressions don't work like that in SQL. You can reformulate your switch like this:
```
AND (
(S.SWITCH = 'A' AND P.TEST = T.OPTION_1) OR
(S.SWITCH = 'C' AND T.OPTION_1 + T.OPTION_2) OR
(S.SWITCH = 'G' AND P.TEST = T.OPTION_3) OR
(S.SWITCH = 'N')
)
``` |
31,975,529 | I have some images in a feature image slider. I need to make these programmable by date so that i don't have to go online to change these during the weekend or so on. I want to put a start date and an end date in the object. How do you use a date in an object (not as a string)?
```
var bannerOne = {dateStart:"08/12/2... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31975529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1985504/"
] | You case comparison should be something like below, if you are testing `P.TEST` value based on `S.SWITCH` case.
```
AND (
P.TEST =
CASE
WHEN S.SWITCH = 'A' THEN T.OPTION_1
WHEN S.SWITCH = 'C' THEN T.OPTION_1 + T.OPTION_2
WHEN S.SWITCH = 'G' THEN T.OPTION_3
WHEN S.SWITCH = 'N'... | I know this is more of a comment than an answer, but hopefully this will lead to an answer, and I need to do formatted code for this so...
I tried this in Mysql and it worked. Could you try something like this in Sybase and see what it returns? The point being, extract the part that failed and test it out and see if yo... |
31,975,529 | I have some images in a feature image slider. I need to make these programmable by date so that i don't have to go online to change these during the weekend or so on. I want to put a start date and an end date in the object. How do you use a date in an object (not as a string)?
```
var bannerOne = {dateStart:"08/12/2... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31975529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1985504/"
] | Boolean expressions don't work like that in SQL. You can reformulate your switch like this:
```
AND (
(S.SWITCH = 'A' AND P.TEST = T.OPTION_1) OR
(S.SWITCH = 'C' AND T.OPTION_1 + T.OPTION_2) OR
(S.SWITCH = 'G' AND P.TEST = T.OPTION_3) OR
(S.SWITCH = 'N')
)
``` | I know this is more of a comment than an answer, but hopefully this will lead to an answer, and I need to do formatted code for this so...
I tried this in Mysql and it worked. Could you try something like this in Sybase and see what it returns? The point being, extract the part that failed and test it out and see if yo... |
46,811,163 | How Can I convert dates into string format?
I am getting dates between two dates ( From to end date). and I was using this below method
```
class Dates {
static func printDatesBetweenInterval(_ startDate: Date, _ endDate: Date) {
var startDate = startDate
let calendar = Calendar.current
let fmt = DateFo... | 2017/10/18 | [
"https://Stackoverflow.com/questions/46811163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638003/"
] | Try this:
```
function displayHTMLpage() {
$asubHTML = file_get_contents(plugins_url('/myfile/test.php',__FILE__ ));
echo $asubHTML;
}
add_action('wp_enqueue_scripts', 'adsense_unblock_divs');
``` | It worked when I removed the folder "template" and kept the html file in plugin main folder.
But i dont understand why wordpress not reading html file when it was inside another folder. :( :( |
46,811,163 | How Can I convert dates into string format?
I am getting dates between two dates ( From to end date). and I was using this below method
```
class Dates {
static func printDatesBetweenInterval(_ startDate: Date, _ endDate: Date) {
var startDate = startDate
let calendar = Calendar.current
let fmt = DateFo... | 2017/10/18 | [
"https://Stackoverflow.com/questions/46811163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638003/"
] | Try this:
```
function displayHTMLpage() {
$asubHTML = file_get_contents(plugins_url('/myfile/test.php',__FILE__ ));
echo $asubHTML;
}
add_action('wp_enqueue_scripts', 'adsense_unblock_divs');
``` | I know this question is old, but for anyone who may come across this, I'm pretty sure the error was the path starting with a backslash, which in Linux would have him pathing from the root directory (/) I assume. |
46,811,163 | How Can I convert dates into string format?
I am getting dates between two dates ( From to end date). and I was using this below method
```
class Dates {
static func printDatesBetweenInterval(_ startDate: Date, _ endDate: Date) {
var startDate = startDate
let calendar = Calendar.current
let fmt = DateFo... | 2017/10/18 | [
"https://Stackoverflow.com/questions/46811163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638003/"
] | Try this:
```
function displayHTMLpage() {
$asubHTML = file_get_contents(plugins_url('/myfile/test.php',__FILE__ ));
echo $asubHTML;
}
add_action('wp_enqueue_scripts', 'adsense_unblock_divs');
``` | This worked for me.
The problem it that the plugin folder need to be added to the url of the file.
```
function my_function($content) {
// all Plugins directory url
// Need to add the directory of your plugin
$pluginUrl = plugin_dir_url('/index.html', __FILE__);
$content .= '
<p>
<hr>
... |
53,243,855 | How can I connect to SQL database hosted on Microsoft Azure without having credentials in plain text in my .asp files or config files in VBScript?
I want to have the database connection string stored in Azure Key Vault, and have the web app access the key vault to get the connection string and then connect to the dat... | 2018/11/10 | [
"https://Stackoverflow.com/questions/53243855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10634403/"
] | A small expansion of @OZ17's answer.
Armadillo seems to store data with sizes< 16 locally `mem_local`and larger ones in an area pointed out by `mem`
```
From GDB:
> p x
{
<arma::Mat<double>> = {
<arma::Base<double, arma::Mat<double> >> = {
<arma::Base_inv_yes<arma::Mat<double> >> = {<No data fields>},
<... | Looks like armadillo's swap is internally a memcpy below a certain array size (according to op <=16). |
15,813,321 | I have reviewed possible answers here (for PHP, I think): <http://www.lateralcode.com/store-array-database/> but I am unable to find a C#.net version of serialize/deserialize.
Would this be done the same as the way shown in my link, above, or is there a completely different approach I should be using, given the enviro... | 2013/04/04 | [
"https://Stackoverflow.com/questions/15813321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1590549/"
] | Convert your string array into single String like given below:
```
var a = String.Join(",",arrays);
//or aim is to provide a unique separator,
//i.e which won't be the part of string values itself.
var a= String.Join("~~",arrays);
```
and fetch it back like this:
```
var arr = a.Split(',');
//or split via m... | Try this to seralize the array and create a column in the database of type Blob to store the byte array.
Serialization:
```
if(array == null)
return null;
BinaryFormatter bf = new BinaryFormatter();
MemoryStream ms = new MemoryStream();
bf.Serialize(ms, array);
```
Deserialization:
```
String[] array ... |
15,813,321 | I have reviewed possible answers here (for PHP, I think): <http://www.lateralcode.com/store-array-database/> but I am unable to find a C#.net version of serialize/deserialize.
Would this be done the same as the way shown in my link, above, or is there a completely different approach I should be using, given the enviro... | 2013/04/04 | [
"https://Stackoverflow.com/questions/15813321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1590549/"
] | Try this to seralize the array and create a column in the database of type Blob to store the byte array.
Serialization:
```
if(array == null)
return null;
BinaryFormatter bf = new BinaryFormatter();
MemoryStream ms = new MemoryStream();
bf.Serialize(ms, array);
```
Deserialization:
```
String[] array ... | >
> I just don't want to have a bunch of different columns for each of the
> 12 values in each of my 9 different arrays, so if there is another
> approach to achieve this (converting to byte[], etc.) I am more than
> willing to hear it.
>
>
>
From the above description, it looks like you are using an RDBMS.
Th... |
15,813,321 | I have reviewed possible answers here (for PHP, I think): <http://www.lateralcode.com/store-array-database/> but I am unable to find a C#.net version of serialize/deserialize.
Would this be done the same as the way shown in my link, above, or is there a completely different approach I should be using, given the enviro... | 2013/04/04 | [
"https://Stackoverflow.com/questions/15813321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1590549/"
] | Convert your string array into single String like given below:
```
var a = String.Join(",",arrays);
//or aim is to provide a unique separator,
//i.e which won't be the part of string values itself.
var a= String.Join("~~",arrays);
```
and fetch it back like this:
```
var arr = a.Split(',');
//or split via m... | >
> I just don't want to have a bunch of different columns for each of the
> 12 values in each of my 9 different arrays, so if there is another
> approach to achieve this (converting to byte[], etc.) I am more than
> willing to hear it.
>
>
>
From the above description, it looks like you are using an RDBMS.
Th... |
50,107,982 | I have a quandary on my hands. I created an AES service to encrypt/decrypt sensitive information. The AES key is randomly generated using java's `SecureRandom`. I have a protected file that stores the seed and upon calling the service the seed is populated into the Secure Random class.
To make sure it works I have the... | 2018/04/30 | [
"https://Stackoverflow.com/questions/50107982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1830916/"
] | I don't find any documentation that prohibits the behavior that you observe on RHEL 7.
The JavaDoc for [`java.util.Random`](https://docs.oracle.com/javase/8/docs/api/java/util/Random.html) explicitly states
>
> If two instances of Random are created with the same seed, and the same sequence of method calls is made f... | Turns out that RHEL 7 (and Linux machines in general) uses a different algorithm by default than windows. Linux uses `NativePRNG` while Windows uses `SHA1PRNG`.
Linux utilizes the built in `/dev/random` or `/dev/urandom` with the use of `NativePRNG`.
With this in mind I was able to change how I initialize the SecureR... |
37,560,688 | what i want to happen is to have a pagination to have a clean look at the data.
here is my html code for gridview:
```
<asp:gridview ID = "grid" runat="server" AllowPaging="true" OnPageIndexChanging="gdview_PageIndexChanging">
```
and code behind:
```
public static string cs = "Server=PAULO;Database=ShoppingCartDB... | 2016/06/01 | [
"https://Stackoverflow.com/questions/37560688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4980525/"
] | `[:]` just creates a copy of the list, so `[1]` indexes that copy. And no, outside of NumPy arrays, there is technically no way to avoid a loop. The loop may be done in C code in a function like `map()`, but there's going to be a loop anyway.
Using `map()` for example applies a callable for each element in your input ... | As mentioned in [python get list of tuples first index](https://stackoverflow.com/questions/10735282/python-get-list-of-tuples-first-index)
try with `zip`
```
my_list = [(1,4),(3,6),(10,7)]
print zip(*my_list)[1]
(4, 6, 7)
``` |
35,570,512 | I am new in java. I just wants to read each string in java and print it on console.
Code:
```
public static void main(String[] args) throws Exception {
File file = new File("/Users/OntologyFile.txt");
try {
FileInputStream fstream = new FileInputStream(file);
BufferedReader infile = new Buffe... | 2016/02/23 | [
"https://Stackoverflow.com/questions/35570512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5649003/"
] | Just add a for-each loop before printing the output :-
```
while ((data = infile.readLine()) != null) { // use if for reading just 1 line
for(String temp : data.split(" "))
System.out.println(temp); // no need to concatenate the empty string.
}
```
This will automatically print the individual strings, obtained f... | Use `Split()` Function available in `Class String`.. You may manipulate according to your need.
or
use `length` keyword to iterate throughout the complete **line**
and if any non- alphabet character get the `substring()`and write it to the new line. |
35,570,512 | I am new in java. I just wants to read each string in java and print it on console.
Code:
```
public static void main(String[] args) throws Exception {
File file = new File("/Users/OntologyFile.txt");
try {
FileInputStream fstream = new FileInputStream(file);
BufferedReader infile = new Buffe... | 2016/02/23 | [
"https://Stackoverflow.com/questions/35570512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5649003/"
] | Just add a for-each loop before printing the output :-
```
while ((data = infile.readLine()) != null) { // use if for reading just 1 line
for(String temp : data.split(" "))
System.out.println(temp); // no need to concatenate the empty string.
}
```
This will automatically print the individual strings, obtained f... | ```
List<String> words = new ArrayList<String>();
while ((data = infile.readLine()) != null) {
for(String d : data.split(" ")) {
System.out.println(""+d);
}
words.addAll(Arrays.asList(data));
}
//words List will hold all the words. Do words.ind... |
35,570,512 | I am new in java. I just wants to read each string in java and print it on console.
Code:
```
public static void main(String[] args) throws Exception {
File file = new File("/Users/OntologyFile.txt");
try {
FileInputStream fstream = new FileInputStream(file);
BufferedReader infile = new Buffe... | 2016/02/23 | [
"https://Stackoverflow.com/questions/35570512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5649003/"
] | It sounds like you want to be able to do two things:
1. Print all words inside the file
2. Search the index of a specific word
In that case, I would suggest scanning all lines, splitting by any whitespace character (space, tab, etc.) and storing in a collection so you can later on search for it. Not the question is -... | Use `Split()` Function available in `Class String`.. You may manipulate according to your need.
or
use `length` keyword to iterate throughout the complete **line**
and if any non- alphabet character get the `substring()`and write it to the new line. |
35,570,512 | I am new in java. I just wants to read each string in java and print it on console.
Code:
```
public static void main(String[] args) throws Exception {
File file = new File("/Users/OntologyFile.txt");
try {
FileInputStream fstream = new FileInputStream(file);
BufferedReader infile = new Buffe... | 2016/02/23 | [
"https://Stackoverflow.com/questions/35570512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5649003/"
] | It sounds like you want to be able to do two things:
1. Print all words inside the file
2. Search the index of a specific word
In that case, I would suggest scanning all lines, splitting by any whitespace character (space, tab, etc.) and storing in a collection so you can later on search for it. Not the question is -... | ```
List<String> words = new ArrayList<String>();
while ((data = infile.readLine()) != null) {
for(String d : data.split(" ")) {
System.out.println(""+d);
}
words.addAll(Arrays.asList(data));
}
//words List will hold all the words. Do words.ind... |
35,570,512 | I am new in java. I just wants to read each string in java and print it on console.
Code:
```
public static void main(String[] args) throws Exception {
File file = new File("/Users/OntologyFile.txt");
try {
FileInputStream fstream = new FileInputStream(file);
BufferedReader infile = new Buffe... | 2016/02/23 | [
"https://Stackoverflow.com/questions/35570512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5649003/"
] | Split the `String` received for any whitespace with the regex `\\s+` and print out the resultant data with a `for` loop.
```
public static void main(String[] args) { // Don't make main throw an exception
File file = new File("/Users/OntologyFile.txt");
try {
FileInputStream fstream = new FileInput... | Use `Split()` Function available in `Class String`.. You may manipulate according to your need.
or
use `length` keyword to iterate throughout the complete **line**
and if any non- alphabet character get the `substring()`and write it to the new line. |
35,570,512 | I am new in java. I just wants to read each string in java and print it on console.
Code:
```
public static void main(String[] args) throws Exception {
File file = new File("/Users/OntologyFile.txt");
try {
FileInputStream fstream = new FileInputStream(file);
BufferedReader infile = new Buffe... | 2016/02/23 | [
"https://Stackoverflow.com/questions/35570512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5649003/"
] | Split the `String` received for any whitespace with the regex `\\s+` and print out the resultant data with a `for` loop.
```
public static void main(String[] args) { // Don't make main throw an exception
File file = new File("/Users/OntologyFile.txt");
try {
FileInputStream fstream = new FileInput... | ```
List<String> words = new ArrayList<String>();
while ((data = infile.readLine()) != null) {
for(String d : data.split(" ")) {
System.out.println(""+d);
}
words.addAll(Arrays.asList(data));
}
//words List will hold all the words. Do words.ind... |
42,721,708 | I'm trying to run multiple commands in a single shell execution build step. If one of those commands exits on a code other than 0, the build will fail immediately. This is how it is by default.
I want for the build to continue executing all the commands in this build step even if one or more exit code 0 are given. Aft... | 2017/03/10 | [
"https://Stackoverflow.com/questions/42721708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1793874/"
] | Use a variable to record if one of them fails and then check if that variable is set at the end of the script:
```
FAILURE=0
command1 || FAILURE=1
command2 || FAILURE=1
command3 || FAILURE=1
if [ $FAILURE -eq 1 ]
then
echo "One or more failures!
exit 1
fi
```
So in your case:
```
FAILURE=0
git diff origin/deve... | With shell, you can do:
```
command || true;
```
In order to allow the command to fail. |
37,522,569 | I have fetched a current month from my DB which is basically a join date of the user. Lets say the use joined this month and it is May. The code I do to fetch the month name is like this:
```
$months = array();
array_push($months,date("F",strtotime($me['joinTime'])));
```
In this case I add the start month to the a... | 2016/05/30 | [
"https://Stackoverflow.com/questions/37522569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4008951/"
] | First you need to get he month number and than you need to use a loop through to end of the year that is 12. For each month number you also need the month name so use `DateTime createFromFormat`.
[Online Check](https://3v4l.org/eONQm)
```
$months = array();
$num = date("n",strtotime($me['joinTime']));
array_push($mon... | Yo can also put it like
```
$array = array();
array_push($array, date('F')) ;
for ($i=1; $i<= 12 - date('m'); $i++ ){
array_push($array, date('F', strtotime("+$i months"))) ;
}
print "<pre>";print_r($array);
``` |
37,522,569 | I have fetched a current month from my DB which is basically a join date of the user. Lets say the use joined this month and it is May. The code I do to fetch the month name is like this:
```
$months = array();
array_push($months,date("F",strtotime($me['joinTime'])));
```
In this case I add the start month to the a... | 2016/05/30 | [
"https://Stackoverflow.com/questions/37522569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4008951/"
] | First you need to get he month number and than you need to use a loop through to end of the year that is 12. For each month number you also need the month name so use `DateTime createFromFormat`.
[Online Check](https://3v4l.org/eONQm)
```
$months = array();
$num = date("n",strtotime($me['joinTime']));
array_push($mon... | Here we will be using DatePeriod which allows iteration over a set of dates and times, recurring at regular intervals, over a given period.
So we got the end date and we have the start date and then calculated the interval. And then looping over the period we got the array of months.
```
// current date : 20 Feb 2019... |
16,068,968 | Is it possible to **skip the staging area** and (also) commit **untracked, new files** to git in a single built-in, command-line command ? If not, what are the alternatives ?
<http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository>
>
> Providing the -a option to the git commit command makes Git
>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16068968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2153622/"
] | Using a single, built-in, command-line command? No.
**Using two commands:**
```
git add -A
git commit
```
**Using a custom alias:**
Add this to *.gitconfig*:
```
[alias]
commituntracked = "!git add -A; git commit"
```
Then you can do
```
git commituntracked
``` | This might seem quite trivial for the gurus, but is a minor revelation to me (I admit) - at least I just used it for the first time now and it works (*without* custom aliases): Just use a semicolon `;` and it'll work as a one-liner:
`git add --all; git commit -m "some informative commit message"` |
16,068,968 | Is it possible to **skip the staging area** and (also) commit **untracked, new files** to git in a single built-in, command-line command ? If not, what are the alternatives ?
<http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository>
>
> Providing the -a option to the git commit command makes Git
>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16068968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2153622/"
] | Using a single, built-in, command-line command? No.
**Using two commands:**
```
git add -A
git commit
```
**Using a custom alias:**
Add this to *.gitconfig*:
```
[alias]
commituntracked = "!git add -A; git commit"
```
Then you can do
```
git commituntracked
``` | Yes. There are at least two major ways of doing that. First, you don't have to use "the" staging area, you can have as many staging areas as you like -- set `GIT_INDEX_FILE=/path/to/private/index` and do as you please; second you can construct commits yourself, directly. It isn't even hard.
Git's repository core deals... |
16,068,968 | Is it possible to **skip the staging area** and (also) commit **untracked, new files** to git in a single built-in, command-line command ? If not, what are the alternatives ?
<http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository>
>
> Providing the -a option to the git commit command makes Git
>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16068968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2153622/"
] | Using a single, built-in, command-line command? No.
**Using two commands:**
```
git add -A
git commit
```
**Using a custom alias:**
Add this to *.gitconfig*:
```
[alias]
commituntracked = "!git add -A; git commit"
```
Then you can do
```
git commituntracked
``` | Using the command below skips the staging area and commits directly from the working directory.
```
git commit -a
```
Note that you still need to add new untracked files. |
16,068,968 | Is it possible to **skip the staging area** and (also) commit **untracked, new files** to git in a single built-in, command-line command ? If not, what are the alternatives ?
<http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository>
>
> Providing the -a option to the git commit command makes Git
>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16068968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2153622/"
] | This might seem quite trivial for the gurus, but is a minor revelation to me (I admit) - at least I just used it for the first time now and it works (*without* custom aliases): Just use a semicolon `;` and it'll work as a one-liner:
`git add --all; git commit -m "some informative commit message"` | Yes. There are at least two major ways of doing that. First, you don't have to use "the" staging area, you can have as many staging areas as you like -- set `GIT_INDEX_FILE=/path/to/private/index` and do as you please; second you can construct commits yourself, directly. It isn't even hard.
Git's repository core deals... |
16,068,968 | Is it possible to **skip the staging area** and (also) commit **untracked, new files** to git in a single built-in, command-line command ? If not, what are the alternatives ?
<http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository>
>
> Providing the -a option to the git commit command makes Git
>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16068968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2153622/"
] | This might seem quite trivial for the gurus, but is a minor revelation to me (I admit) - at least I just used it for the first time now and it works (*without* custom aliases): Just use a semicolon `;` and it'll work as a one-liner:
`git add --all; git commit -m "some informative commit message"` | Using the command below skips the staging area and commits directly from the working directory.
```
git commit -a
```
Note that you still need to add new untracked files. |
16,068,968 | Is it possible to **skip the staging area** and (also) commit **untracked, new files** to git in a single built-in, command-line command ? If not, what are the alternatives ?
<http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository>
>
> Providing the -a option to the git commit command makes Git
>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16068968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2153622/"
] | Yes. There are at least two major ways of doing that. First, you don't have to use "the" staging area, you can have as many staging areas as you like -- set `GIT_INDEX_FILE=/path/to/private/index` and do as you please; second you can construct commits yourself, directly. It isn't even hard.
Git's repository core deals... | Using the command below skips the staging area and commits directly from the working directory.
```
git commit -a
```
Note that you still need to add new untracked files. |
12,097,690 | Using .php for a file extension allows for all HTML, CSS, JS, and PHP content, etc., while .html does not allow PHP code to be read by the server-side engine.
As a rule of thumb I just use .php for my files even if I have no PHP code in them.
So... Is there ever a time when, for some reason, one ought to use .html sp... | 2012/08/23 | [
"https://Stackoverflow.com/questions/12097690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1493707/"
] | When you give a plain HTML file a .php extension, it causes the PHP engine to parse it. While the performance hit is negligible, it's still an unnecessary waste of resources and a best practice would be to avoid it by giving your non php pages an extension of html. | Hopefully this satisfies this tough question.
PHP = server side language, meaning additional resources are used by the server.
HTML = client side language, which is just displayed by browser. |
48,605,736 | **<https://stackblitz.com/edit/angular-xpamld>**
**Question:** Can someone help me understand why my prototype's `changeDetection: ChangeDetectionStrategy.OnPush` still allows me to update the inner value `name`? If this is not what `ChangeDetectionStrategy.OnPush` suppose to prevent, what should it be doing?
**app.c... | 2018/02/04 | [
"https://Stackoverflow.com/questions/48605736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1191635/"
] | Because primitive datatype is immutable - if you change it, its reference also changes, so `ChangeDetectorRef`of your component knows it must detect changes (because `OnPush` looks for references changes, not data mutations in arrays, objects). If you want to avoid that on primitives, you can manually deactivate/activa... | >
> The state is updated only if parent view bindings changed and child
> component view was initialized with ChangeDetectionStrategy.OnPush.
>
>
>
In the Example you stated just add the following lines to the child Hello Component.
```
ngOnChanges(simpleChange : SimpleChanges){
console.log(simpleChange)
}... |
48,605,736 | **<https://stackblitz.com/edit/angular-xpamld>**
**Question:** Can someone help me understand why my prototype's `changeDetection: ChangeDetectionStrategy.OnPush` still allows me to update the inner value `name`? If this is not what `ChangeDetectionStrategy.OnPush` suppose to prevent, what should it be doing?
**app.c... | 2018/02/04 | [
"https://Stackoverflow.com/questions/48605736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1191635/"
] | Because primitive datatype is immutable - if you change it, its reference also changes, so `ChangeDetectorRef`of your component knows it must detect changes (because `OnPush` looks for references changes, not data mutations in arrays, objects). If you want to avoid that on primitives, you can manually deactivate/activa... | The default change detection strategy is to be conservative and check all its bindings for something that ***might*** have changed. Typically, a change detection cycle is triggered whenever an *[input]* changes, or an *(event)* occurs from *any* component.
By changing a component's change detection strategy to *OnPush... |
21,886,147 | I am using following code to create a new file **cat15** using **cat** command in UNIX
```
# cat > cat15
```
this command adds a new file **cat15** in root directory and whatever I type after this command is being stored into the file created. But I am not able to exit from this editor.
In other word, I am not gett... | 2014/02/19 | [
"https://Stackoverflow.com/questions/21886147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1969750/"
] | The `cat` command reads from STDIN if you don't specify a filename. It continues to do this until it receives an EOF or is killed. You can send an EOF and get your terminal back by typing `<ctrl>+d`.
What people generally do is to either use
```
touch filename
```
or
```
echo -n > filename
```
to create an empty... | If you just want to create an empty file, regardless of whether one existed or not, you can just use ">" like this:
```
> cat15
```
It will clobber anything that already exists by that name. |
5,080,374 | Say I want to change a container's class when the image it contains is loaded, probably something like this:
```
$('.image').load(function(){
$(this).parents('.image-wrapper').removeClass('image-wrapper').addClass('image-wrapper-new');
});
```
…And then add a click event, referencing the newly-added class, like ... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5080374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/601883/"
] | To fix the syntax error:
```
$('.image').load(function(){
$(this).parents('.image-wrapper').removeClass('image-wrapper').addClass('image-wrapper-new');
});
```
I would also recommend using [`.on()`](http://api.jquery.com/on) rather than `.click()` so you don't have to re-bind event handlers every time you change... | Just add your click event handler in the same function, as you change class:
```
$('.image').load(function(){
$(this).parents('.image-wrapper')
.removeClass('image-wrapper')
.addClass('image-wrapper-new')
.click(function(){
//Do stuff
});
});
``` |
5,080,374 | Say I want to change a container's class when the image it contains is loaded, probably something like this:
```
$('.image').load(function(){
$(this).parents('.image-wrapper').removeClass('image-wrapper').addClass('image-wrapper-new');
});
```
…And then add a click event, referencing the newly-added class, like ... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5080374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/601883/"
] | To fix the syntax error:
```
$('.image').load(function(){
$(this).parents('.image-wrapper').removeClass('image-wrapper').addClass('image-wrapper-new');
});
```
I would also recommend using [`.on()`](http://api.jquery.com/on) rather than `.click()` so you don't have to re-bind event handlers every time you change... | You should be using .live('click', function() {}); due to the fact that you are updating the DOM. .click() will not pick up on new data automatically. If you are building an ajax application this should be standard imo |
5,080,374 | Say I want to change a container's class when the image it contains is loaded, probably something like this:
```
$('.image').load(function(){
$(this).parents('.image-wrapper').removeClass('image-wrapper').addClass('image-wrapper-new');
});
```
…And then add a click event, referencing the newly-added class, like ... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5080374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/601883/"
] | You should be using .live('click', function() {}); due to the fact that you are updating the DOM. .click() will not pick up on new data automatically. If you are building an ajax application this should be standard imo | Just add your click event handler in the same function, as you change class:
```
$('.image').load(function(){
$(this).parents('.image-wrapper')
.removeClass('image-wrapper')
.addClass('image-wrapper-new')
.click(function(){
//Do stuff
});
});
``` |
121,329 | After upgrading to Firefox 3.6, I noticed that there no longer seems to be a way to have tabs all displayed in several rows when there are too many to fit in the window:

I find it very inconvenient to have to click on the down arrow at the far-right... | 2010/03/18 | [
"https://superuser.com/questions/121329",
"https://superuser.com",
"https://superuser.com/users/3906/"
] | You can try the [TooManyTabs](https://addons.mozilla.org/en-US/firefox/addon/9429) add-on.
>
> TooManyTabs allows you to store as many tabs as you like by adding
> extra rows in the Firefox! It saves your browser's space and memory as
> idle tabs are put aside. The extra rows also help to better prioritize
> and v... | Have you tried with [TabKit](https://addons.mozilla.org/en-US/firefox/addon/5447) ? also I think that you'll have to take a look at [this solution](https://forums.addons.mozilla.org/viewtopic.php?f=9&t=789&p=1937). Hope this helps. |
58,647,340 | I am using Python and have a data frame with a datetime index, a grouping variable (gvar) and a value variable (x).
I would like to find all the common datetimes between the groups.
I already have a solution using functools, but I am seeking a way to do it using pandas functionalities only (if possible).
```
import f... | 2019/10/31 | [
"https://Stackoverflow.com/questions/58647340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9576116/"
] | This is what you need to know about bash variables and quoting:
For the following examples, the variable `${text}` is set to `Hello`:
1. Variables are expanded inside double quotes. e.g. `"${text}"` => `Hello`
2. Variables are **not** expanded inside single quotes. e.g. `'${text}'` => `${text}`
3. Single quotes have ... | It seems that variable name 'groups' is reserved by ansible.
I changed name, and script starts working.
The answer of Andrew Vickers is also correct. |
15,258,267 | I am developing a news application.
At the main page, I am fetching the news from a server, using JSON.
I am putting the title of this new in the listview alongside a thumbnail image.
The main text of the news (which might be more than 15 lines) does not appear here.
Where I want it to appear is when the user click... | 2013/03/06 | [
"https://Stackoverflow.com/questions/15258267",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2102389/"
] | I would prefer the second option. Because user might not be interested in all the news. Practically, user will read only few news. Say 4 or 5. If you do by second option, you will be fetching only those 4 or 5 data. You fetching all the available data at once will consume large data traffic and time to load the list. | Roughly if you don't want your app to work offline @Karthik Palanivelu is right, and you should only request the extra data if the user wants to read it.
If you do, then that really depends on how many items your list has and how much do you care about the data traffic. If you have 1000 items, 15 lines, let's say 100 ... |
19,486,423 | Here's my folder structure (all blacked out is just name of project, just assume 'myproject'):

I want to set my home page, ie `http://mydomain.com/`, as a template HTML. So following [this SO post](https://stackoverflow.com/questions/1940528/django-... | 2013/10/21 | [
"https://Stackoverflow.com/questions/19486423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/712997/"
] | Using numpy indexing/slicing notation, you use commas to delimit the slice for each dimension:
```
import numpy as np
a = np.array([[1,2,3],[1,2,3],[1,2,3]])
print a[:,1:]
```
output:
```
[[2 3]
[2 3]
[2 3]]
```
For additional reading on numpy indexing:
<http://docs.scipy.org/doc/numpy/reference/arrays.indexing... | You can use [list comprehensions](http://docs.python.org/2/tutorial/datastructures.html#list-comprehensions):
```
b = [x[1:] for x in a]
```
Demo:
```
>>> a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
>>> b = [x[1:] for x in a]
>>> b
[[2, 3], [5, 6], [8, 9]]
>>>
``` |
19,486,423 | Here's my folder structure (all blacked out is just name of project, just assume 'myproject'):

I want to set my home page, ie `http://mydomain.com/`, as a template HTML. So following [this SO post](https://stackoverflow.com/questions/1940528/django-... | 2013/10/21 | [
"https://Stackoverflow.com/questions/19486423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/712997/"
] | You can use [list comprehensions](http://docs.python.org/2/tutorial/datastructures.html#list-comprehensions):
```
b = [x[1:] for x in a]
```
Demo:
```
>>> a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
>>> b = [x[1:] for x in a]
>>> b
[[2, 3], [5, 6], [8, 9]]
>>>
``` | in python 3 you can also use \*
```
b = [x for _,*x in a]
```
this approach is more flexible since you can for example left first and last elements of the inside list, no matter how long is the list:
```
b = [first,last for first,*middle,last in a]
``` |
19,486,423 | Here's my folder structure (all blacked out is just name of project, just assume 'myproject'):

I want to set my home page, ie `http://mydomain.com/`, as a template HTML. So following [this SO post](https://stackoverflow.com/questions/1940528/django-... | 2013/10/21 | [
"https://Stackoverflow.com/questions/19486423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/712997/"
] | Using numpy indexing/slicing notation, you use commas to delimit the slice for each dimension:
```
import numpy as np
a = np.array([[1,2,3],[1,2,3],[1,2,3]])
print a[:,1:]
```
output:
```
[[2 3]
[2 3]
[2 3]]
```
For additional reading on numpy indexing:
<http://docs.scipy.org/doc/numpy/reference/arrays.indexing... | in python 3 you can also use \*
```
b = [x for _,*x in a]
```
this approach is more flexible since you can for example left first and last elements of the inside list, no matter how long is the list:
```
b = [first,last for first,*middle,last in a]
``` |
34,605,463 | the adutomatic crud operation generated by symfony and also the symfony demo application has the following code structure for the delete action
```
/**
* Deletes a testing entity.
*
* @Route("/{id}", name="testing_delete")
* @Method("DELETE")
*/
public function deleteAction(Request $re... | 2016/01/05 | [
"https://Stackoverflow.com/questions/34605463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5211278/"
] | If you used link for delete with id, it's possible to robot can delete you data with looping.
In Symfony action check "DELETE" method as well as if your crsf token verify with method isValid "$form->isValid()"
That's security reason it's create form and validate | Not using a simple link to delete data denotes to the concept of [safe methods](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Safe_methods) in HTTP (if you had just a simple link, you would have to send a `GET` request to the URL):
>
> Some of the methods (for example, HEAD, GET, OPTIONS and TRACE) are, b... |
34,605,463 | the adutomatic crud operation generated by symfony and also the symfony demo application has the following code structure for the delete action
```
/**
* Deletes a testing entity.
*
* @Route("/{id}", name="testing_delete")
* @Method("DELETE")
*/
public function deleteAction(Request $re... | 2016/01/05 | [
"https://Stackoverflow.com/questions/34605463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5211278/"
] | If you used link for delete with id, it's possible to robot can delete you data with looping.
In Symfony action check "DELETE" method as well as if your crsf token verify with method isValid "$form->isValid()"
That's security reason it's create form and validate | I think it's important to write a word about [CSRF](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)).
By using a Symfony form, it creates a CSRF token that ensure the user who deletes the entity is the same user who wanted it.
If there was no form and only a link `/{id}`, it would be possible by usin... |
34,605,463 | the adutomatic crud operation generated by symfony and also the symfony demo application has the following code structure for the delete action
```
/**
* Deletes a testing entity.
*
* @Route("/{id}", name="testing_delete")
* @Method("DELETE")
*/
public function deleteAction(Request $re... | 2016/01/05 | [
"https://Stackoverflow.com/questions/34605463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5211278/"
] | Not using a simple link to delete data denotes to the concept of [safe methods](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Safe_methods) in HTTP (if you had just a simple link, you would have to send a `GET` request to the URL):
>
> Some of the methods (for example, HEAD, GET, OPTIONS and TRACE) are, b... | I think it's important to write a word about [CSRF](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)).
By using a Symfony form, it creates a CSRF token that ensure the user who deletes the entity is the same user who wanted it.
If there was no form and only a link `/{id}`, it would be possible by usin... |
41,429,445 | here is my code that generates random characters
How can i get this random characters when i click my button 'submit' . and get that as a variable to save on database. please help
this is my button
```
<span class="input-group-btn">
<button class="btn btn-info" type="submit" name="submit">POST</button>
</spa... | 2017/01/02 | [
"https://Stackoverflow.com/questions/41429445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7365857/"
] | ```
<?php
if(isset($_POST['submit'])) {
if(isset($_POST['rand'])) {
echo $_POST['rand'];
}
}
?>
<form method="POST" >
//this generates random characters
<?php
$result = "";
$chars = "abcdefghijklmnopqrstuvwxyz0123456789";
$chararray = str_split($chars);
for($i = 0; $i < 7 ; $i++)... | Send the value either in the session on the server or create a hidden input type on the client. The second option solves your question. |
41,429,445 | here is my code that generates random characters
How can i get this random characters when i click my button 'submit' . and get that as a variable to save on database. please help
this is my button
```
<span class="input-group-btn">
<button class="btn btn-info" type="submit" name="submit">POST</button>
</spa... | 2017/01/02 | [
"https://Stackoverflow.com/questions/41429445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7365857/"
] | ```
<?php
if(isset($_POST['submit'])) {
if(isset($_POST['rand'])) {
echo $_POST['rand'];
}
}
?>
<form method="POST" >
//this generates random characters
<?php
$result = "";
$chars = "abcdefghijklmnopqrstuvwxyz0123456789";
$chararray = str_split($chars);
for($i = 0; $i < 7 ; $i++)... | ```
<?php
$result = "";
$chars = "abcdefghijklmnopqrstuvwxyz0123456789";
$chararray = str_split($chars);
for($i = 0; $i < 7 ; $i++){
$randitem = array_rand($chararray);
$result .= "".$chararray[$randitem];
}
?>
<form action="my_php_database_script.php" method="P... |
13,483,724 | I am presenting a modal view controller from another modal view controller, and this worked fine under all iOS versions prior to iOS6. But under iOS6 I am getting the following warning message in the emulator:
```
Warning: Attempt to present <UINavigationController: 0x14e93680> on <UINavigationController: 0x9fc6b70> w... | 2012/11/20 | [
"https://Stackoverflow.com/questions/13483724",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1840362/"
] | You can use an **EditorTemplates** for this. The below example shows the normal form posting example. You can ajaxify it if you need by using the `serialize` method and sending form values.
Assuming You need to Edit the List of Student Names for a course. So Let's create some viewmodels for that
```
public class Cour... | You just need to specify the right model, list of example, and send the ajax with have information on each row (element of the array), read it on the server side and update each element accordingly. For this goal you use Post request. Just pass the list of elements as a parameters into the controller and pass it using ... |
25,243,792 | Hey guys I have this jQuery content toggle setup here: <http://jsfiddle.net/DTcHh/848/>
I am trying to remove the class for the span that contains the plus glyphicon and replace it with the minus glyphicon when the content is visible.
Here is my jQuery:
```
$(document).ready(function () {
$('#toggle-view li').c... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25243792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3929619/"
] | The `addClass` and `removeClass` functions require strings, to know what classes you are talking about. A string is declared by putting quotes around the text. Because those are missing, it now thinks those are variables, which they aren't.
Added to that, you were missing a dot before `removeClass`.
Try this:
```
$(... | **Problems:**
1. You put `removeClass` right after the children() function, without using a dot.
2. You didn't use brackets (" or ') for your string.
3. You've tried to remove/append multiple classes at once by seprating the classes with a space. I don't think this is possible.
Also, you put a number in a string, wic... |
25,243,792 | Hey guys I have this jQuery content toggle setup here: <http://jsfiddle.net/DTcHh/848/>
I am trying to remove the class for the span that contains the plus glyphicon and replace it with the minus glyphicon when the content is visible.
Here is my jQuery:
```
$(document).ready(function () {
$('#toggle-view li').c... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25243792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3929619/"
] | The `addClass` and `removeClass` functions require strings, to know what classes you are talking about. A string is declared by putting quotes around the text. Because those are missing, it now thinks those are variables, which they aren't.
Added to that, you were missing a dot before `removeClass`.
Try this:
```
$(... | I`m not sure about .children() method...
You can try find() like this and just use .addClass("classname") or .removeClass("classname"). Note that "." (dots) are not needed.
```
$(document).ready(function () {
$('#toggle-view li').click(function () {
var text = $(this).children('div.panel');
if (text.is('... |
25,234,696 | I have this MYSQL query
```
SELECT username,password,enabled FROM USERS WHERE username=?
```
that outputs 3 columns: username, password, enabled.
Now what I want to do is include email\_address in the query and **OUTPUT IT ALSO UNDER USERNAME** column
```
SELECT username,password,enabled FROM USERS WHERE username... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25234696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2016628/"
] | Try the following:
```
// mainwindow.h
class MainWindow : public QMainWindow
{
private:
QScopedPointer<QTimer> timer2;
};
```
If you want to create the instance in the constructor, use the following:
```
// mainwindow.cpp
MainWindow::MainWindow()
:timer2(new QTimer)
{
}
```
Alternately, if you want to cre... | Use method `reset` of QScopedPointer
```
timer2.reset(new QTimer());
``` |
25,234,696 | I have this MYSQL query
```
SELECT username,password,enabled FROM USERS WHERE username=?
```
that outputs 3 columns: username, password, enabled.
Now what I want to do is include email\_address in the query and **OUTPUT IT ALSO UNDER USERNAME** column
```
SELECT username,password,enabled FROM USERS WHERE username... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25234696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2016628/"
] | Use method `reset` of QScopedPointer
```
timer2.reset(new QTimer());
``` | What you're doing amounts to a premature pessimization. You're creating members of a `MainWindow` class *separately and individually* on the heap, when you should be simply putting them into the class as members:
```
// interface
#include <QMainWindow>
#include <QTimer>
class MainWindow : public QMainWindow {
Q_OBJ... |
25,234,696 | I have this MYSQL query
```
SELECT username,password,enabled FROM USERS WHERE username=?
```
that outputs 3 columns: username, password, enabled.
Now what I want to do is include email\_address in the query and **OUTPUT IT ALSO UNDER USERNAME** column
```
SELECT username,password,enabled FROM USERS WHERE username... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25234696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2016628/"
] | Try the following:
```
// mainwindow.h
class MainWindow : public QMainWindow
{
private:
QScopedPointer<QTimer> timer2;
};
```
If you want to create the instance in the constructor, use the following:
```
// mainwindow.cpp
MainWindow::MainWindow()
:timer2(new QTimer)
{
}
```
Alternately, if you want to cre... | What you're doing amounts to a premature pessimization. You're creating members of a `MainWindow` class *separately and individually* on the heap, when you should be simply putting them into the class as members:
```
// interface
#include <QMainWindow>
#include <QTimer>
class MainWindow : public QMainWindow {
Q_OBJ... |
27,933,198 | In the [official documentation](http://www.yiiframework.com/doc-2.0/guide-start-databases.html#preparing-the-database) example "Country" database. I decided to add new field (Property) for the country, namely, `area`. I added a field named to the MySQL database's table named `country` with the name `area` with the foll... | 2015/01/13 | [
"https://Stackoverflow.com/questions/27933198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1592845/"
] | >
> Now all fields in update view, are updated successfully, except the
> new field area. It, simply, does not updated at all without any error
> messages. Why?
>
>
>
Because it's not safe attribute. You said that it's not presented in the rules. If you don't want validate it, but want to be able to massively as... | You can validate Float type validation by defining rule in model Like...
```
....other rules....
[['area'],'integer', 'integerOnly' => false,],
...other rule...
``` |
25,667,492 | Example: We have an employee list page, that consists of filter criteria form and employee list grid. One of the criteria you can filter by is manager. If the user wants to pick a manager to filter by, he uses the lookup control and popup window is opened, that also has filter criteria and employee list grid.
Now the... | 2014/09/04 | [
"https://Stackoverflow.com/questions/25667492",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/190474/"
] | It sounds like you are using a partial page as the content to a Kendo window. If this is the case then just provide your partial with a prefix like so at the top of the page.
```
@{
ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"
}
```
Now when you create a kendo control via the MVC wrapper like so
```
@(Htm... | We do something similar, and have the same problem. We have create/edit/delete popups that fetch data via ajax. Different viewmodels might reference the same model on the same page, and if you open multiple popups (create item type 1, create item type 2) then the second and subsequent popups can be broken (kendo ui err... |
72,331,017 | I'm new to React, but following multiple guides I have an issue with buttons not selecting the correct style based on "checkButtonStyle", only rendering with the fallback options.
My code is:
(Button.jsx)
```
import React from 'react';
import './Button.css';
const STYLES = ['btn--primary', 'btn--light', 'btn--dark',... | 2022/05/21 | [
"https://Stackoverflow.com/questions/72331017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19168726/"
] | ```
className={
checkButtonSizes + " " + checkButtonStyle + " btn"}
```
You have to pass the variables in the format mentioned above to make it work. It works for me. Please try and let me know. | In JavaScript, it's possible to use variables in strings with a [JavaScript template literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals).
However, this requires the use of backticks (`) rather than single (') or double (") quotes.
This line uses single quotes rather than back... |
64,742,999 | I have a Node/Express server running on an AWS Lightsail instance with PM2 as a process manager. The server is currently listening on port 4000. The IP address for the instance is attached to a subdomain that has a valid SSL certificate and automatically redirects from HTTP to HTTPS. Visiting <https://example.com> at t... | 2020/11/08 | [
"https://Stackoverflow.com/questions/64742999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9206151/"
] | Precision, recall and f1-score values depend on the probability threshold. Changes in the threshold that we select to use as a cut-off to determine that a sample belongs to the positive class will affect the precision, recall and therefore f1-score. I share my attempt to plot precision, recall and f1-score depending on... | You seem to have a native 90% accuracy
```
delt = predicted - ground_truth # where all but 2 of 20 appear within .4
```
Other/ more examples of (model) predicted would illustrate ranges perhaps? |
732,836 | I have a requirement to setup a website that allows users, user blogs, a forum and is flexible enough to add other features via .net. I'm just about to evaluate Umbraco, but for another website that's clearly up the CMS alley, however the aforementioned project needs faster turnaround. | 2009/04/09 | [
"https://Stackoverflow.com/questions/732836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13954/"
] | Umbraco supports users, as in backend users with various editing and publishing permissions. There are a couple of blog and comments packages for backend users. Umbraco v4 also has Canvas (editing in place, within the website).
It also supports Membership which is front end website 'members'. You could provide blogs ... | Umbraco is great for programmers, though (IMO) not so much for people less technically inclined. It does cater for all the things you have described, though in my experience, the relative lack of documentation make it a bit more difficult to work with users/groups and permissions (this is users and groups of a website ... |
732,836 | I have a requirement to setup a website that allows users, user blogs, a forum and is flexible enough to add other features via .net. I'm just about to evaluate Umbraco, but for another website that's clearly up the CMS alley, however the aforementioned project needs faster turnaround. | 2009/04/09 | [
"https://Stackoverflow.com/questions/732836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13954/"
] | Umbraco is great for programmers, though (IMO) not so much for people less technically inclined. It does cater for all the things you have described, though in my experience, the relative lack of documentation make it a bit more difficult to work with users/groups and permissions (this is users and groups of a website ... | For learning, umbraco.tv has been great. Its worth a subscription for a month or two at least just to get up to speed quickly. |
732,836 | I have a requirement to setup a website that allows users, user blogs, a forum and is flexible enough to add other features via .net. I'm just about to evaluate Umbraco, but for another website that's clearly up the CMS alley, however the aforementioned project needs faster turnaround. | 2009/04/09 | [
"https://Stackoverflow.com/questions/732836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13954/"
] | Umbraco is great for programmers, though (IMO) not so much for people less technically inclined. It does cater for all the things you have described, though in my experience, the relative lack of documentation make it a bit more difficult to work with users/groups and permissions (this is users and groups of a website ... | use simple form package or nforum package for such like requirement.
Here is the link of Simple form,where u may download this package
```
http://our.umbraco.org/projects/developer-tools/simple-forms
``` |
732,836 | I have a requirement to setup a website that allows users, user blogs, a forum and is flexible enough to add other features via .net. I'm just about to evaluate Umbraco, but for another website that's clearly up the CMS alley, however the aforementioned project needs faster turnaround. | 2009/04/09 | [
"https://Stackoverflow.com/questions/732836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13954/"
] | Umbraco supports users, as in backend users with various editing and publishing permissions. There are a couple of blog and comments packages for backend users. Umbraco v4 also has Canvas (editing in place, within the website).
It also supports Membership which is front end website 'members'. You could provide blogs ... | For learning, umbraco.tv has been great. Its worth a subscription for a month or two at least just to get up to speed quickly. |
732,836 | I have a requirement to setup a website that allows users, user blogs, a forum and is flexible enough to add other features via .net. I'm just about to evaluate Umbraco, but for another website that's clearly up the CMS alley, however the aforementioned project needs faster turnaround. | 2009/04/09 | [
"https://Stackoverflow.com/questions/732836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13954/"
] | Umbraco supports users, as in backend users with various editing and publishing permissions. There are a couple of blog and comments packages for backend users. Umbraco v4 also has Canvas (editing in place, within the website).
It also supports Membership which is front end website 'members'. You could provide blogs ... | Umbraco is a brilliant CMS - my personal favourite. It can be a bit over-whelming at the start (especially if you don't like XSLT) but it is so flexible and can do anything!
* Umbraco has built in membership
system which is very easy to use and
you can also use custom .net
membership providers.
* [Blog4Umbraco is a gr... |
732,836 | I have a requirement to setup a website that allows users, user blogs, a forum and is flexible enough to add other features via .net. I'm just about to evaluate Umbraco, but for another website that's clearly up the CMS alley, however the aforementioned project needs faster turnaround. | 2009/04/09 | [
"https://Stackoverflow.com/questions/732836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13954/"
] | Umbraco supports users, as in backend users with various editing and publishing permissions. There are a couple of blog and comments packages for backend users. Umbraco v4 also has Canvas (editing in place, within the website).
It also supports Membership which is front end website 'members'. You could provide blogs ... | use simple form package or nforum package for such like requirement.
Here is the link of Simple form,where u may download this package
```
http://our.umbraco.org/projects/developer-tools/simple-forms
``` |
732,836 | I have a requirement to setup a website that allows users, user blogs, a forum and is flexible enough to add other features via .net. I'm just about to evaluate Umbraco, but for another website that's clearly up the CMS alley, however the aforementioned project needs faster turnaround. | 2009/04/09 | [
"https://Stackoverflow.com/questions/732836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13954/"
] | Umbraco is a brilliant CMS - my personal favourite. It can be a bit over-whelming at the start (especially if you don't like XSLT) but it is so flexible and can do anything!
* Umbraco has built in membership
system which is very easy to use and
you can also use custom .net
membership providers.
* [Blog4Umbraco is a gr... | For learning, umbraco.tv has been great. Its worth a subscription for a month or two at least just to get up to speed quickly. |
732,836 | I have a requirement to setup a website that allows users, user blogs, a forum and is flexible enough to add other features via .net. I'm just about to evaluate Umbraco, but for another website that's clearly up the CMS alley, however the aforementioned project needs faster turnaround. | 2009/04/09 | [
"https://Stackoverflow.com/questions/732836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13954/"
] | Umbraco is a brilliant CMS - my personal favourite. It can be a bit over-whelming at the start (especially if you don't like XSLT) but it is so flexible and can do anything!
* Umbraco has built in membership
system which is very easy to use and
you can also use custom .net
membership providers.
* [Blog4Umbraco is a gr... | use simple form package or nforum package for such like requirement.
Here is the link of Simple form,where u may download this package
```
http://our.umbraco.org/projects/developer-tools/simple-forms
``` |
7,949,015 | How do I go about drawing my own custom selection style for a view based `NSTableView`? I tried putting a `BOOL` var in my `NSTableCellView` subclass and set that to `YES` if it is clicked and then I can successfully draw my custom selection. But how do I change that `BOOL` var to `NO` when another view is clicked? Tha... | 2011/10/31 | [
"https://Stackoverflow.com/questions/7949015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/639668/"
] | Alright, I figured it out. You just have to subclass `NSTableRowView`. It has methods for drawing the background for selected and deselected rows. To get the table view to use your subclass just implement the table view delegate method `tableView:rowViewForRow:` and return an instance of your subclass. | To make things clear, I think we should give the code of the delegate method :
```
- (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row
{
MyNSTableRowView *rowView = [[MyNSTableRowView alloc]init];
return rowView;
}
``` |
72,383,721 | I have patients with baseline pain scores and follow up of 6 months, 1 year and 2 years (each their own variable column). I have 26,000+ patients. There is missing data at those various time points. I can easily analyse pain score outcomes at one year excluding missing, 6mths and two years etc.... What I would like to ... | 2022/05/25 | [
"https://Stackoverflow.com/questions/72383721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17413243/"
] | one approach:
```
library(dplyr)
your_data_frame %>%
mutate(vas.outcome = coalesce(vas.6mth, vas.year, vas.two))
``` | I'm not 100% sure what you want your final dataset to look like, and I'm sure there are more elegant ways, but to choose the first occurrence of an outcome (after baseline), you can do:
Data
```
df <- read.table(text = "id vas.base vas.6mth vas.year vas.two
1 5 NA ... |
72,383,721 | I have patients with baseline pain scores and follow up of 6 months, 1 year and 2 years (each their own variable column). I have 26,000+ patients. There is missing data at those various time points. I can easily analyse pain score outcomes at one year excluding missing, 6mths and two years etc.... What I would like to ... | 2022/05/25 | [
"https://Stackoverflow.com/questions/72383721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17413243/"
] | one approach:
```
library(dplyr)
your_data_frame %>%
mutate(vas.outcome = coalesce(vas.6mth, vas.year, vas.two))
``` | You could use a `case_when()/fcase()` approach
```
dt[, pain:=fcase(
!is.na(vas.year), vas.year,
!is.na(vas.two), vas.two,
!is.na(vas.6mth), vas.6mth,
default = NA
)]
```
or
```
dt %>%
mutate(pain:=case_when(
!is.na(vas.year)~vas.year,
!is.na(vas.two)~vas.two,
TRUE~vas.6mth
))
```
Output:... |
654,204 | Find all linear fractional transformation that maps {$z:Im(z)>0$} to {$w:|w|<1$}
I don't know anything about this.. Can you help me? | 2014/01/28 | [
"https://math.stackexchange.com/questions/654204",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/114952/"
] | **Theorem:** If $d\equiv 1\pmod{4}$, then $\mathcal{O}\_{\mathbf{Q}[\sqrt{d}]}=\mathbf{Z}\left[\frac{-1+\sqrt{d}}{2}\right]$. Otherwise, $\mathcal{O}\_{\mathbf{Q}[\sqrt{d}]}=\mathbf{Z}[\sqrt{d}]$.
*Proof:* Let $\alpha=r+s\sqrt{d}\in\mathbf{Q}(\sqrt{d})$. Then, $\alpha\in\mathcal{O}\_{\mathbf{Q}[\sqrt{d}]}$ iff $2r, r^... | Let $D$ be a squarefree number. The element $a+b\sqrt{D}\in\Bbb Q(\sqrt{D})=K$ has minimal polynomial
$$x^2-2ax+(a^2-Db^2).$$
Thus $a+b\sqrt{d}\in{\cal O}\_K\Leftrightarrow a\in\frac{1}{2}\Bbb Z,a^2-Db^2\in\Bbb Z$. If $b$ is not an integer, then can $a$ an integer? And, furthermore, what is the only possible denomina... |
31,081,468 | I'm trying to write my first module in Ansible, which is essentially a wrapper around another module. Here is my module:
```
#!/usr/bin/python
import ansible.runner
import sys
def main():
module.exit_json(changed=False)
from ansible.module_utils.basic import *
main()
```
and here is the error it gives me (stri... | 2015/06/26 | [
"https://Stackoverflow.com/questions/31081468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5025644/"
] | There is the `indexPathForSelectedRow` definition in **Swift 1.2**:
```
- (NSIndexPath *)indexPathForSelectedRow; // returns nil or index path representing section and row of selection.
```
There is its definition in **Swift 2.0**:
```
var indexPathForSelectedRow: NSIn... | Sounds like there is no reference to `tableView` or it's not of type `UITableView`. |
31,081,468 | I'm trying to write my first module in Ansible, which is essentially a wrapper around another module. Here is my module:
```
#!/usr/bin/python
import ansible.runner
import sys
def main():
module.exit_json(changed=False)
from ansible.module_utils.basic import *
main()
```
and here is the error it gives me (stri... | 2015/06/26 | [
"https://Stackoverflow.com/questions/31081468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5025644/"
] | There is the `indexPathForSelectedRow` definition in **Swift 1.2**:
```
- (NSIndexPath *)indexPathForSelectedRow; // returns nil or index path representing section and row of selection.
```
There is its definition in **Swift 2.0**:
```
var indexPathForSelectedRow: NSIn... | ```
override func prepareForSegue(segue: UIStoryboardSegue , sender: AnyObject?) {
if segue.identifier == "show"
{
let indexpath = self.tableView.indexPathsForSelectedRows()!
let detailv:fiveViewController = segue.destinationViewController as! fiveViewController
detailv.pic = self.menu[i... |
43,050,866 | Assume I have a function like below:
```
void func1(...) {
...
...
func2(...);
...
...
}
```
In the compilation phase, I call the `func1()` function in two places. However, in one of the places I don't want the `func2()` to be executed.
So, I need two versions of `func1()` during **compilation*... | 2017/03/27 | [
"https://Stackoverflow.com/questions/43050866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1609345/"
] | A pretty common way is to define a token and wrap the call in an `#ifdef` block (checking for the token), no need to duplicate `func1` i.e. :
```
#define _INCLUDE_FUNC2_BUILD// or something
void func1(...) {
...
...
#ifdef _INCLUDE_FUNC2_BUILD
func2(...);
#endif // _INCLUDE_FUNC2_BUILD
...
...
}
... | Rather than conditional compilation, especially if the rest of the function is substantial, you can pass a parameter to indicate whether `func2()` should be called. The function might be defined as:
```
void func1(..., bool call_func2) {
...
...
if (call_func2)
func2(...);
...
...
}
```
a... |
16,501,293 | So, this is a part of my "linked\_list.h" header:
```
template <typename T>
class Linked_list {
public:
Linked_list();
~Linked_list();
void add_first(const T& x);
//...
};
```
And a part of my implementation:
```
template <typename T>
line 22: void Linked_list<T> :: add_first(const T& x)
{
Node<T>* aux;
... | 2013/05/11 | [
"https://Stackoverflow.com/questions/16501293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1261480/"
] | ```
App.ViewModel.Items.Insert(0, new ItemViewModel() { ThingOne = "Blah", ThingTwo = "BlahBlahBlah"});
``` | >
> Can I specify this behavior within the Items.Add() statement?
>
>
>
User `Insert` instead :[Collection.Insert Method](http://msdn.microsoft.com/en-us/library/ms132411%28v=vs.100%29.aspx) |
2,971 | I love that video of Ben Burt showing how he made winds for WALL-E by dragging that boxing bag around on a lino floor - see at 7 minutes in this video <http://www.youtube.com/watch?v=TSf8Er2gV_Q>
So what interesting things have you done to create wind sounds? (No fart jokes thanks)
I'm working on a short film Goutte ... | 2010/08/20 | [
"https://sound.stackexchange.com/questions/2971",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | Forgive me if I go a little off topic but for the last few days I've been wanting to try something; make a really spooky wind sound with a voice element.
Here's what I did...
Open izotopeRX DeNoiser and train it using a voice recording (a crowd in a concert hall), then apply that to some wind.
[THIS](http://soundclo... | Always having a recorder is half the battle; got some amazing wind sounds in a cabin on NZ's Queen Charlotte Track. Anywhere there are wires or small holes and high winds, set your ears to "stun."
Another classic is holding blankets or foam over air conditioners. This can create wind whistles you can "play," although ... |
2,971 | I love that video of Ben Burt showing how he made winds for WALL-E by dragging that boxing bag around on a lino floor - see at 7 minutes in this video <http://www.youtube.com/watch?v=TSf8Er2gV_Q>
So what interesting things have you done to create wind sounds? (No fart jokes thanks)
I'm working on a short film Goutte ... | 2010/08/20 | [
"https://sound.stackexchange.com/questions/2971",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | what a cool topic!
i have a studio door that when its half-cracked makes the craziest whining wind sound. I've been meaning to record it for years, but I'd better do it before we move out of this building. I'll post an update when I have it done. | I was going to create a desert wind loop for a fps videogame and decided to have a look around...
Thanks to the great solutions presented here I finally find the most suitable as follows:
I have basically 2 tracks, one is a sound I recorded in my tent one very windy night on a very windy peak, I slowed it down with pa... |
2,971 | I love that video of Ben Burt showing how he made winds for WALL-E by dragging that boxing bag around on a lino floor - see at 7 minutes in this video <http://www.youtube.com/watch?v=TSf8Er2gV_Q>
So what interesting things have you done to create wind sounds? (No fart jokes thanks)
I'm working on a short film Goutte ... | 2010/08/20 | [
"https://sound.stackexchange.com/questions/2971",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | Great timing! I have been working on some eerie wind today. Its still a bit of a work in progress but seems to be coming out ok. I have been stretching some cable swishes (bet you've got a few of them lying around Tim) with [paulstretch](http://hypermammut.sourceforge.net/paulstretch/) then adding a little bit of eq, r... | what a cool topic!
i have a studio door that when its half-cracked makes the craziest whining wind sound. I've been meaning to record it for years, but I'd better do it before we move out of this building. I'll post an update when I have it done. |
2,971 | I love that video of Ben Burt showing how he made winds for WALL-E by dragging that boxing bag around on a lino floor - see at 7 minutes in this video <http://www.youtube.com/watch?v=TSf8Er2gV_Q>
So what interesting things have you done to create wind sounds? (No fart jokes thanks)
I'm working on a short film Goutte ... | 2010/08/20 | [
"https://sound.stackexchange.com/questions/2971",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | Great timing! I have been working on some eerie wind today. Its still a bit of a work in progress but seems to be coming out ok. I have been stretching some cable swishes (bet you've got a few of them lying around Tim) with [paulstretch](http://hypermammut.sourceforge.net/paulstretch/) then adding a little bit of eq, r... | white or pink noise tones with audiosuite EQs, pitch shift, and a slow doppler, and then i let UDK do the rest, oscillation, pitch variation etc. |
2,971 | I love that video of Ben Burt showing how he made winds for WALL-E by dragging that boxing bag around on a lino floor - see at 7 minutes in this video <http://www.youtube.com/watch?v=TSf8Er2gV_Q>
So what interesting things have you done to create wind sounds? (No fart jokes thanks)
I'm working on a short film Goutte ... | 2010/08/20 | [
"https://sound.stackexchange.com/questions/2971",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | Always having a recorder is half the battle; got some amazing wind sounds in a cabin on NZ's Queen Charlotte Track. Anywhere there are wires or small holes and high winds, set your ears to "stun."
Another classic is holding blankets or foam over air conditioners. This can create wind whistles you can "play," although ... | I might be lending the thread a bit, but I'm looking for a particular type of wind and would like to know if anyone knows libraries which might include what I'm looking for. My last resort is to try to whistle or synthesize it.
What I'm looking for is this type of howling wind (00:10 onwards): <http://www.soundsnap.co... |
2,971 | I love that video of Ben Burt showing how he made winds for WALL-E by dragging that boxing bag around on a lino floor - see at 7 minutes in this video <http://www.youtube.com/watch?v=TSf8Er2gV_Q>
So what interesting things have you done to create wind sounds? (No fart jokes thanks)
I'm working on a short film Goutte ... | 2010/08/20 | [
"https://sound.stackexchange.com/questions/2971",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | Great timing! I have been working on some eerie wind today. Its still a bit of a work in progress but seems to be coming out ok. I have been stretching some cable swishes (bet you've got a few of them lying around Tim) with [paulstretch](http://hypermammut.sourceforge.net/paulstretch/) then adding a little bit of eq, r... | Always having a recorder is half the battle; got some amazing wind sounds in a cabin on NZ's Queen Charlotte Track. Anywhere there are wires or small holes and high winds, set your ears to "stun."
Another classic is holding blankets or foam over air conditioners. This can create wind whistles you can "play," although ... |
2,971 | I love that video of Ben Burt showing how he made winds for WALL-E by dragging that boxing bag around on a lino floor - see at 7 minutes in this video <http://www.youtube.com/watch?v=TSf8Er2gV_Q>
So what interesting things have you done to create wind sounds? (No fart jokes thanks)
I'm working on a short film Goutte ... | 2010/08/20 | [
"https://sound.stackexchange.com/questions/2971",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | Great timing! I have been working on some eerie wind today. Its still a bit of a work in progress but seems to be coming out ok. I have been stretching some cable swishes (bet you've got a few of them lying around Tim) with [paulstretch](http://hypermammut.sourceforge.net/paulstretch/) then adding a little bit of eq, r... | Not my own trick, but I've always been impressed with how Richard King and crew created the windstorm sounds in the movie Master and Commander. They basically rigged a flatbed truck with a bunch of interesting props and took it out to the Mojave Desert, got it up to 70mph or so and recorded. Brilliant:
Magazine piece:... |
2,971 | I love that video of Ben Burt showing how he made winds for WALL-E by dragging that boxing bag around on a lino floor - see at 7 minutes in this video <http://www.youtube.com/watch?v=TSf8Er2gV_Q>
So what interesting things have you done to create wind sounds? (No fart jokes thanks)
I'm working on a short film Goutte ... | 2010/08/20 | [
"https://sound.stackexchange.com/questions/2971",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | Recently, I undertook the same task and ended up taking a different route - which was not entirely successful but, with more time spent, could be well worth it. I went through my library and pulled as many whispering fx as I could find and then used those as IRs for Altiverb. The idea was to process regular wind record... | what a cool topic!
i have a studio door that when its half-cracked makes the craziest whining wind sound. I've been meaning to record it for years, but I'd better do it before we move out of this building. I'll post an update when I have it done. |
2,971 | I love that video of Ben Burt showing how he made winds for WALL-E by dragging that boxing bag around on a lino floor - see at 7 minutes in this video <http://www.youtube.com/watch?v=TSf8Er2gV_Q>
So what interesting things have you done to create wind sounds? (No fart jokes thanks)
I'm working on a short film Goutte ... | 2010/08/20 | [
"https://sound.stackexchange.com/questions/2971",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | Not my own trick, but I've always been impressed with how Richard King and crew created the windstorm sounds in the movie Master and Commander. They basically rigged a flatbed truck with a bunch of interesting props and took it out to the Mojave Desert, got it up to 70mph or so and recorded. Brilliant:
Magazine piece:... | I might be lending the thread a bit, but I'm looking for a particular type of wind and would like to know if anyone knows libraries which might include what I'm looking for. My last resort is to try to whistle or synthesize it.
What I'm looking for is this type of howling wind (00:10 onwards): <http://www.soundsnap.co... |
2,971 | I love that video of Ben Burt showing how he made winds for WALL-E by dragging that boxing bag around on a lino floor - see at 7 minutes in this video <http://www.youtube.com/watch?v=TSf8Er2gV_Q>
So what interesting things have you done to create wind sounds? (No fart jokes thanks)
I'm working on a short film Goutte ... | 2010/08/20 | [
"https://sound.stackexchange.com/questions/2971",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/-1/"
] | Great timing! I have been working on some eerie wind today. Its still a bit of a work in progress but seems to be coming out ok. I have been stretching some cable swishes (bet you've got a few of them lying around Tim) with [paulstretch](http://hypermammut.sourceforge.net/paulstretch/) then adding a little bit of eq, r... | I might be lending the thread a bit, but I'm looking for a particular type of wind and would like to know if anyone knows libraries which might include what I'm looking for. My last resort is to try to whistle or synthesize it.
What I'm looking for is this type of howling wind (00:10 onwards): <http://www.soundsnap.co... |
26,013,509 | I have a textarea and i want type keywords into this and want it add comma automatically after press `Enter` key, for example you type a words or sentence then you press `Enter` key and it will add comma after each words or .. i write a simple code but it have two problem, first it will add comma everytime you press `E... | 2014/09/24 | [
"https://Stackoverflow.com/questions/26013509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3815083/"
] | Try this:
```
$('textarea').keypress(function(e){
if (e.keyCode == 13) {
// alert($('textarea').val());
$('textarea').val($('textarea').val() + ', ');
}
});
``` | Hello thank you for question,
Try out below code once
```js
$('textarea').keypress(function(e){
if (e.keyCode == 13) {
e.preventDefault();
$(this).val($(this).val() + ' , ')
}
});
```
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form id=formID><... |
29,299,263 | I need this time a help with this example:
[DEMO](http://plnkr.co/edit/AU4AsLiUpANTRBQHO5as?p=preview)
You can see that the css on example **1** goes good. When you click on the button the state of the button change (press)
On example **2** i can't do the same. **on my app i need that the "radio button" appear on ve... | 2015/03/27 | [
"https://Stackoverflow.com/questions/29299263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4071209/"
] | I got a final version and this is how i need
**[DEMO](http://plnkr.co/edit/VLK98Kce7JXy5Zvl1rhK?p=preview)**
Thanks for all
```
<div class="btn-group-vertical" >
<button ng-repeat="value in vm_login.options"
class="btn btn-primary"
type="button"
ng-model="vm_login.model"
... | The `btn-group` classed element expects it's children to be buttons (a `btn` classed element). Not a `div` element. Take out the `div` and move the `ng-repeat` to the actual button. Now if you want your button to align verticaly you'll need to use `btn-group-vertical` instead of `btn-group` as stated in the [bootstrap ... |
29,299,263 | I need this time a help with this example:
[DEMO](http://plnkr.co/edit/AU4AsLiUpANTRBQHO5as?p=preview)
You can see that the css on example **1** goes good. When you click on the button the state of the button change (press)
On example **2** i can't do the same. **on my app i need that the "radio button" appear on ve... | 2015/03/27 | [
"https://Stackoverflow.com/questions/29299263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4071209/"
] | I got a final version and this is how i need
**[DEMO](http://plnkr.co/edit/VLK98Kce7JXy5Zvl1rhK?p=preview)**
Thanks for all
```
<div class="btn-group-vertical" >
<button ng-repeat="value in vm_login.options"
class="btn btn-primary"
type="button"
ng-model="vm_login.model"
... | This worked for me try this approach in one line without using buttons:
```
<div class="btn-group">
<label class="btn btn-primary" ng-repeat="company in vm_login.decimals" ng-model="radioModel" ng-model="radioModel.id" btn-radio="company.id">{{company.desc}}</label>
</div>
``` |
7,804,911 | on my project I have a huuuuge XSLT used to convert some XML files to HTML.
The problem is that this file is growing up day by day, it's hard to read, debug and test.
So I was thinking about moving all the parsing process to Java.
Do you think is a good idea? In case what libraries to parse XML and generate HTML(XML) ... | 2011/10/18 | [
"https://Stackoverflow.com/questions/7804911",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/324315/"
] | You need to set a locale on the date formatters.
```
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
//...
formater1.locale = locale;
//...
formater2.locale = locale;
//...
[locale release];
```
If you don't set the locale then user's settings can change the provided string to confo... | This could be because the device is not set to english, thus it can't parse the `Tue` and `Oct` in the `pubDat`.
Try adding a an locale to the `NSDateFormatter`:
```
[formater1 setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"EN"] autorelease]];
``` |
455,802 | There is a beverage company here that claims to have a selection of 200 different beers. They have a special deal where you can build your own six pack at a discount. They advertise that there are 1.4B ways to build said six pack, and I am trying to determine if they're correct.
I thought that this would be a combinat... | 2013/07/30 | [
"https://math.stackexchange.com/questions/455802",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/88308/"
] | I distrust advertising numbers like this. The original [Rubik's cube](http://en.wikipedia.org/wiki/Rubik_cube) promised billions of positions. They were technically correct, the correct number is $43,252,003,274,489,856,000$ or 43 billions of billions. To get it exactly right, you would have to make a list of all the p... | If we count permutations as distinct combinations, then it should be $\frac{200!}{194!}$ which is in the order of $10^{13}$. Otherwise it should be $\binom{200}{6}$, which is in the order of $10^{10}$. |
455,802 | There is a beverage company here that claims to have a selection of 200 different beers. They have a special deal where you can build your own six pack at a discount. They advertise that there are 1.4B ways to build said six pack, and I am trying to determine if they're correct.
I thought that this would be a combinat... | 2013/07/30 | [
"https://math.stackexchange.com/questions/455802",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/88308/"
] | Let $(a\_1, \dots, a\_l) \in \mathbb{N}^l$ be notation for $a\_j$ bottles of the $j^{\text{th}}$ beer.
We need to consider how many different types of beer there are in the six pack. Obviously, there could be one, two, three, four, five, or six. Let's consider each case individually.
**One type:** The only way this c... | I distrust advertising numbers like this. The original [Rubik's cube](http://en.wikipedia.org/wiki/Rubik_cube) promised billions of positions. They were technically correct, the correct number is $43,252,003,274,489,856,000$ or 43 billions of billions. To get it exactly right, you would have to make a list of all the p... |
455,802 | There is a beverage company here that claims to have a selection of 200 different beers. They have a special deal where you can build your own six pack at a discount. They advertise that there are 1.4B ways to build said six pack, and I am trying to determine if they're correct.
I thought that this would be a combinat... | 2013/07/30 | [
"https://math.stackexchange.com/questions/455802",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/88308/"
] | Let $(a\_1, \dots, a\_l) \in \mathbb{N}^l$ be notation for $a\_j$ bottles of the $j^{\text{th}}$ beer.
We need to consider how many different types of beer there are in the six pack. Obviously, there could be one, two, three, four, five, or six. Let's consider each case individually.
**One type:** The only way this c... | If we count permutations as distinct combinations, then it should be $\frac{200!}{194!}$ which is in the order of $10^{13}$. Otherwise it should be $\binom{200}{6}$, which is in the order of $10^{10}$. |
1,735 | The bardic lore skill always left me baffled. I never had clear the terms of such skill. A bard can roll a bard lore throw to know some abstruse information. The fact is that the throw is bound to a specific need or question, and it can very well be that the bard knows nothing about one topic, and a lot of a very relat... | 2010/08/29 | [
"https://rpg.stackexchange.com/questions/1735",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/113/"
] | Original celtic bards were actually historians. All of celtic tradition was oral, so someone had to remeber it and pass it on. The poetry and music were only added to make it easier to remember. We can imagine the D&D Bard as a kind of wandering historian-in-training. He already knows some of the songs/stories, but has... | When my player rolls and succeeds I start my answer as follows: "Actually you have heard an old gypsy prayer song back in Manigmar about the mountain gods and it seems to you now, in light of the info you just gained, that they might refer to a coven of wizards hiding up there somewhere. There is a circle of ancient st... |
1,735 | The bardic lore skill always left me baffled. I never had clear the terms of such skill. A bard can roll a bard lore throw to know some abstruse information. The fact is that the throw is bound to a specific need or question, and it can very well be that the bard knows nothing about one topic, and a lot of a very relat... | 2010/08/29 | [
"https://rpg.stackexchange.com/questions/1735",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/113/"
] | When my player rolls and succeeds I start my answer as follows: "Actually you have heard an old gypsy prayer song back in Manigmar about the mountain gods and it seems to you now, in light of the info you just gained, that they might refer to a coven of wizards hiding up there somewhere. There is a circle of ancient st... | Bardic lore is a real life skill. Heck, a lot of people possess it. It's just having information about something that given your background, learning, or skill set you generally wouldn't be expected to know. Just being well read and having general knowledge of a host of different skills, professions, situations, histor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.