qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
64,451 | This follows on from a [previous question I asked](https://codereview.stackexchange.com/questions/62384/reduce-and-condense-a-non-standard-sessionwizardview) which was of huge help to me. I am still only learning Python and Django and I would love to learn how to code better.
The below is a `get_context_data` method ... | 2014/10/01 | [
"https://codereview.stackexchange.com/questions/64451",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/52488/"
] | ### Use `if-elif-else`
Avoid these kind of `if` statements:
>
>
> ```
> if x == y:
> # ...
> if x == z: # note: z != y
> # ...
>
> ```
>
>
Since `x` cannot be equal to two different values at the same time, you should use `elif` for the second and subsequent `if` statements on the same variable:
```
i... | ### Code as is
Constants should use upper case notation. `path_one_images` should be `PATH_ONE_IMAGES`. If it is not constants it should be assigned from constant.
One more hard-coded constanst can be found there:
```
if self.steps.current in ['5','6','7','8','9','10','11','12','13','14','15','16']:
```
`display_i... |
72,534,891 | the purpose of the below function is to return:
```
> f(0) returns [],
> f(1) returns [[1]]
> f(2) returns [[1], [1,2]]
> f(3) returns [[1], [1,2], [1,2,3]]
```
how can it be improved?
```
def list_generator(number: int) -> list:
if number == 0:
new_list = []
else:
temp_list = []
n... | 2022/06/07 | [
"https://Stackoverflow.com/questions/72534891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/573191/"
] | ```
def f(n):
return [[x + 1 for x in range(i)] for i in range(1, n + 1)]
for n in range(6):
print(n, f(n))
# 0 []
# 1 [[1]]
# 2 [[1], [1, 2]]
# 3 [[1], [1, 2], [1, 2, 3]]
# 4 [[1], [1, 2], [1, 2, 3], [1, 2, 3, 4]]
# 5 [[1], [1, 2], [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5]]
``` | You can use a list comprehension:
```
def f(number: int) -> list:
return [list(range(1, i+1)) for i in range(1, number+1)]
``` |
36,541,076 | I am aware of the irony of a (mediocre) website freelancer not being able to get some CSS to work on his own site...
However, wondering if you'd help me with this, as I am no expert on CSS.
On [this webpage](https://websitetechnology.com.au/blog/project/white-wreath-association/), Wordpress has injected a dodgy image... | 2016/04/11 | [
"https://Stackoverflow.com/questions/36541076",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/667903/"
] | This `p` is just not the first element of it's parent, there is an `h2` before it. Use `:first-of-type` instead:
```
body.postid-62 article p:first-of-type img {display: none;}
``` | Please try this:
```
.main.single p>img {
margin-bottom: 5px;
display: none;
}
``` |
36,541,076 | I am aware of the irony of a (mediocre) website freelancer not being able to get some CSS to work on his own site...
However, wondering if you'd help me with this, as I am no expert on CSS.
On [this webpage](https://websitetechnology.com.au/blog/project/white-wreath-association/), Wordpress has injected a dodgy image... | 2016/04/11 | [
"https://Stackoverflow.com/questions/36541076",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/667903/"
] | This `p` is just not the first element of it's parent, there is an `h2` before it. Use `:first-of-type` instead:
```
body.postid-62 article p:first-of-type img {display: none;}
``` | You can select your image checking the alt tag it.
The following example, hides your image.
```
img[alt*="White Wreath Association"] {
display: none;
}
```
Here your HTML just for reference:
```
<img class="alignnone size-full wp-image-4051" src="https://websitetechnology.com.au/wp-content/uploads/2016/04/whit... |
8,389,433 | When I am trying to launch external application on the asp.net server, I see that the process is executed and it works fine, but everything runs in background mode.
I am using cassini web server. Also `StartInfo.CreateNoWindow = false;` does not help.
For example Visual Studio Development server shows everything fine... | 2011/12/05 | [
"https://Stackoverflow.com/questions/8389433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1023807/"
] | This is expected and correct behavior. ASP.Net/IIS run as a service, and any windows created by a service are shown on a private hidden desktop reserved for that purpose. There is no way to show this desktop.
It works in the development server because the development server is a normal app running within the context o... | Doing steps described here <https://stackoverflow.com/a/4679686/166921> caused windows of the process started by asp.net to show up on server machine.
Relevant steps below (after reversing them windows stopped to show up):
**Enable IIS Admin Service to interact with desktop**
To configure this, follow this steps.
a... |
43,018,962 | I am working on project using Java and I'm looking for open source library to parse swift messages: ISO 15022 and 20022.
for 15022 I already find a solution which is Prowidesoftware, but for 20022 I didn't find anything.
any ideas?
thanks. | 2017/03/25 | [
"https://Stackoverflow.com/questions/43018962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7731093/"
] | **November 2020 Update:**
The Prowide ISO 20022 library is now **open source**.
Distributed with Apache license and including features for:
* Java model for ISO 20022 MX (for example: MxPacs00800109 class, for all MX categories)
* Parser from XML into Java model
* Builder API from Java to ISO 20022 XML
* Conversion t... | We have searched a lot for this about a year ago, but could not find, so we have made our own parser using XPath.It is a tiresome job, but will be helpful in understanding the structure more closely. |
41,540,261 | My if statement runs through as if the conditions have been met even when they haven't. I have tried moving bits of code about and even rewriting the if statement differently but it has not changed the outcome. Does anyone know what I'm doing wrong?
```
#include <iostream>
#include <string>
using namespace std;
doubl... | 2017/01/09 | [
"https://Stackoverflow.com/questions/41540261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7392520/"
] | This is really bogus
```
if (bob == "no", "No", "NO", "nO")
```
You need to break it out with logical OR instead
```
if (bob == "no" || bob == "No" || bob == "NO" || bob == "nO")
```
---
As it stand, this `if (bob == "no", "No", "NO", "nO")` would be equivalent to `if("nO")` as the effect of the comma operator. | ```
bob == "no", "No", "NO", "nO"
```
is not doing what you think it is doing. You mean to do:
```
bob == "no" ||
bob == "No" ||
bob == "NO" ||
bob == "nO"
``` |
41,540,261 | My if statement runs through as if the conditions have been met even when they haven't. I have tried moving bits of code about and even rewriting the if statement differently but it has not changed the outcome. Does anyone know what I'm doing wrong?
```
#include <iostream>
#include <string>
using namespace std;
doubl... | 2017/01/09 | [
"https://Stackoverflow.com/questions/41540261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7392520/"
] | This is really bogus
```
if (bob == "no", "No", "NO", "nO")
```
You need to break it out with logical OR instead
```
if (bob == "no" || bob == "No" || bob == "NO" || bob == "nO")
```
---
As it stand, this `if (bob == "no", "No", "NO", "nO")` would be equivalent to `if("nO")` as the effect of the comma operator. | This is a bit of a side note to your question, but in this context, you may want to consider converting the answer to lowercase (or uppercase) before comparing it.
That way, you can just use `if (tolower(bob) == "no")`
---
Here's an example of how to do use the `tolower` function
>
> <http://www.cplusplus.com/refe... |
41,540,261 | My if statement runs through as if the conditions have been met even when they haven't. I have tried moving bits of code about and even rewriting the if statement differently but it has not changed the outcome. Does anyone know what I'm doing wrong?
```
#include <iostream>
#include <string>
using namespace std;
doubl... | 2017/01/09 | [
"https://Stackoverflow.com/questions/41540261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7392520/"
] | This is really bogus
```
if (bob == "no", "No", "NO", "nO")
```
You need to break it out with logical OR instead
```
if (bob == "no" || bob == "No" || bob == "NO" || bob == "nO")
```
---
As it stand, this `if (bob == "no", "No", "NO", "nO")` would be equivalent to `if("nO")` as the effect of the comma operator. | Your loop problem can be explained:
`while (continueBool = true)`
should read
`while (continueBool == true)`.
As your code currently stands, you are setting it to true instead of checking for a value, so it will never exit. |
28,025,714 | In the book Thinking in C++, it mentioned about type-safe linkage, but not very clear.Can someone explain it in detail?
Thanks in advance. | 2015/01/19 | [
"https://Stackoverflow.com/questions/28025714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1184497/"
] | Typesafe linkage enforces the right number and type of parameters are passed at link time.
For example, in C, you can define a library function as taking an int, but through a series of mishaps, you can pass it a string.
C++ avoids this kind of error by **making function prototypes mandatory** and my using name mangl... | Type-safe linkage enforces that one has to provide the correct number and types of arguments at link-time. As a counter-example consider C, where you can define a function which takes an `double` but you accidentally pass a `complex`. In C++ this cannot happen due to type-safe linkage. As reference, have a look at [Typ... |
22,289,031 | I've enhanced a force diagram to compare two profiles. I am trying to have the main node take on an image
<http://jsfiddle.net/LsMZp/5/>
* how do I get the image to be centrally aligned (sized correctly) and the thumbnail data passed in more dynamically from the json string.
* also if someone shares a particular int... | 2014/03/09 | [
"https://Stackoverflow.com/questions/22289031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2700673/"
] | I've enhanced the system to take an array of user information. This is then used to build the nodes.
\**Latest Code <http://jsfiddle.net/LsMZp/49/> \**
<http://jsfiddle.net/LsMZp/26/>
the remaining issues here.
* the need to remove nomad nodes - if user's share the same interest - they link as expected - but this l... | I've added this to the code to change the gravity property every 1/2 second. I can see its encouraging some movement - but is it really due to invoking force.start?
<http://jsfiddle.net/LsMZp/7/>
```
var myVar=setInterval(function(){changeGravity()},500);
function changeGravity()
{
var min =... |
511 | The purpose of this question is to get a clear policy about [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions.
There have been instances where reading order questions have been closed because ["there doesn't seem to be any connection... | 2017/02/22 | [
"https://literature.meta.stackexchange.com/questions/511",
"https://literature.meta.stackexchange.com",
"https://literature.meta.stackexchange.com/users/-1/"
] | Reading order questions are a chance for us to offer practical, experience-based advice on how best to approach specific sections of the material this site is about. Obviously they should adhere to [good subjective](https://stackoverflow.blog/2010/09/good-subjective-bad-subjective/), of course, and should support their... | **I think [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") posts should be in-scope if there is reason to assume that there should be an order to read books in.**
The easiest case is obviously where all the books are in the same universe. Howe... |
511 | The purpose of this question is to get a clear policy about [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions.
There have been instances where reading order questions have been closed because ["there doesn't seem to be any connection... | 2017/02/22 | [
"https://literature.meta.stackexchange.com/questions/511",
"https://literature.meta.stackexchange.com",
"https://literature.meta.stackexchange.com/users/-1/"
] | Don't ask for a recommended reading order, ask for things that inform a choice of reading order
===============================================================================================
Let me back up a bit. **Why do people want to ask about reading order in the first place?** In 99% of the cases, you can't poss... | **I think [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") posts should be in-scope if there is reason to assume that there should be an order to read books in.**
The easiest case is obviously where all the books are in the same universe. Howe... |
511 | The purpose of this question is to get a clear policy about [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions.
There have been instances where reading order questions have been closed because ["there doesn't seem to be any connection... | 2017/02/22 | [
"https://literature.meta.stackexchange.com/questions/511",
"https://literature.meta.stackexchange.com",
"https://literature.meta.stackexchange.com/users/-1/"
] | Reading order questions are a chance for us to offer practical, experience-based advice on how best to approach specific sections of the material this site is about. Obviously they should adhere to [good subjective](https://stackoverflow.blog/2010/09/good-subjective-bad-subjective/), of course, and should support their... | I think there are actually two classes of questions that might both be asked as "reading order" questions:
1. Questions about linked series of books (or plays, poems, etc.). These are the types of reading/viewing order questions we're used to seeing on SFF. For these it's clear that there is some factual basis for ans... |
511 | The purpose of this question is to get a clear policy about [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions.
There have been instances where reading order questions have been closed because ["there doesn't seem to be any connection... | 2017/02/22 | [
"https://literature.meta.stackexchange.com/questions/511",
"https://literature.meta.stackexchange.com",
"https://literature.meta.stackexchange.com/users/-1/"
] | Don't ask for a recommended reading order, ask for things that inform a choice of reading order
===============================================================================================
Let me back up a bit. **Why do people want to ask about reading order in the first place?** In 99% of the cases, you can't poss... | I think there are actually two classes of questions that might both be asked as "reading order" questions:
1. Questions about linked series of books (or plays, poems, etc.). These are the types of reading/viewing order questions we're used to seeing on SFF. For these it's clear that there is some factual basis for ans... |
511 | The purpose of this question is to get a clear policy about [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions.
There have been instances where reading order questions have been closed because ["there doesn't seem to be any connection... | 2017/02/22 | [
"https://literature.meta.stackexchange.com/questions/511",
"https://literature.meta.stackexchange.com",
"https://literature.meta.stackexchange.com/users/-1/"
] | Reading order questions are a chance for us to offer practical, experience-based advice on how best to approach specific sections of the material this site is about. Obviously they should adhere to [good subjective](https://stackoverflow.blog/2010/09/good-subjective-bad-subjective/), of course, and should support their... | I would propose:
On-topic requests will ask for an ordering according a well-defined, non-subjective criteria.
---------------------------------------------------------------------------------------------
Here I'm thinking of things like:
* Publication order: "In what order were the *Narnia* books published?"
* Orde... |
511 | The purpose of this question is to get a clear policy about [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions.
There have been instances where reading order questions have been closed because ["there doesn't seem to be any connection... | 2017/02/22 | [
"https://literature.meta.stackexchange.com/questions/511",
"https://literature.meta.stackexchange.com",
"https://literature.meta.stackexchange.com/users/-1/"
] | Don't ask for a recommended reading order, ask for things that inform a choice of reading order
===============================================================================================
Let me back up a bit. **Why do people want to ask about reading order in the first place?** In 99% of the cases, you can't poss... | I would propose:
On-topic requests will ask for an ordering according a well-defined, non-subjective criteria.
---------------------------------------------------------------------------------------------
Here I'm thinking of things like:
* Publication order: "In what order were the *Narnia* books published?"
* Orde... |
511 | The purpose of this question is to get a clear policy about [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions.
There have been instances where reading order questions have been closed because ["there doesn't seem to be any connection... | 2017/02/22 | [
"https://literature.meta.stackexchange.com/questions/511",
"https://literature.meta.stackexchange.com",
"https://literature.meta.stackexchange.com/users/-1/"
] | Reading order questions are a chance for us to offer practical, experience-based advice on how best to approach specific sections of the material this site is about. Obviously they should adhere to [good subjective](https://stackoverflow.blog/2010/09/good-subjective-bad-subjective/), of course, and should support their... | All of them should be on topic.
===============================
Look. Most [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions are by people who *don't know anything about the books*. They want to know how to read them.
Let's take a fe... |
511 | The purpose of this question is to get a clear policy about [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions.
There have been instances where reading order questions have been closed because ["there doesn't seem to be any connection... | 2017/02/22 | [
"https://literature.meta.stackexchange.com/questions/511",
"https://literature.meta.stackexchange.com",
"https://literature.meta.stackexchange.com/users/-1/"
] | Don't ask for a recommended reading order, ask for things that inform a choice of reading order
===============================================================================================
Let me back up a bit. **Why do people want to ask about reading order in the first place?** In 99% of the cases, you can't poss... | All of them should be on topic.
===============================
Look. Most [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions are by people who *don't know anything about the books*. They want to know how to read them.
Let's take a fe... |
511 | The purpose of this question is to get a clear policy about [reading-order](https://literature.stackexchange.com/questions/tagged/reading-order "show questions tagged 'reading-order'") questions.
There have been instances where reading order questions have been closed because ["there doesn't seem to be any connection... | 2017/02/22 | [
"https://literature.meta.stackexchange.com/questions/511",
"https://literature.meta.stackexchange.com",
"https://literature.meta.stackexchange.com/users/-1/"
] | Don't ask for a recommended reading order, ask for things that inform a choice of reading order
===============================================================================================
Let me back up a bit. **Why do people want to ask about reading order in the first place?** In 99% of the cases, you can't poss... | Reading order questions are a chance for us to offer practical, experience-based advice on how best to approach specific sections of the material this site is about. Obviously they should adhere to [good subjective](https://stackoverflow.blog/2010/09/good-subjective-bad-subjective/), of course, and should support their... |
13,704,796 | I have js function which is trying to set XMLDoc object and also setting one of the global parameter (modelingDiagram).
While trying to get elements by tag name, it is returning always empty list (but not in firefox).
During debugging I come to know that it is returning empty list for any tag that I try in watch area... | 2012/12/04 | [
"https://Stackoverflow.com/questions/13704796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1875858/"
] | Vertical [margins collapse](http://www.w3.org/TR/CSS21/box.html#collapsing-margins) into each other (according to some fairly complex rules which you can find at the other end of that link), so the inner margin-top occupies the bottom half of the outer margin-top. | I think this is about margin collapsing. <http://reference.sitepoint.com/css/collapsingmargins> has information about this.
Here is a workaround/solution of this.
```
<div id="outer">
<div id="inner">
Text
</div>
</div>
```
|
205,505 | There are a lot of variants of the CSV "standard" (or lack thereof). I've never personally see any that use an escape character (like `\`) instead of surrounding each field with double quotes. Instead of `foo,bar,"foo,bar"` it would be `foo,bar,foo\,bar`.
This would be handy for situations where a file needs to manua... | 2013/07/20 | [
"https://softwareengineering.stackexchange.com/questions/205505",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/9830/"
] | Your question includes the answer, when you wrote "I don't see how it would make a difference from a parsing perspective, though"
There is no compelling reason, it just is. Csv is a data format, so the main goal is to be parseable. | Chicken and egg.
If I was defining a spec, I'd escape for the reasons that you state. But any CSV parsing tool that you encounter (including Excel, sqloader, etc) is almost certain to use quoting, not escaping. So if you want to produce it, you need to produce it quoted. If you want to consume it, it is safe to assume... |
10,961,421 | I'm trying to understand a matlab code, but I'm not familiar with matlab much. Can someone please tell me what the meaning of x = [ x[i] ] is?
Thanks in advance. | 2012/06/09 | [
"https://Stackoverflow.com/questions/10961421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/805563/"
] | Jürgen Thelen is correct in his comment - it looks as though you are using a 3rd party extension - most likely this one from Ahead Works: <http://ecommerce.aheadworks.com/magento-extensions/help-desk-ultimate.html> - so you may want to ask them to fix the issue. Or if you do resolve it then maybe feed the fix back to t... | ```
grep -r "clearInterval(window.HDUSeedIntId)" *
```
If that doesn't work you can use
```
echo "<larger part of script>"
read var_name
grep -r $var_name *
``` |
39,353,704 | Can any one tell me how I can get the output of a dropdown to be more than one line?
I have an array that has a list of names and against each name a list of there children for example
I want users to be able to through the drop down list select a name and then it displays a list of there children
```html
<fo... | 2016/09/06 | [
"https://Stackoverflow.com/questions/39353704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726150/"
] | You should probably change your `input` to a `textarea` as text inputs are inherently 1 line. Also your option values have to be a single value, so you can do something like the following where I've put your `Link1` and `Link2` in the value for Description 1 and separated them with ` ` Line Feed and ` ` Carriag... | You could use a dropdown in a dropdown in bootstrap.
[here](http://bootsnipp.com/snippets/featured/multi-level-dropdown-menu-bs3) is a link to a post where the author does the same thing.
It's basicly a list in a list, you no longer use select options.
Make sure you have bootstrap imported in your HTML and it sho... |
3,329 | I have a Drupal multisite website, with Apache Solr Search Integration, which is up and running very well in the live server. I am trying to replicate the same website, on another server to use it as a development environment. I have copied all the code and replicated the DB and changed the settings.php file accordingl... | 2011/05/09 | [
"https://drupal.stackexchange.com/questions/3329",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/-1/"
] | You can use [`hook_form_alter`](http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_form_alter/7) to alter the form elements and add custom markup by adding markup form elements. It's also possible to set which theme function to use which could be your own custom theme function.
See the [FAP... | Here is the exact function:
@see [hook\_form\_FORM\_ID\_alter](http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_form_FORM_ID_alter/7)
```
function hook_form_user_login_alter(&$form, &$form_state, $form_id) {
// Modification for the form with the given BASE_FORM_ID goes here. For
// e... |
3,329 | I have a Drupal multisite website, with Apache Solr Search Integration, which is up and running very well in the live server. I am trying to replicate the same website, on another server to use it as a development environment. I have copied all the code and replicated the DB and changed the settings.php file accordingl... | 2011/05/09 | [
"https://drupal.stackexchange.com/questions/3329",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/-1/"
] | It turns out that I need a combination of changes:
I had to implement `hook_form_alter()`in a module and set the form's `#theme` property:
```
function mymodule_form_user_register_form_alter(&$form, &$form_state, $form_id) {
$form['#theme'] = 'user_register';
}
```
And then in template.php:
```
function mytheme_... | You can use [`hook_form_alter`](http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_form_alter/7) to alter the form elements and add custom markup by adding markup form elements. It's also possible to set which theme function to use which could be your own custom theme function.
See the [FAP... |
3,329 | I have a Drupal multisite website, with Apache Solr Search Integration, which is up and running very well in the live server. I am trying to replicate the same website, on another server to use it as a development environment. I have copied all the code and replicated the DB and changed the settings.php file accordingl... | 2011/05/09 | [
"https://drupal.stackexchange.com/questions/3329",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/-1/"
] | The definition of the theme function given from the implementation of [hook\_theme()](http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_theme/7) is wrong:
* In Drupal 7, the array index "arguments" is not used anymore; you should use "render element" (as in this case), or "variables."
* Th... | Here is the exact function:
@see [hook\_form\_FORM\_ID\_alter](http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_form_FORM_ID_alter/7)
```
function hook_form_user_login_alter(&$form, &$form_state, $form_id) {
// Modification for the form with the given BASE_FORM_ID goes here. For
// e... |
3,329 | I have a Drupal multisite website, with Apache Solr Search Integration, which is up and running very well in the live server. I am trying to replicate the same website, on another server to use it as a development environment. I have copied all the code and replicated the DB and changed the settings.php file accordingl... | 2011/05/09 | [
"https://drupal.stackexchange.com/questions/3329",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/-1/"
] | It turns out that I need a combination of changes:
I had to implement `hook_form_alter()`in a module and set the form's `#theme` property:
```
function mymodule_form_user_register_form_alter(&$form, &$form_state, $form_id) {
$form['#theme'] = 'user_register';
}
```
And then in template.php:
```
function mytheme_... | The definition of the theme function given from the implementation of [hook\_theme()](http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_theme/7) is wrong:
* In Drupal 7, the array index "arguments" is not used anymore; you should use "render element" (as in this case), or "variables."
* Th... |
3,329 | I have a Drupal multisite website, with Apache Solr Search Integration, which is up and running very well in the live server. I am trying to replicate the same website, on another server to use it as a development environment. I have copied all the code and replicated the DB and changed the settings.php file accordingl... | 2011/05/09 | [
"https://drupal.stackexchange.com/questions/3329",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/-1/"
] | It turns out that I need a combination of changes:
I had to implement `hook_form_alter()`in a module and set the form's `#theme` property:
```
function mymodule_form_user_register_form_alter(&$form, &$form_state, $form_id) {
$form['#theme'] = 'user_register';
}
```
And then in template.php:
```
function mytheme_... | Here is the exact function:
@see [hook\_form\_FORM\_ID\_alter](http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_form_FORM_ID_alter/7)
```
function hook_form_user_login_alter(&$form, &$form_state, $form_id) {
// Modification for the form with the given BASE_FORM_ID goes here. For
// e... |
3,329 | I have a Drupal multisite website, with Apache Solr Search Integration, which is up and running very well in the live server. I am trying to replicate the same website, on another server to use it as a development environment. I have copied all the code and replicated the DB and changed the settings.php file accordingl... | 2011/05/09 | [
"https://drupal.stackexchange.com/questions/3329",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/-1/"
] | I think this is possible without having to do any modules. There is a built-in theme suggestion for the user registration page and it is page--user--register.tpl.php | Here is the exact function:
@see [hook\_form\_FORM\_ID\_alter](http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_form_FORM_ID_alter/7)
```
function hook_form_user_login_alter(&$form, &$form_state, $form_id) {
// Modification for the form with the given BASE_FORM_ID goes here. For
// e... |
3,329 | I have a Drupal multisite website, with Apache Solr Search Integration, which is up and running very well in the live server. I am trying to replicate the same website, on another server to use it as a development environment. I have copied all the code and replicated the DB and changed the settings.php file accordingl... | 2011/05/09 | [
"https://drupal.stackexchange.com/questions/3329",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/-1/"
] | It turns out that I need a combination of changes:
I had to implement `hook_form_alter()`in a module and set the form's `#theme` property:
```
function mymodule_form_user_register_form_alter(&$form, &$form_state, $form_id) {
$form['#theme'] = 'user_register';
}
```
And then in template.php:
```
function mytheme_... | I think this is possible without having to do any modules. There is a built-in theme suggestion for the user registration page and it is page--user--register.tpl.php |
6,407,837 | I am getting problem while concatenating strings.I think this is the stupid question,but i didn't get answer.Thats why i am posting here.Please Help me.
The source code is
```
unsigned char arr_25[] = "{\"category\":\"",
arr_10[]="FMCG",
arr_26[]="\"amount\":",
arr_11[]="\",",
arr_12[]="1000",
arr... | 2011/06/20 | [
"https://Stackoverflow.com/questions/6407837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/774345/"
] | I don't know if it's the direct reason, but you are certainly overrunning `arr_12`. You've defined it with size 5 and then you write "1500.00" into it. | you're probably overrunning some variables (arr\_12?). Change sprintf with snprintf and you shouldn't have problems. |
3,574,114 | I am using the following code for the Share Price Application I have been developing (with plenty of help from people here that is greatly appreciated!). One of the things it should do is allow the user to pick a company to analyse from stored XML Files, I have been using the following code to do this:
```
df <- xmlTo... | 2010/08/26 | [
"https://Stackoverflow.com/questions/3574114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386448/"
] | `select.list` allow you to select from a list. Check also `menu`.
Examples:
Using `menu`
```
companies <- c("AAA","BBB","CCC")
links <- c("c:/file1","c:/secret/file3","c:/file3")
i <- menu(companies, graphics=TRUE, title="Choose company")
df <- xmlToDataFrame(links[i])
```
Using `select.list`
```
companies <- c(... | If you don't want to get into `tcltk` programming, try the `gWidgets` packages.
```
library(gWidgetstcltk) # or library(gWidgetsRGtk2), etc.
drp <- gdroplist(c("AAA", "BBB", "CCC"), container = gwindow())
``` |
59,591,839 | I have table, as below and its contains customer electricity volume for the period as. Available data like
```
OwnerID StartDate EndDate Volume
---------------------------------------
1 2019-01-01 2019-01-15 10.40
1 2019-01-16 2019-01-31 5.80
1 2019-02-01 2019-02-10 7.90
1 2019-0... | 2020/01/04 | [
"https://Stackoverflow.com/questions/59591839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12652292/"
] | The example below uses a cumulative sum and a few CTE's to calculate those 2 columns.
**Sample data:**
>
>
> ```
> create table yourtable
> (
> Id int identity(1,1) primary key,
> OwnerID int not null,
> StartDate date not null,
> EndDate date not null,
> Volume decimal(16,2) not null
> );
>
> insert ... | When requirement is absolutely clear then you can think of better solution i.e. `Set Based Approach`
When requirement is not so clear then you think of solution like `RBAR`.
Suppose I was to calculate the output in Excel then what formula I will apply ?
There have to have some formula but requirement is not clear.
... |
30,183,588 | I have created radio and check box buttons programmatically according to my web service response, where number of buttons varies.
Following is the code to create those buttons:
```
for(int j = 0; j < nintOptionCount; j++)
{
UILabel * lblOption = [[UILabel alloc] initWithFrame: CGRectMake(50, yLabel, 250... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30183588",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2734934/"
] | You could use double quotes as delimiter.
```
echo 'hello/bar/goo' | awk '{gsub("/","foo"); print}'
```
But careful when dealing with the backslash, since you need to use four backslashes in-order to match a single backslash.
```
$ echo 'hello/bar\goo' | awk '{gsub("\\\\","foo"); print}'
hello/barfoogoo
``` | Only delimiter for regex in `awk` is `/`, but you can as Avinash showed, search for a string `"something"`. No other option possible. |
19,352 | I am on raspbian on a raspberry Pi model 2.
I can't import the keys for the Tor repository. I tried the two following commands:
```
$ gpg2 --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
gpg: keyserver receive failed: No data
```
And:
```
$ gpg --keyserver hkp://pool.sks-keyservers.net --recv A3C4F0F979CAA22CDBA8F5... | 2019/02/03 | [
"https://tor.stackexchange.com/questions/19352",
"https://tor.stackexchange.com",
"https://tor.stackexchange.com/users/25183/"
] | Grab the latest build of Tor project from their download page for linux. I just did it and was 8.5.1.
Make sure you are in the same directory you downloaded the Tor project in to. In my case I downloaded it to `~/Downloads`
`cd ~/Downloads`
Add the keyserver
`gpg --keyserver pool.sks-keyservers.net --recv-keys 0x4E... | I haven't had much luck with getting this key using gpg2. Try:
```
# wget https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc
# apt-key add <A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc
``` |
21,436,411 | I have a listview in which I have to load different objects with text and standard image;but in the arraylist that I give to the listview there are some objects that have to be load with a different "row.xml". I don't know if I'm explained, probably the code will clarify all:
this is my adapter
```
/**
*
*/
i... | 2014/01/29 | [
"https://Stackoverflow.com/questions/21436411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2306946/"
] | You want to reference this article by Google: <http://developer.android.com/training/improving-layouts/smooth-scrolling.html>
Particularly, you should be using a ViewHolder, so the items are created only once and then re-used. You'll see performance greatly improve. | Dont initialise that Typephase in custom adapter, instead of that pass it as an argument from the previous class. Problem solved for me doing same. |
34,234 | How do I transfer photos and videos between iPad and iPad 2? | 2011/12/20 | [
"https://apple.stackexchange.com/questions/34234",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/15309/"
] | This depends, do you have iCloud? as you can sync through iCloud.
You can also configure all the settings in iTunes. So you can import all the images into iTunes, once they are there you can connect the other iPad and sync them.
If you do not want to keep the iPad 1, you can just connect it to iTunes, sync it and th... | The original question doesn't have enough detail to really offer a solution here. But to clarify previous answers, the fastest way to transfer photos and videos between an iPad and an iPad 2 would be to sync to a single installation of iTunes/iPhoto/Aperture.
A slower but simpler way would be to run Dropbox on the iP... |
34,234 | How do I transfer photos and videos between iPad and iPad 2? | 2011/12/20 | [
"https://apple.stackexchange.com/questions/34234",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/15309/"
] | This depends, do you have iCloud? as you can sync through iCloud.
You can also configure all the settings in iTunes. So you can import all the images into iTunes, once they are there you can connect the other iPad and sync them.
If you do not want to keep the iPad 1, you can just connect it to iTunes, sync it and th... | Use an iPad Transfer software such as [iPad-to-iPad](http://www.aiseesoft.com/ipad-transfer.html) to transfer videos, music, photos and file folders from iPad to iPad for backup or sharing with your friends.
This software comes in two versions, a Standard version for $29 USD and a Platinum version for $45 USD, unfort... |
34,234 | How do I transfer photos and videos between iPad and iPad 2? | 2011/12/20 | [
"https://apple.stackexchange.com/questions/34234",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/15309/"
] | This depends, do you have iCloud? as you can sync through iCloud.
You can also configure all the settings in iTunes. So you can import all the images into iTunes, once they are there you can connect the other iPad and sync them.
If you do not want to keep the iPad 1, you can just connect it to iTunes, sync it and th... | No additional computer or "Cloud" necessary!
<http://www.youtube.com/watch?v=6ofUkg9Eb8s>
works brilliantly if you have a Camera Connection Kit (non-Apple one may even do)
You may need to reset the target iPad (press Home & Power button) to get it to highlight "import".
Remember that your charging lead goes from th... |
34,234 | How do I transfer photos and videos between iPad and iPad 2? | 2011/12/20 | [
"https://apple.stackexchange.com/questions/34234",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/15309/"
] | The original question doesn't have enough detail to really offer a solution here. But to clarify previous answers, the fastest way to transfer photos and videos between an iPad and an iPad 2 would be to sync to a single installation of iTunes/iPhoto/Aperture.
A slower but simpler way would be to run Dropbox on the iP... | Use an iPad Transfer software such as [iPad-to-iPad](http://www.aiseesoft.com/ipad-transfer.html) to transfer videos, music, photos and file folders from iPad to iPad for backup or sharing with your friends.
This software comes in two versions, a Standard version for $29 USD and a Platinum version for $45 USD, unfort... |
34,234 | How do I transfer photos and videos between iPad and iPad 2? | 2011/12/20 | [
"https://apple.stackexchange.com/questions/34234",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/15309/"
] | The original question doesn't have enough detail to really offer a solution here. But to clarify previous answers, the fastest way to transfer photos and videos between an iPad and an iPad 2 would be to sync to a single installation of iTunes/iPhoto/Aperture.
A slower but simpler way would be to run Dropbox on the iP... | No additional computer or "Cloud" necessary!
<http://www.youtube.com/watch?v=6ofUkg9Eb8s>
works brilliantly if you have a Camera Connection Kit (non-Apple one may even do)
You may need to reset the target iPad (press Home & Power button) to get it to highlight "import".
Remember that your charging lead goes from th... |
51,916 | I briefly enabled updates from jaunty-proposed to see if there was an updated for a particular package that was causing me issues. There was a couple of updates for other packages which I installed and now I'm having issues with my ethernet. But I can't remember which proposed packages I installed.
How can I find out... | 2009/08/09 | [
"https://serverfault.com/questions/51916",
"https://serverfault.com",
"https://serverfault.com/users/16034/"
] | Aptitude has an incredibly rich set of [search patterns](http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch02s03s05.html). In your case, you'll want `~i` (for "installed") and `~A<archive>`, like so:
```
aptitude search '~i ~Ajaunty-proposed'
```
As an example, I have a few packages installed from 'hard... | There's various things you can try with `apt-cache policy` that could help -- going through all the packages on your system and looking at the policy to work out where the "currently installed" version is from (scripted, of course, because doing that by hand would be insane) would give you a pretty exhaustive list. Alt... |
51,916 | I briefly enabled updates from jaunty-proposed to see if there was an updated for a particular package that was causing me issues. There was a couple of updates for other packages which I installed and now I'm having issues with my ethernet. But I can't remember which proposed packages I installed.
How can I find out... | 2009/08/09 | [
"https://serverfault.com/questions/51916",
"https://serverfault.com",
"https://serverfault.com/users/16034/"
] | Aptitude has an incredibly rich set of [search patterns](http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch02s03s05.html). In your case, you'll want `~i` (for "installed") and `~A<archive>`, like so:
```
aptitude search '~i ~Ajaunty-proposed'
```
As an example, I have a few packages installed from 'hard... | There should be a record in /var/log/apt or /var/log/dpkg (you may need to double check the names; I think the apt one is a directory and the dpkg one is close to the name of the logfile) that lists what packages and actions were taken and from that you should be able to figure out what happened. |
544,868 | D = { mn/(1+m+n) } for m,n natural numbers.
To simplify the expression, I presumed m=n, which means:
D = { n^2 / (2n + 1) }
Now, I know by intuition **there is no supremum**, for this series convergencing to infinity, but I couldn't find a formal way to prove it.
I thought about proving by contradiction:
- ass... | 2013/10/29 | [
"https://math.stackexchange.com/questions/544868",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/102164/"
] | Hint: we can set $n = k$, $m = k-1$ to get
$$
\frac{mn}{1+m+n}=
\frac{k(k-1)}{1 + k + k-1} = \frac{k(k-1)}{2k} = \frac{k-1}{2}
$$
Thus, $\frac{k-1}{2}\in D$ for every $k\geq 2$.
So, if $D$ has a supremum, then the supremum of $D$ is bigger than $\frac{k-1}{2}$ for every integer $k$. Why does this result in a contradic... | **Hint**: Try rewriting the fraction by doing division. If you are working in the reals, the least-upper-bound property tells you that any set with an upper bound has a supremum, so if you want to show the set has no supremum, you should be showing it has no upper bound. |
544,868 | D = { mn/(1+m+n) } for m,n natural numbers.
To simplify the expression, I presumed m=n, which means:
D = { n^2 / (2n + 1) }
Now, I know by intuition **there is no supremum**, for this series convergencing to infinity, but I couldn't find a formal way to prove it.
I thought about proving by contradiction:
- ass... | 2013/10/29 | [
"https://math.stackexchange.com/questions/544868",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/102164/"
] | **Hint**: Try rewriting the fraction by doing division. If you are working in the reals, the least-upper-bound property tells you that any set with an upper bound has a supremum, so if you want to show the set has no supremum, you should be showing it has no upper bound. | **Hint:**
$$\frac{n^2}{2n+1} \ge \frac{n^2}{3n} =n/3$$ |
544,868 | D = { mn/(1+m+n) } for m,n natural numbers.
To simplify the expression, I presumed m=n, which means:
D = { n^2 / (2n + 1) }
Now, I know by intuition **there is no supremum**, for this series convergencing to infinity, but I couldn't find a formal way to prove it.
I thought about proving by contradiction:
- ass... | 2013/10/29 | [
"https://math.stackexchange.com/questions/544868",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/102164/"
] | Hint: we can set $n = k$, $m = k-1$ to get
$$
\frac{mn}{1+m+n}=
\frac{k(k-1)}{1 + k + k-1} = \frac{k(k-1)}{2k} = \frac{k-1}{2}
$$
Thus, $\frac{k-1}{2}\in D$ for every $k\geq 2$.
So, if $D$ has a supremum, then the supremum of $D$ is bigger than $\frac{k-1}{2}$ for every integer $k$. Why does this result in a contradic... | **Hint:**
$$\frac{n^2}{2n+1} \ge \frac{n^2}{3n} =n/3$$ |
66,182,075 | My main task is to extract all text in `p` tag in `body` tag in the following XML file named "sample.xml":
```xml
<?xml version="1.0" encoding="UTF-8"?>
<newsItem >
<itemMeta>
<itemClass qcode="ninat:text"/>
<versionCreated>2018-01-16T12:05:19</versionCreated>
<pubStatus qcode="stat:usable"/>
<edNote role="sttnote:pri... | 2021/02/13 | [
"https://Stackoverflow.com/questions/66182075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6829544/"
] | You can get the number by iterating over the list patt and then acess each phone key in patt's items and use the == operator to compare with the phone number you are loooking for. The function below does the job.
```
def answer(search):
for data in patt: # iterate over each item in patt
if data["Phone"] ==... | Below should work. For every item, check if 'phone' key has value matching x. IF yes, then return the value of 'name' key.
```
x = input("Enter Phone")
for item in Patt:
if item["Phone"] == x:
print(item["Name"])
``` |
66,182,075 | My main task is to extract all text in `p` tag in `body` tag in the following XML file named "sample.xml":
```xml
<?xml version="1.0" encoding="UTF-8"?>
<newsItem >
<itemMeta>
<itemClass qcode="ninat:text"/>
<versionCreated>2018-01-16T12:05:19</versionCreated>
<pubStatus qcode="stat:usable"/>
<edNote role="sttnote:pri... | 2021/02/13 | [
"https://Stackoverflow.com/questions/66182075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6829544/"
] | You can get the number by iterating over the list patt and then acess each phone key in patt's items and use the == operator to compare with the phone number you are loooking for. The function below does the job.
```
def answer(search):
for data in patt: # iterate over each item in patt
if data["Phone"] ==... | while preparing answer, I did not notice that one correct answer was already posted and accepted. Though, posting my version of the answer below with added feature of continuous questioning and an ability to exit from the program.
```
Patt = [
{'Phone': "0718604545", 'Name': "Tom", 'Age': '2007'},
{'Phone': "0... |
1,929,094 | So i have a gui, designed using QT, c++. I have large amount of data in a text file that I would like to read in this fashion:
load first 50 lines, when the user scrolls down load next 50 lines and so one. When the user scrolls up load previous 50 lines.
Thank you. | 2009/12/18 | [
"https://Stackoverflow.com/questions/1929094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/202040/"
] | The easiest solution would be to load the file into memory and manipulate it from there:
```
std::vector<std::string> lines;
std::string line;
while(std::getline(file,line)
{
lines.push_back(line);
}
```
If the file is way to large.
Then you need to build an index of the file that tells you exactly where... | Connect your app to the [sliderMoved](http://doc.trolltech.com/3.3/qslider.html#sliderMoved) or [sliderReleased](http://doc.trolltech.com/3.3/qslider.html#sliderReleased) signals of your [`QSlider`](http://doc.trolltech.com/3.3/qslider.html) and read the 50 lines you want to display. Or use the [valueChange](http://doc... |
1,929,094 | So i have a gui, designed using QT, c++. I have large amount of data in a text file that I would like to read in this fashion:
load first 50 lines, when the user scrolls down load next 50 lines and so one. When the user scrolls up load previous 50 lines.
Thank you. | 2009/12/18 | [
"https://Stackoverflow.com/questions/1929094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/202040/"
] | Connect your app to the [sliderMoved](http://doc.trolltech.com/3.3/qslider.html#sliderMoved) or [sliderReleased](http://doc.trolltech.com/3.3/qslider.html#sliderReleased) signals of your [`QSlider`](http://doc.trolltech.com/3.3/qslider.html) and read the 50 lines you want to display. Or use the [valueChange](http://doc... | I am guessing that this file may be huge (say in the Gigabyte range).
Assuming that portability is not an issue, you may want to use memory mapped io. On many unix systems you have the [mmap command](http://linux.about.com/library/cmd/blcmdl2_mmap.htm).
A nice tutorial can be found [here](http://www.linuxquestions.o... |
1,929,094 | So i have a gui, designed using QT, c++. I have large amount of data in a text file that I would like to read in this fashion:
load first 50 lines, when the user scrolls down load next 50 lines and so one. When the user scrolls up load previous 50 lines.
Thank you. | 2009/12/18 | [
"https://Stackoverflow.com/questions/1929094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/202040/"
] | The easiest solution would be to load the file into memory and manipulate it from there:
```
std::vector<std::string> lines;
std::string line;
while(std::getline(file,line)
{
lines.push_back(line);
}
```
If the file is way to large.
Then you need to build an index of the file that tells you exactly where... | I am guessing that this file may be huge (say in the Gigabyte range).
Assuming that portability is not an issue, you may want to use memory mapped io. On many unix systems you have the [mmap command](http://linux.about.com/library/cmd/blcmdl2_mmap.htm).
A nice tutorial can be found [here](http://www.linuxquestions.o... |
262,372 | By default, in Windows, when you right-click a window title bar and select "move", it will allow you to move the window using the arrow keys. The thing is, Windows are moved several pixels each time you press an arrow key.
So, can this be set to move the window 1 pixel each time?
Also, are there any 3rd party progra... | 2011/03/25 | [
"https://superuser.com/questions/262372",
"https://superuser.com",
"https://superuser.com/users/38280/"
] | Hold down the `Ctrl` key while pressing the arrows for single-pixel control. You can press and release during the move (or resize) as needed to switch between jumping and single pixel. | Thanks a lot, great answer, though more specifically, for English language Windows 7 shell layout on Window's windows that are **NOT** "Maximized"/"in full screen mode":
`ALT`+`SPACE`->`M`->`CTRL`+`ARROW KEYS`->`ENTER`
Example: to move a window some pixels to the right: Press `ALT` and `SPACE` together. Press `M`. Pre... |
43,275,308 | I have the following error:
>
> 412 no matching index found. recommended index is:
> - kind: monthly\_report
> properties:
> - name: belongs\_to
> - name: date\_added
>
>
>
>
I am using Python 3.5, the datastore, and a remote Django project which is accessing the datastore through google-cloud API... | 2017/04/07 | [
"https://Stackoverflow.com/questions/43275308",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4615170/"
] | You have to create an object of S3. And keys you have put is misplaced please do it as following.
```
$s3 = S3Client::factory([
'version' => 'latest',
'region' => 'eu-west-1',
'credentials' => [
'key' => "your s3 bucket key",
... | For `SES AWS SDK v3` use
```
/*
* 1. version as `2010-12-01`
* 2. version as Eg. `us-east-1`.
*/
ini_set("display_errors", 1);
Aws\Ses\SesClient::factory(array(
'credentials' => array(
'key' => "someKey",
'secret' => "someSecret",
),
"region" => "us-east-1",
"ver... |
19,380,928 | I'm building django application and i encounter som import problems. My file structure:
```
project/
my_app/
models/
__init__.py
Article.py
StockMovementProduct.py
tools/
__init__.py
Synchronizer.py
```
**project/my\_app/models/\_*init*\_.py**:
```
from Article import *
from ... | 2013/10/15 | [
"https://Stackoverflow.com/questions/19380928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/801924/"
] | Try
```
grep -f the_ids.txt huge.csv
```
Additionally, since your patterns seem to be fixed strings, supplying the `-F` option might speed up `grep`.
```
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings, separated by
newlines, any of which is to be matched. (-F is sp... | Use `grep -f` for this:
```
grep -f the_ids.txt huge.csv > output_file
```
From `man grep`:
>
> -f FILE, --file=FILE
>
>
> Obtain patterns from FILE, one per line. The empty file contains zero
> patterns, and therefore matches nothing. (-f is specified by POSIX.)
>
>
>
If you provide some sample input maybe... |
19,380,928 | I'm building django application and i encounter som import problems. My file structure:
```
project/
my_app/
models/
__init__.py
Article.py
StockMovementProduct.py
tools/
__init__.py
Synchronizer.py
```
**project/my\_app/models/\_*init*\_.py**:
```
from Article import *
from ... | 2013/10/15 | [
"https://Stackoverflow.com/questions/19380928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/801924/"
] | Use `grep -f` for this:
```
grep -f the_ids.txt huge.csv > output_file
```
From `man grep`:
>
> -f FILE, --file=FILE
>
>
> Obtain patterns from FILE, one per line. The empty file contains zero
> patterns, and therefore matches nothing. (-f is specified by POSIX.)
>
>
>
If you provide some sample input maybe... | `grep -f filter.txt data.txt` gets unruly when `filter.txt` is larger than a couple of thousands of lines and hence isn't the best choice for such a situation. Even while using `grep -f`, we need to keep a few things in mind:
* use `-x` option if there is a need to match the entire line in the second file
* use `-F` i... |
19,380,928 | I'm building django application and i encounter som import problems. My file structure:
```
project/
my_app/
models/
__init__.py
Article.py
StockMovementProduct.py
tools/
__init__.py
Synchronizer.py
```
**project/my\_app/models/\_*init*\_.py**:
```
from Article import *
from ... | 2013/10/15 | [
"https://Stackoverflow.com/questions/19380928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/801924/"
] | Use `grep -f` for this:
```
grep -f the_ids.txt huge.csv > output_file
```
From `man grep`:
>
> -f FILE, --file=FILE
>
>
> Obtain patterns from FILE, one per line. The empty file contains zero
> patterns, and therefore matches nothing. (-f is specified by POSIX.)
>
>
>
If you provide some sample input maybe... | You may get a significant search speedup with [ugrep](https://github.com/Genivia/ugrep) to match the strings in `the_ids.txt` in your large `huge.csv` file:
```
ugrep -F -f the_ids.txt huge.csv
```
This works with GNU grep too, but I expect ugrep to run several times faster. |
19,380,928 | I'm building django application and i encounter som import problems. My file structure:
```
project/
my_app/
models/
__init__.py
Article.py
StockMovementProduct.py
tools/
__init__.py
Synchronizer.py
```
**project/my\_app/models/\_*init*\_.py**:
```
from Article import *
from ... | 2013/10/15 | [
"https://Stackoverflow.com/questions/19380928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/801924/"
] | Try
```
grep -f the_ids.txt huge.csv
```
Additionally, since your patterns seem to be fixed strings, supplying the `-F` option might speed up `grep`.
```
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings, separated by
newlines, any of which is to be matched. (-F is sp... | `grep -f filter.txt data.txt` gets unruly when `filter.txt` is larger than a couple of thousands of lines and hence isn't the best choice for such a situation. Even while using `grep -f`, we need to keep a few things in mind:
* use `-x` option if there is a need to match the entire line in the second file
* use `-F` i... |
19,380,928 | I'm building django application and i encounter som import problems. My file structure:
```
project/
my_app/
models/
__init__.py
Article.py
StockMovementProduct.py
tools/
__init__.py
Synchronizer.py
```
**project/my\_app/models/\_*init*\_.py**:
```
from Article import *
from ... | 2013/10/15 | [
"https://Stackoverflow.com/questions/19380928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/801924/"
] | Try
```
grep -f the_ids.txt huge.csv
```
Additionally, since your patterns seem to be fixed strings, supplying the `-F` option might speed up `grep`.
```
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings, separated by
newlines, any of which is to be matched. (-F is sp... | You may get a significant search speedup with [ugrep](https://github.com/Genivia/ugrep) to match the strings in `the_ids.txt` in your large `huge.csv` file:
```
ugrep -F -f the_ids.txt huge.csv
```
This works with GNU grep too, but I expect ugrep to run several times faster. |
19,380,928 | I'm building django application and i encounter som import problems. My file structure:
```
project/
my_app/
models/
__init__.py
Article.py
StockMovementProduct.py
tools/
__init__.py
Synchronizer.py
```
**project/my\_app/models/\_*init*\_.py**:
```
from Article import *
from ... | 2013/10/15 | [
"https://Stackoverflow.com/questions/19380928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/801924/"
] | `grep -f filter.txt data.txt` gets unruly when `filter.txt` is larger than a couple of thousands of lines and hence isn't the best choice for such a situation. Even while using `grep -f`, we need to keep a few things in mind:
* use `-x` option if there is a need to match the entire line in the second file
* use `-F` i... | You may get a significant search speedup with [ugrep](https://github.com/Genivia/ugrep) to match the strings in `the_ids.txt` in your large `huge.csv` file:
```
ugrep -F -f the_ids.txt huge.csv
```
This works with GNU grep too, but I expect ugrep to run several times faster. |
17,701,614 | i am new to titanium development.i am developing ToDo application using Titanium for learning purpose.i able to display the data from database and generate tableViewRow successfully but i am stuck in one phase that i unable to display button in each row.i did R&D for it but i cant get solution.here is my code for displ... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17701614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1548671/"
] | You reference a folder on the classpath and expect it to load all jars in it. That is not how the classpath works, you need to reference specific jars (and normally you should **NOT** put third party jars inside the JDK folder).
It is also important to know that the `CLASSPATH` is usually ignored by java applications... | Putting a directory on the classpath doesn't put all the jar files within that directory on the classpath. It's not clear why you've copied the Oracle jar file into your Java installation directory - I'd recommend *not* doing that - but you should just list the location explicitly. For example, if you've copied it into... |
17,701,614 | i am new to titanium development.i am developing ToDo application using Titanium for learning purpose.i able to display the data from database and generate tableViewRow successfully but i am stuck in one phase that i unable to display button in each row.i did R&D for it but i cant get solution.here is my code for displ... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17701614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1548671/"
] | Putting a directory on the classpath doesn't put all the jar files within that directory on the classpath. It's not clear why you've copied the Oracle jar file into your Java installation directory - I'd recommend *not* doing that - but you should just list the location explicitly. For example, if you've copied it into... | I also had same problem and this is what i did
I extracted ojdbc5.jar and then i copied oracle folder in extracted ojdbc5.jar and then pasted in current location where i wrote jdbc program ( not mentioning the directory as it differs from programmer to programmer), then used import oracle.jdbc.\*; statement in my jdbc ... |
17,701,614 | i am new to titanium development.i am developing ToDo application using Titanium for learning purpose.i able to display the data from database and generate tableViewRow successfully but i am stuck in one phase that i unable to display button in each row.i did R&D for it but i cant get solution.here is my code for displ... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17701614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1548671/"
] | Putting a directory on the classpath doesn't put all the jar files within that directory on the classpath. It's not clear why you've copied the Oracle jar file into your Java installation directory - I'd recommend *not* doing that - but you should just list the location explicitly. For example, if you've copied it into... | Before copying `ojdbc6.jar` to `<jdk-home>/jre/lib/ext/`, in IDEA you need to add the `ojdbc6.jar` file in "Structure" -> "SDK" -> "add classpath" to `<jdk-home>/jre/lib/ext/ojdbc6.jar` |
17,701,614 | i am new to titanium development.i am developing ToDo application using Titanium for learning purpose.i able to display the data from database and generate tableViewRow successfully but i am stuck in one phase that i unable to display button in each row.i did R&D for it but i cant get solution.here is my code for displ... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17701614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1548671/"
] | You reference a folder on the classpath and expect it to load all jars in it. That is not how the classpath works, you need to reference specific jars (and normally you should **NOT** put third party jars inside the JDK folder).
It is also important to know that the `CLASSPATH` is usually ignored by java applications... | I also had same problem and this is what i did
I extracted ojdbc5.jar and then i copied oracle folder in extracted ojdbc5.jar and then pasted in current location where i wrote jdbc program ( not mentioning the directory as it differs from programmer to programmer), then used import oracle.jdbc.\*; statement in my jdbc ... |
17,701,614 | i am new to titanium development.i am developing ToDo application using Titanium for learning purpose.i able to display the data from database and generate tableViewRow successfully but i am stuck in one phase that i unable to display button in each row.i did R&D for it but i cant get solution.here is my code for displ... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17701614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1548671/"
] | You reference a folder on the classpath and expect it to load all jars in it. That is not how the classpath works, you need to reference specific jars (and normally you should **NOT** put third party jars inside the JDK folder).
It is also important to know that the `CLASSPATH` is usually ignored by java applications... | Before copying `ojdbc6.jar` to `<jdk-home>/jre/lib/ext/`, in IDEA you need to add the `ojdbc6.jar` file in "Structure" -> "SDK" -> "add classpath" to `<jdk-home>/jre/lib/ext/ojdbc6.jar` |
115,607 | When I run the following **hasys** command with **awk** , I get output with machines names as the following:
```
hasys -display|grep Shutdown | awk '{print $1}'
machine1a
machine1b
```
please advice how to print the machines names in one line as the following: example
```
hasys -display|grep Shutdown | awk '{pr... | 2014/02/17 | [
"https://unix.stackexchange.com/questions/115607",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/-1/"
] | You can say:
```
hasys -display | grep Shutdown | awk '{print $1}' ORS=' '
``` | The `grep` with `awk` is redundant:
```
hasys -display | awk '/Shutdown/ { printf "%s ", $1 }'
``` |
115,607 | When I run the following **hasys** command with **awk** , I get output with machines names as the following:
```
hasys -display|grep Shutdown | awk '{print $1}'
machine1a
machine1b
```
please advice how to print the machines names in one line as the following: example
```
hasys -display|grep Shutdown | awk '{pr... | 2014/02/17 | [
"https://unix.stackexchange.com/questions/115607",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/-1/"
] | You can say:
```
hasys -display | grep Shutdown | awk '{print $1}' ORS=' '
``` | ```
hasys -display | awk '/Shutdown/ {print $1}' | paste -sd ' ' -
```
Contrary to [@devnull's](https://unix.stackexchange.com/a/115608/22565) and [@jasonwryan's](https://unix.stackexchange.com/a/115610/22565), this one doesn't add a trailing space and terminates the line. `paste -sd*<sep>* -` is the generic idiom to... |
115,607 | When I run the following **hasys** command with **awk** , I get output with machines names as the following:
```
hasys -display|grep Shutdown | awk '{print $1}'
machine1a
machine1b
```
please advice how to print the machines names in one line as the following: example
```
hasys -display|grep Shutdown | awk '{pr... | 2014/02/17 | [
"https://unix.stackexchange.com/questions/115607",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/-1/"
] | You can say:
```
hasys -display | grep Shutdown | awk '{print $1}' ORS=' '
``` | ```
echo $( hasys .. the whole thing )
```
Just for fun |
115,607 | When I run the following **hasys** command with **awk** , I get output with machines names as the following:
```
hasys -display|grep Shutdown | awk '{print $1}'
machine1a
machine1b
```
please advice how to print the machines names in one line as the following: example
```
hasys -display|grep Shutdown | awk '{pr... | 2014/02/17 | [
"https://unix.stackexchange.com/questions/115607",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/-1/"
] | The `grep` with `awk` is redundant:
```
hasys -display | awk '/Shutdown/ { printf "%s ", $1 }'
``` | ```
echo $( hasys .. the whole thing )
```
Just for fun |
115,607 | When I run the following **hasys** command with **awk** , I get output with machines names as the following:
```
hasys -display|grep Shutdown | awk '{print $1}'
machine1a
machine1b
```
please advice how to print the machines names in one line as the following: example
```
hasys -display|grep Shutdown | awk '{pr... | 2014/02/17 | [
"https://unix.stackexchange.com/questions/115607",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/-1/"
] | ```
hasys -display | awk '/Shutdown/ {print $1}' | paste -sd ' ' -
```
Contrary to [@devnull's](https://unix.stackexchange.com/a/115608/22565) and [@jasonwryan's](https://unix.stackexchange.com/a/115610/22565), this one doesn't add a trailing space and terminates the line. `paste -sd*<sep>* -` is the generic idiom to... | ```
echo $( hasys .. the whole thing )
```
Just for fun |
14,608,075 | I am developing a web application with a heavy front-end approach. By using Dojo and the AMD-way, I currently have testing screens which may easily load over a hundred different javascript files.
When I want to debug for any specific problem, or verify if I am seeing an old version of a specific file, I find it really... | 2013/01/30 | [
"https://Stackoverflow.com/questions/14608075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/147507/"
] | While in the sources tab use `CTRL`+`O` (`⌘`+`O` for Mac) to search scripts, stylesheets and snippets by filename.
(use `CTRL`+`SHIFT`+`O` to filter/navigate to a JavaScript function/CSS rule when viewing a file)
[[Chrome Devtools Cheatsheet](http://anti-code.com/devtools-cheatsheet/)] | `CTRL` + `P` brings up the search input in Windows.
[](https://i.stack.imgur.com/8NICn.png)
`⌘` + `P` — in Mac.
[](https://i.stack.imgur.com/73FA2.png) |
14,608,075 | I am developing a web application with a heavy front-end approach. By using Dojo and the AMD-way, I currently have testing screens which may easily load over a hundred different javascript files.
When I want to debug for any specific problem, or verify if I am seeing an old version of a specific file, I find it really... | 2013/01/30 | [
"https://Stackoverflow.com/questions/14608075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/147507/"
] | While in the sources tab use `CTRL`+`O` (`⌘`+`O` for Mac) to search scripts, stylesheets and snippets by filename.
(use `CTRL`+`SHIFT`+`O` to filter/navigate to a JavaScript function/CSS rule when viewing a file)
[[Chrome Devtools Cheatsheet](http://anti-code.com/devtools-cheatsheet/)] | Mac: Command + O
Windows: Ctrl + O |
14,608,075 | I am developing a web application with a heavy front-end approach. By using Dojo and the AMD-way, I currently have testing screens which may easily load over a hundred different javascript files.
When I want to debug for any specific problem, or verify if I am seeing an old version of a specific file, I find it really... | 2013/01/30 | [
"https://Stackoverflow.com/questions/14608075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/147507/"
] | While in the sources tab use `CTRL`+`O` (`⌘`+`O` for Mac) to search scripts, stylesheets and snippets by filename.
(use `CTRL`+`SHIFT`+`O` to filter/navigate to a JavaScript function/CSS rule when viewing a file)
[[Chrome Devtools Cheatsheet](http://anti-code.com/devtools-cheatsheet/)] | In Windows:
Use `CTRL`+`SHIFT`+`F` to search for content in files.
Use `CTRL`+`SHIFT`+`O` to search for file names. |
14,608,075 | I am developing a web application with a heavy front-end approach. By using Dojo and the AMD-way, I currently have testing screens which may easily load over a hundred different javascript files.
When I want to debug for any specific problem, or verify if I am seeing an old version of a specific file, I find it really... | 2013/01/30 | [
"https://Stackoverflow.com/questions/14608075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/147507/"
] | `CTRL` + `P` brings up the search input in Windows.
[](https://i.stack.imgur.com/8NICn.png)
`⌘` + `P` — in Mac.
[](https://i.stack.imgur.com/73FA2.png) | Mac: Command + O
Windows: Ctrl + O |
14,608,075 | I am developing a web application with a heavy front-end approach. By using Dojo and the AMD-way, I currently have testing screens which may easily load over a hundred different javascript files.
When I want to debug for any specific problem, or verify if I am seeing an old version of a specific file, I find it really... | 2013/01/30 | [
"https://Stackoverflow.com/questions/14608075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/147507/"
] | `CTRL` + `P` brings up the search input in Windows.
[](https://i.stack.imgur.com/8NICn.png)
`⌘` + `P` — in Mac.
[](https://i.stack.imgur.com/73FA2.png) | In Windows:
Use `CTRL`+`SHIFT`+`F` to search for content in files.
Use `CTRL`+`SHIFT`+`O` to search for file names. |
14,608,075 | I am developing a web application with a heavy front-end approach. By using Dojo and the AMD-way, I currently have testing screens which may easily load over a hundred different javascript files.
When I want to debug for any specific problem, or verify if I am seeing an old version of a specific file, I find it really... | 2013/01/30 | [
"https://Stackoverflow.com/questions/14608075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/147507/"
] | In Windows:
Use `CTRL`+`SHIFT`+`F` to search for content in files.
Use `CTRL`+`SHIFT`+`O` to search for file names. | Mac: Command + O
Windows: Ctrl + O |
19,208,547 | My application handles an html form with a POST metod, and the webapp should generate a static file (xls) for the user entered data.
I'd like to generate a static link for user i.e. `/download/{uuid}`. This URI should return the static generated file so that user can share or bookmark this link (such link could be des... | 2013/10/06 | [
"https://Stackoverflow.com/questions/19208547",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/387380/"
] | If you are going to use an in-memory data structure, then a singleton scoped object would be one approach. You could create a custom bean, or you could simply create a synchronized `HashMap` (by wrapping it using `Collections.synchronizedMap`), or a `ConcurrentHashMap` instance.
But the problem with that approach is t... | Thinking outside the box, there is one solution that requires no storage, and yet being thread safe. Instead of creating the file and then generate the static link (and put their relation in a map, database or other key-value storage), you create the resulting link *first*, and then you use the link to generate the nam... |
56,942,964 | Is it possible to get the writing mode of the user? I'd like to know if the the text is RTL or LTR and TB.
It looks like I can get the direction and writing mode from the computedValue.
```css
#div2 {
writing-mode: vertical-lr;
}
#div1 {
direction: rtl;
}
p {
background-color: #FFEECC;
}
```
```html... | 2019/07/08 | [
"https://Stackoverflow.com/questions/56942964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/441016/"
] | Answer:
-------
Use the [`getComputedStyle`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle) `Window` method.
```
getComputedStyle(document.body).direction;
getComputedStyle(document.body)["writing-mode"];
```
---
Why?
----
Unlike simply accessing the `style` object of a node which may... | The HTML document has a "direction" attribute that specifies the language direction for its contents, but this does not represent the reading direction of the user (i.e. an american user in the US can visit a japanese website and the content's reading direction is RTL).
Instead, you can get the user's browser language... |
11,268,669 | Let's say I have two arrays in my javascript:
```
var content = ["string1", "string2", "string3", "string4"],
milliseconds = [500, 1500, 1000, 500];
```
I want each element of `content` array to be displayed in console one by one with intervals from `milliseconds` array in a way that `string1` is displayed after... | 2012/06/29 | [
"https://Stackoverflow.com/questions/11268669",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1492091/"
] | To add ToArray() to your LINQ query try this:
```
searchResults.DataSource = (from r in response.Results
select new
{
Title = r[SearchContentProperty.Title],
Summary = r[SearchContentProperty.HighlightedSummary]
}).ToArray();
searchResults.DataBind();
``` | ```
searchResults.DataSource = (from r in response.Results
select new
{
Title = r[SearchContentProperty.Title],
Summary = r[SearchContentProperty.HighlightedSummary]
}).ToArray();
```
searchResults.DataBind();
is true,
Edit: i got almost same problem but if still paging is not wotking you can use searchResul... |
74,828 | It's a common practice to highlight an element on hover state.
By highlighting it, I obviously mean making it more visible than other elements.
But lately, I've witnessed the opposite trend on a couple of websites :
Opacity is set to 0.5 or less on hover, which makes the hovered element less visible instead.
To me,... | 2015/03/13 | [
"https://ux.stackexchange.com/questions/74828",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/31968/"
] | The purpose of the hover state is to give visual feedback to the user highlighting an interaction opportunity, which does not necessarily require a visual highlighting.
While it has commonly been implemented in a way where a solid and prominent color was lightened on hover, this is not the only valid use. The appropri... | I agree that it is **currently** a bad practice, primarily because it is returning to the days of metaphoric design. The designer is trying to inspire the appearance of (and a realworld reference to) a frosted sheet of glass floating above the surface of the rest of the interface.
In this age of Modern-UI, it is commo... |
74,828 | It's a common practice to highlight an element on hover state.
By highlighting it, I obviously mean making it more visible than other elements.
But lately, I've witnessed the opposite trend on a couple of websites :
Opacity is set to 0.5 or less on hover, which makes the hovered element less visible instead.
To me,... | 2015/03/13 | [
"https://ux.stackexchange.com/questions/74828",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/31968/"
] | I see your point – but I'll try to explain in two paragraphs why I think it's **not** 'bad practice' at all, while personally I also dislike this effect.
* Trying to imaging the opposite approach: every element has an oppacity <1 and only the 'highlighted' element has an oppacity =1 does not feel 'right' or 'better'
*... | I agree that it is **currently** a bad practice, primarily because it is returning to the days of metaphoric design. The designer is trying to inspire the appearance of (and a realworld reference to) a frosted sheet of glass floating above the surface of the rest of the interface.
In this age of Modern-UI, it is commo... |
74,828 | It's a common practice to highlight an element on hover state.
By highlighting it, I obviously mean making it more visible than other elements.
But lately, I've witnessed the opposite trend on a couple of websites :
Opacity is set to 0.5 or less on hover, which makes the hovered element less visible instead.
To me,... | 2015/03/13 | [
"https://ux.stackexchange.com/questions/74828",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/31968/"
] | ### Which of these things is not like the other?
[I tried lowering the opacity to 50%](http://codepen.io/run-time/full/MYPZxM/) to see how it looked and without the context of the mouse cursor **this could be interpreted as a disabled button**.

Wit... | I agree that it is **currently** a bad practice, primarily because it is returning to the days of metaphoric design. The designer is trying to inspire the appearance of (and a realworld reference to) a frosted sheet of glass floating above the surface of the rest of the interface.
In this age of Modern-UI, it is commo... |
134,693 | I'm not sure whether this is the right place to ask this kind of question.
We are launching a website for selling coupons. And there user can search coupons and companies(brands), like in google search there are sections like "All", "Images", "Videos" etc.
But in our case the "Companies" section will find shops, cafe... | 2020/09/14 | [
"https://ux.stackexchange.com/questions/134693",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/139189/"
] | Instead of looking for the kind of store or establishment, what can be helpful is to search the activity type:
* Leisure
* Free time
* Entertainment | It's best to find out what words your users are using when you're naming things.
Then make sure you're matching the words and phrases you use in your interface with the words and phrases your users are using when they're searching for these things.
This is good for user experience, good for the consistency and findab... |
33,494,736 | Hi I have data source as following
```
ID Date Page
100 27-10-2015 google
102 27-10-2015 facebook
102 27-10-2015 instagram
104 28-10-2015 yahoo
105 30-10-2015 bing
```
I want to store this data in parquet format with the form as shown below
```
/folder... | 2015/11/03 | [
"https://Stackoverflow.com/questions/33494736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4361808/"
] | This is not a curl problem, this is an issue of parsing XML which is what your API returns by the looks of it. A simple solution is using one of the standard XML parsers PHP provides:
1. [SimpleXML](http://php.net/manual/en/simplexml.examples-basic.php)
2. [Dom Parser](http://php.net/manual/en/book.dom.php)
PHP offer... | CURL is mechanism utilized to perform HTTP request/response.
According to above mentioned description the CURL request returns response in XML format.
Please try executing following code snippet to parse XML document.
```
<?php
/**
* xml2array() will convert the given XML text to an array in the XML structure.
*... |
33,494,736 | Hi I have data source as following
```
ID Date Page
100 27-10-2015 google
102 27-10-2015 facebook
102 27-10-2015 instagram
104 28-10-2015 yahoo
105 30-10-2015 bing
```
I want to store this data in parquet format with the form as shown below
```
/folder... | 2015/11/03 | [
"https://Stackoverflow.com/questions/33494736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4361808/"
] | Having never used `SimpleXML` I can't comment on how to use or how easy it really is but as @hoppa mentioned you can use the built-in Dom Parsing functions built around `DOMDocument`
```
$food=array();
$data="
<foods>
<chinese foodtype='soup'>Shark Fin</chinese>
<japanese foodtype='fish'>Sushi</japanese>
... | CURL is mechanism utilized to perform HTTP request/response.
According to above mentioned description the CURL request returns response in XML format.
Please try executing following code snippet to parse XML document.
```
<?php
/**
* xml2array() will convert the given XML text to an array in the XML structure.
*... |
33,494,736 | Hi I have data source as following
```
ID Date Page
100 27-10-2015 google
102 27-10-2015 facebook
102 27-10-2015 instagram
104 28-10-2015 yahoo
105 30-10-2015 bing
```
I want to store this data in parquet format with the form as shown below
```
/folder... | 2015/11/03 | [
"https://Stackoverflow.com/questions/33494736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4361808/"
] | In DOM you can use Xpath to fetch specific values and nodes:
```
$xml = <<<'XML'
<foods>
<chinese foodtype='soup'>Shark Fin</chinese>
<japanese foodtype='fish'>Sushi</japanese>
<italian foodtype='wheat'>Pasta</italian>
<british foodtype='delicious'>fish n chips</british>
</foods>
XML;
$document = ... | CURL is mechanism utilized to perform HTTP request/response.
According to above mentioned description the CURL request returns response in XML format.
Please try executing following code snippet to parse XML document.
```
<?php
/**
* xml2array() will convert the given XML text to an array in the XML structure.
*... |
3,267,632 | In explanations I've read about public key cryptography, it is said that some large number is come up with by multiplying together 2 extremely large primes. Since factoring the product of large primes is almost impossibly time-consuming, you have security.
This seems like a problem that could be trivially solved with ... | 2010/07/16 | [
"https://Stackoverflow.com/questions/3267632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/356/"
] | The primes used in RSA and Diffie-Hellman are typically on the order of 2512. In comparison, there are only about 2256 atoms in the known universe. That means 2512 is large enough to assign 2256 unique numbers to every atom in the universe.
There is simply no way to store/calculate that much data.
---
As an aside, I... | I think the main problem is that rainbow tables pregenerated for certain algorithms use a rather "small" range (usually something in the range of 128 bits). This doesn't usually cover the whole range, but speeds the brute force process up. They usually consume some TB of space.
In prime factorization, primes are much ... |
3,267,632 | In explanations I've read about public key cryptography, it is said that some large number is come up with by multiplying together 2 extremely large primes. Since factoring the product of large primes is almost impossibly time-consuming, you have security.
This seems like a problem that could be trivially solved with ... | 2010/07/16 | [
"https://Stackoverflow.com/questions/3267632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/356/"
] | From one of my favorite books ever, Applied Cryptography by Bruce Schneier
>
> "If someone created a database of all primes, won't he be
> able to use that database to break public-key algorithms?
> Yes, but he can't do it. If you could store one gigabyte
> of information on a drive weighing one gram, then a list... | I think the main problem is that rainbow tables pregenerated for certain algorithms use a rather "small" range (usually something in the range of 128 bits). This doesn't usually cover the whole range, but speeds the brute force process up. They usually consume some TB of space.
In prime factorization, primes are much ... |
3,267,632 | In explanations I've read about public key cryptography, it is said that some large number is come up with by multiplying together 2 extremely large primes. Since factoring the product of large primes is almost impossibly time-consuming, you have security.
This seems like a problem that could be trivially solved with ... | 2010/07/16 | [
"https://Stackoverflow.com/questions/3267632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/356/"
] | From one of my favorite books ever, Applied Cryptography by Bruce Schneier
>
> "If someone created a database of all primes, won't he be
> able to use that database to break public-key algorithms?
> Yes, but he can't do it. If you could store one gigabyte
> of information on a drive weighing one gram, then a list... | The primes used in RSA and Diffie-Hellman are typically on the order of 2512. In comparison, there are only about 2256 atoms in the known universe. That means 2512 is large enough to assign 2256 unique numbers to every atom in the universe.
There is simply no way to store/calculate that much data.
---
As an aside, I... |
206,211 | I have lurked for a time on security websites and similar. I came to wonder, with the number of passwords we have (or websites that need a password) how to manage this.
Since I have well over 400 sites where a password is used, how can I keep track of all the passwords and avoid reuse?
I have a password manager but s... | 2019/03/27 | [
"https://security.stackexchange.com/questions/206211",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/202956/"
] | Yes - let your password manager handle all of them.
400 sites is not a lot to have in your password manager - I have many more than that. Most I generated randomly. Some I created on other systems and then transferred them in. But most importantly, I don't worry what they are, because my password manager handles them.... | 400 sites are a lot, I do not use that much, but I just let pw manager deal with passwords.
However I have some sites that I use frequently and don't want to login everytime in the password manager. For those sites I use a simple method to create easily remember passwords.
It is actually two methods.
I create a whole... |
206,211 | I have lurked for a time on security websites and similar. I came to wonder, with the number of passwords we have (or websites that need a password) how to manage this.
Since I have well over 400 sites where a password is used, how can I keep track of all the passwords and avoid reuse?
I have a password manager but s... | 2019/03/27 | [
"https://security.stackexchange.com/questions/206211",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/202956/"
] | The short answer is yes, let the password manager handle it.
You should have your password manager generate a unique password for each site. Don't make them yourself and you won't have to worry about reuse. For sites you currently reuse on, incrementally replace them as you come across them. Many have tools to identif... | 400 sites are a lot, I do not use that much, but I just let pw manager deal with passwords.
However I have some sites that I use frequently and don't want to login everytime in the password manager. For those sites I use a simple method to create easily remember passwords.
It is actually two methods.
I create a whole... |
206,211 | I have lurked for a time on security websites and similar. I came to wonder, with the number of passwords we have (or websites that need a password) how to manage this.
Since I have well over 400 sites where a password is used, how can I keep track of all the passwords and avoid reuse?
I have a password manager but s... | 2019/03/27 | [
"https://security.stackexchange.com/questions/206211",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/202956/"
] | Yes - let your password manager handle all of them.
400 sites is not a lot to have in your password manager - I have many more than that. Most I generated randomly. Some I created on other systems and then transferred them in. But most importantly, I don't worry what they are, because my password manager handles them.... | The short answer is yes, let the password manager handle it.
You should have your password manager generate a unique password for each site. Don't make them yourself and you won't have to worry about reuse. For sites you currently reuse on, incrementally replace them as you come across them. Many have tools to identif... |
24,763,576 | I have read many things about STL containers (`Sequence Containers`, `Associative Container`, `Container adapters`) but I'm still don't understand the internal form for each of them.
I want visualization form supported with pictures to every container in STL, (ex: what is the form of data inside the container) if is ... | 2014/07/15 | [
"https://Stackoverflow.com/questions/24763576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/459943/"
] | Most 'terminals' do not send keyboard input to the program 'one key at at time'. Rather, the terminal will wait for the enter key, and then send all keys pressed (up to that point) to the target program. Hence, the question code suffers from getting newlines `\n` as input, as well as digits.
The code below throws away... | Because the ENTER value "\n" (ASCII value 10) will be get by
```
getchar(c);
```
so it will do second time of
```
printf("The digit entered was: ");
printf("Please enter a digit: ");
``` |
24,763,576 | I have read many things about STL containers (`Sequence Containers`, `Associative Container`, `Container adapters`) but I'm still don't understand the internal form for each of them.
I want visualization form supported with pictures to every container in STL, (ex: what is the form of data inside the container) if is ... | 2014/07/15 | [
"https://Stackoverflow.com/questions/24763576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/459943/"
] | Most 'terminals' do not send keyboard input to the program 'one key at at time'. Rather, the terminal will wait for the enter key, and then send all keys pressed (up to that point) to the target program. Hence, the question code suffers from getting newlines `\n` as input, as well as digits.
The code below throws away... | Well, it's the trouble about the new-line character that you feed the standard input with while handing your piece into the console screen.
Let me ask you this:
With the code that you have said to work perfectly, you probably have tried some input like `"Hello!"` let's say, or maybe just a single character like `"9"`... |
24,763,576 | I have read many things about STL containers (`Sequence Containers`, `Associative Container`, `Container adapters`) but I'm still don't understand the internal form for each of them.
I want visualization form supported with pictures to every container in STL, (ex: what is the form of data inside the container) if is ... | 2014/07/15 | [
"https://Stackoverflow.com/questions/24763576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/459943/"
] | Most 'terminals' do not send keyboard input to the program 'one key at at time'. Rather, the terminal will wait for the enter key, and then send all keys pressed (up to that point) to the target program. Hence, the question code suffers from getting newlines `\n` as input, as well as digits.
The code below throws away... | You're being tripped up by a trailing newline in your input; when you type `9` and hit `Enter`, the *input stream* that your code reads from will contain the encodings for *two* characters, the `9` and a newline (in ASCII, it would be the sequence of values [57,10]) . Here's how it breaks down:
1. Code prompts you to ... |
878,988 | This is output of df -h
```
Filesystem Size Used Avail Use% Mounted on
udev 7.9G 0 7.9G 0% /dev
tmpfs 1.6G 25M 1.6G 2% /run
/dev/sda5 917G 2.1G 868G 1% /
tmpfs 7.9G 0 7.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 7.9G ... | 2017/02/02 | [
"https://askubuntu.com/questions/878988",
"https://askubuntu.com",
"https://askubuntu.com/users/385118/"
] | You can't. That's not an actual partition, it's an ["extended" partition](https://askubuntu.com/q/151968/85695). These are special partitions that only exist to contain other partitions. They are a trick to allow more than the maximum number of logical partitions the classic MBR partitioning scheme can understand.
In... | You can't !
/dev/sda2 is an extended partition that contains /dev/sda5 and /dev/sda6.
You can (if the Extended tag in the Type column isn't enough) see that Start for /dev/sda2 is smaller that Start for /dev/sda5. And End for /dev/sda2 is the same that End for /dev/sda6. |
602,195 | I was looking on Newegg for some SO-DIMM DDR3 ram for my laptop and noticed Kingston has a large variety of very similar laptop ram chips with different model numbers, marketed as ["System Specific"](http://www.kingston.com/us/memory/system_specific/) ram with a listing of "compatible" devices. (Curiously Newegg has a ... | 2013/05/31 | [
"https://superuser.com/questions/602195",
"https://superuser.com",
"https://superuser.com/users/92650/"
] | "System specific" from Kingston, simply means that they have tested that RAM on that machine and it is guaranteed to work. However, any RAM that matches the requirements for your laptop should work.
Personally, if the system specific memory costs more, Id skip it and get "regular" memory. Even if it doesnt work (which... | "System Specific" memory is just a marketing ploy. RAM manufacturers do not test their memory modules with all the products they list in their database. The only reason for them doing that is to capture the market share of those "savvy" customers entering "buy ram for product\_name" in their favorite search engine. |
15,135,393 | I have been trying to change the colour of my rows in a listview depending on a condition being met from my parsed string of my database. I cannot get my head around how to achieve this.
I know there seems to be examples about how to do this but I am really at a loss.
I have tried this:
```
Calms info = new Calms(... | 2013/02/28 | [
"https://Stackoverflow.com/questions/15135393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2026576/"
] | Adding a timeout on the Hide helps preventing the flickering!
```
function dragover(event) {
clearTimeout(tid);
event.stopPropagation();
event.preventDefault();
$('.overlay').show();
}
function dragleave(event) {
tid = setTimeout(function(){
event.stopPropagation();
$('.overlay').h... | Thanks to Nikolaj I came to the correct answer :
```
function dragover(event) {
clearTimeout(tid);
event.stopPropagation();
event.preventDefault();
$('.overlay').show();}
function dragleave(event) {
tid = setTimeout(function(){
event.stopPropagation();
$('.overlay').hide();
}, 0);}
```
Setting the timeout to... |
15,135,393 | I have been trying to change the colour of my rows in a listview depending on a condition being met from my parsed string of my database. I cannot get my head around how to achieve this.
I know there seems to be examples about how to do this but I am really at a loss.
I have tried this:
```
Calms info = new Calms(... | 2013/02/28 | [
"https://Stackoverflow.com/questions/15135393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2026576/"
] | Adding a timeout on the Hide helps preventing the flickering!
```
function dragover(event) {
clearTimeout(tid);
event.stopPropagation();
event.preventDefault();
$('.overlay').show();
}
function dragleave(event) {
tid = setTimeout(function(){
event.stopPropagation();
$('.overlay').h... | I came across a better solution in my optinion, no need to use timeouts which I tend not to like.
If you set your overlay to have CSS property
```
pointer-events:none
```
it won't affect drag events on the window when showing up and you can achieve the same effect |
15,135,393 | I have been trying to change the colour of my rows in a listview depending on a condition being met from my parsed string of my database. I cannot get my head around how to achieve this.
I know there seems to be examples about how to do this but I am really at a loss.
I have tried this:
```
Calms info = new Calms(... | 2013/02/28 | [
"https://Stackoverflow.com/questions/15135393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2026576/"
] | I came across a better solution in my optinion, no need to use timeouts which I tend not to like.
If you set your overlay to have CSS property
```
pointer-events:none
```
it won't affect drag events on the window when showing up and you can achieve the same effect | Thanks to Nikolaj I came to the correct answer :
```
function dragover(event) {
clearTimeout(tid);
event.stopPropagation();
event.preventDefault();
$('.overlay').show();}
function dragleave(event) {
tid = setTimeout(function(){
event.stopPropagation();
$('.overlay').hide();
}, 0);}
```
Setting the timeout to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.