qid int64 1 74.6M | question stringlengths 45 24.2k | date stringlengths 10 10 | metadata stringlengths 101 178 | response_j stringlengths 32 23.2k | response_k stringlengths 21 13.2k |
|---|---|---|---|---|---|
4,701,114 | Is there a way to tell the split command to save the resultant files in a particular location? | 2011/01/15 | ['https://Stackoverflow.com/questions/4701114', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/50329/'] | How about:
```
$ split -b 10 input.txt xxx/split-file
```
or
```
$ split -b 10 input.txt /tmp/split-file
```
Just include the output directory in the prefix specification. Keep in mind that the directory must be created beforehand. | This is the MacOS X (BSD) version of split, and includes some features of `csplit`:
>
> split [-a suffix\_length] [-b byte\_count[k|m]] [-l line\_count] [-p pattern] [file [name]]
>
>
>
The `name` specifies the prefix to the file name - the default is `x`, effectively `./x`.
So, you do:
```
split bigfile /lots... |
4,427 | Motivated by these questions:
[Case Study: First Answer Bias](https://academia.meta.stackexchange.com/q/4414/19607) and [Are upvotes skewed towards the first answer to a question?](https://academia.meta.stackexchange.com/q/3826/19607)
I propose a biased (biased towards people who use the meta site) study of Academi... | 2019/02/10 | ['https://academia.meta.stackexchange.com/questions/4427', 'https://academia.meta.stackexchange.com', 'https://academia.meta.stackexchange.com/users/19607/'] | I typically vote on answers I like right after reading them but usually read several of the answers. | I typically read most answers before voting. |
4,427 | Motivated by these questions:
[Case Study: First Answer Bias](https://academia.meta.stackexchange.com/q/4414/19607) and [Are upvotes skewed towards the first answer to a question?](https://academia.meta.stackexchange.com/q/3826/19607)
I propose a biased (biased towards people who use the meta site) study of Academi... | 2019/02/10 | ['https://academia.meta.stackexchange.com/questions/4427', 'https://academia.meta.stackexchange.com', 'https://academia.meta.stackexchange.com/users/19607/'] | I typically read most answers before voting. | I typically vote on answers I like right after reading them and often don't read further answers. |
4,427 | Motivated by these questions:
[Case Study: First Answer Bias](https://academia.meta.stackexchange.com/q/4414/19607) and [Are upvotes skewed towards the first answer to a question?](https://academia.meta.stackexchange.com/q/3826/19607)
I propose a biased (biased towards people who use the meta site) study of Academi... | 2019/02/10 | ['https://academia.meta.stackexchange.com/questions/4427', 'https://academia.meta.stackexchange.com', 'https://academia.meta.stackexchange.com/users/19607/'] | I typically read most answers before voting. | **Other** (vote before reading, never vote, ...)
Please explain in comments. |
4,427 | Motivated by these questions:
[Case Study: First Answer Bias](https://academia.meta.stackexchange.com/q/4414/19607) and [Are upvotes skewed towards the first answer to a question?](https://academia.meta.stackexchange.com/q/3826/19607)
I propose a biased (biased towards people who use the meta site) study of Academi... | 2019/02/10 | ['https://academia.meta.stackexchange.com/questions/4427', 'https://academia.meta.stackexchange.com', 'https://academia.meta.stackexchange.com/users/19607/'] | I typically vote on answers I like right after reading them but usually read several of the answers. | I typically vote on answers I like right after reading them and often don't read further answers. |
4,427 | Motivated by these questions:
[Case Study: First Answer Bias](https://academia.meta.stackexchange.com/q/4414/19607) and [Are upvotes skewed towards the first answer to a question?](https://academia.meta.stackexchange.com/q/3826/19607)
I propose a biased (biased towards people who use the meta site) study of Academi... | 2019/02/10 | ['https://academia.meta.stackexchange.com/questions/4427', 'https://academia.meta.stackexchange.com', 'https://academia.meta.stackexchange.com/users/19607/'] | I typically vote on answers I like right after reading them but usually read several of the answers. | **Other** (vote before reading, never vote, ...)
Please explain in comments. |
4,427 | Motivated by these questions:
[Case Study: First Answer Bias](https://academia.meta.stackexchange.com/q/4414/19607) and [Are upvotes skewed towards the first answer to a question?](https://academia.meta.stackexchange.com/q/3826/19607)
I propose a biased (biased towards people who use the meta site) study of Academi... | 2019/02/10 | ['https://academia.meta.stackexchange.com/questions/4427', 'https://academia.meta.stackexchange.com', 'https://academia.meta.stackexchange.com/users/19607/'] | **Other** (vote before reading, never vote, ...)
Please explain in comments. | I typically vote on answers I like right after reading them and often don't read further answers. |
40,375,015 | My scenario is like this : I have some texts and image inside the Container. Both of them display correctly with different screen sizes.
However, it doesn't display to my expected result when I view it in Desktop.
[](https://i.stack.imgur.com/kPGhO... | 2016/11/02 | ['https://Stackoverflow.com/questions/40375015', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6521417/'] | You appear to be running on a corporate network that is **sending web traffic through a proxy** (`pfSense proxy`).
The error is showing a **private IP address** (`192.168.0.46`), which means the request never made it to the Internet.
You should chat with your network administrators and determine why it is listed in a... | Since the address is address: 192.168.0.46
and the client name is address: 192.168.0.46
Then the target group is undefined: Bloack\_Sites not recognized.
Target group: Block\_Sites |
78,924 | As the title suggests, I can't figure out a way to share a folder outside my home folder using Ubuntu One. When browsing to my work partition using Nautilus, every folder has the "Share" option grayed out. | 2011/11/13 | ['https://askubuntu.com/questions/78924', 'https://askubuntu.com', 'https://askubuntu.com/users/39959/'] | I just did a test, created a new folder */new* and gave it permissions 777. When right clicking on it, Ubuntu One options were greyed out. Also tried creating a shortcut in ~/ dir, but no luck either.
In short: No, you can't
======================= | There are unsupported ways which will work. Think mount points under ~/
Using a bind mount as described above to a folder under ~/ you can sync any folder on your computer with Ubuntu One.
I sync folders on a separate partition with Ubuntu One this way.
Like I said, this is not really supported, but it does work |
78,924 | As the title suggests, I can't figure out a way to share a folder outside my home folder using Ubuntu One. When browsing to my work partition using Nautilus, every folder has the "Share" option grayed out. | 2011/11/13 | ['https://askubuntu.com/questions/78924', 'https://askubuntu.com', 'https://askubuntu.com/users/39959/'] | You could try using a `mount --bind command`. Something like
```
mount --bind /path/to/folder /home/username/folder_to_sync
```
This should make the contents of `/path/to/folder` available in both places.
Ubuntu-one doesn't support symlinks, but it might support binding mounts. If it does work, you can add a line t... | I just did a test, created a new folder */new* and gave it permissions 777. When right clicking on it, Ubuntu One options were greyed out. Also tried creating a shortcut in ~/ dir, but no luck either.
In short: No, you can't
======================= |
78,924 | As the title suggests, I can't figure out a way to share a folder outside my home folder using Ubuntu One. When browsing to my work partition using Nautilus, every folder has the "Share" option grayed out. | 2011/11/13 | ['https://askubuntu.com/questions/78924', 'https://askubuntu.com', 'https://askubuntu.com/users/39959/'] | You could try using a `mount --bind command`. Something like
```
mount --bind /path/to/folder /home/username/folder_to_sync
```
This should make the contents of `/path/to/folder` available in both places.
Ubuntu-one doesn't support symlinks, but it might support binding mounts. If it does work, you can add a line t... | There are unsupported ways which will work. Think mount points under ~/
Using a bind mount as described above to a folder under ~/ you can sync any folder on your computer with Ubuntu One.
I sync folders on a separate partition with Ubuntu One this way.
Like I said, this is not really supported, but it does work |
70,277,178 | How to take an number input from user and split it's digits and use each digit separately
*For example*
If user enters '''4568'''
The code should split 4568 into 4,5,6,8 | 2021/12/08 | ['https://Stackoverflow.com/questions/70277178', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/17627014/'] | Use a list comprehension over the user input.
```py
values = [int(i) for i in input()]
```
Note that this code doesn't handles cases where user puts non-digits characters in his input. To deal with this case, you would prefer to write :
```py
values = [int(i) for i in input() if i.isdigit()]
``` | Convert it to string, iterate to string and get each character as an integer.
```
# Input from the user
inp = input()
digits=[]
for c in str(inp):
try:
digit=int(c)
# Populate the list with the last digit obtained
digits.append(digit)
except:
# I'm assuming you don't need to worry ab... |
70,277,178 | How to take an number input from user and split it's digits and use each digit separately
*For example*
If user enters '''4568'''
The code should split 4568 into 4,5,6,8 | 2021/12/08 | ['https://Stackoverflow.com/questions/70277178', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/17627014/'] | You could `map` it to `int`, and convert the `map` to `list`.
```
digits = list(map(int, input()))
```
If you want to make sure only numbers are accepted add a `filter` to the `input`
```
digits = list(map(int, filter(lambda c: c.isdigit(), input())))
``` | Convert it to string, iterate to string and get each character as an integer.
```
# Input from the user
inp = input()
digits=[]
for c in str(inp):
try:
digit=int(c)
# Populate the list with the last digit obtained
digits.append(digit)
except:
# I'm assuming you don't need to worry ab... |
1,116 | In English and other Germanic languages, noun compounds are formed simply by “appending” the nouns in a certain order. For example, phrases like this are very common:
>
> electricity price comparison service
>
>
>
In Portuguese, Spanish and probably other Romance languages, this kind of compounding has to be don... | 2011/12/06 | ['https://linguistics.stackexchange.com/questions/1116', 'https://linguistics.stackexchange.com', 'https://linguistics.stackexchange.com/users/22/'] | Compound words are really complex, even if we limit it to noun-noun compounds.
It looks like you're concerned with "open" compound nouns, not "closed" or hyphenated or [idiomatic](http://www.sciencedirect.com/science/article/pii/0024384168900521) compound nouns [like these](http://www.rickwalton.com/curricul/compound... | Just thinking out aloud, but might it be related to the case systems in Germanic vs. Romance languages?
>
> electricity price comparison service
>
>
>
...is a shortened form of:
>
> service for the comparison of prices for electricity
>
>
>
This is the same as your Portuguese translation, where the preposit... |
9,458,285 | I've been actively using the revealing module pattern for years but there's a few things I'd like to understand deeper. From what I understand potential benefits of self-executing functions are anoymimty & self-execution, both of which don't seem necessary/utilised in this particular pattern. The other thing I don't un... | 2012/02/26 | ['https://Stackoverflow.com/questions/9458285', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/314963/'] | >
> Why do we use self-executing functions in the revealing module pattern?
>
>
>
JavaScript has first-class functions and lacks block-scoping, so functions are used to introduce new scopes.
>
> what in the below scenario makes its possible to wrap function Init inside the SocialMedia function(), i.e an embedded... | Self-executing functions are used to introduce new scopes, see also Mike Samuels answer.
There are two reasons for that:
* avoid polluting the global scope
* use of closures, i.e. "exporting" a function from an extra scope
Of course you can stack scopes, but usually you won't create that big modules where you have t... |
15,773,588 | I'm trying to write text in `Canvas`. As I need to show the soft keyboard to write text, I added an `EditText` to my Activity with 0 width. I also implemented a TextWatcher to get the text entered into the `EditText`. With this trick, I can show the soft keyboard whenever I like with this code :
```
InputMethodManage... | 2013/04/02 | ['https://Stackoverflow.com/questions/15773588', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1685143/'] | Taken from the documentation:
```
public void setOnKeyListener (View.OnKeyListener l)
Added in API level 1
Register a callback to be invoked when a hardware key is pressed in this view. Key presses in software input methods will generally not trigger the methods of this listener.
```
So you should look for anothe... | Okay so finally the reason nothing worked was because my `EditText` had a width of 0. When I put width and height to 1. Setting visibility to `View.INVISIBLE` doesn't work in this case.
By the way, the three Listener (OnEditorActionListener, OnKeyListener and Overriding dispatchKeyEvent) get the callbacks. But I'll u... |
15,773,588 | I'm trying to write text in `Canvas`. As I need to show the soft keyboard to write text, I added an `EditText` to my Activity with 0 width. I also implemented a TextWatcher to get the text entered into the `EditText`. With this trick, I can show the soft keyboard whenever I like with this code :
```
InputMethodManage... | 2013/04/02 | ['https://Stackoverflow.com/questions/15773588', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1685143/'] | You override the dispatchKeyEvent to get the Enter key
```
@Override
public boolean dispatchKeyEvent(KeyEvent event)
{
if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)
{
// Do whatever you want
}
return super.dispatchKeyEvent(event);
}
``` | Okay so finally the reason nothing worked was because my `EditText` had a width of 0. When I put width and height to 1. Setting visibility to `View.INVISIBLE` doesn't work in this case.
By the way, the three Listener (OnEditorActionListener, OnKeyListener and Overriding dispatchKeyEvent) get the callbacks. But I'll u... |
1,992,827 | I am creating a poll in php. I have a table with an id column.
When a user submits a choice, I want the php to first query the database and check whether the table "id" has the id of the current user.
I am pretty new at mysql, can someone help me with the query? | 2010/01/02 | ['https://Stackoverflow.com/questions/1992827', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/107922/'] | Give the empty element a different class (say `someHiddenElement`) when you are generating the content. Then add `someHiddenElement { display: none }` to your style sheet. | At the point where you populate the optional `div`, if there is no text to put in it, try changing the CSS `display` property to `none.` According to [this source](http://webdesign.about.com/od/css/f/blfaqhidden.htm) (and others), `display: none` removes the element completely from the document. It does not take up any... |
1,992,827 | I am creating a poll in php. I have a table with an id column.
When a user submits a choice, I want the php to first query the database and check whether the table "id" has the id of the current user.
I am pretty new at mysql, can someone help me with the query? | 2010/01/02 | ['https://Stackoverflow.com/questions/1992827', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/107922/'] | You can do the trick with the CSS3 pseudo-class :empty
```
.someElement
{
// your standard style
}
.someElement:empty
{
display:none;
}
```
Sadly Internet explorer doesn't support that feauture yet. For all the other browsers it shall do just fine... | I can't think of a CSS only way to do that.
I would try to decide whether the element is rendered at the time I know whether there will be any content in it. That is probably the cleanest solution. |
1,992,827 | I am creating a poll in php. I have a table with an id column.
When a user submits a choice, I want the php to first query the database and check whether the table "id" has the id of the current user.
I am pretty new at mysql, can someone help me with the query? | 2010/01/02 | ['https://Stackoverflow.com/questions/1992827', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/107922/'] | You can do the trick with the CSS3 pseudo-class :empty
```
.someElement
{
// your standard style
}
.someElement:empty
{
display:none;
}
```
Sadly Internet explorer doesn't support that feauture yet. For all the other browsers it shall do just fine... | ```
<style>
.someElement{padding-top: 5px; display:table;}
</style>
<div class="someElement">With padded content</div>
<div class="someElement"><!-- shouldn't render since it has no content --></div>
```
Adding display:table; should do the trick. |
1,992,827 | I am creating a poll in php. I have a table with an id column.
When a user submits a choice, I want the php to first query the database and check whether the table "id" has the id of the current user.
I am pretty new at mysql, can someone help me with the query? | 2010/01/02 | ['https://Stackoverflow.com/questions/1992827', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/107922/'] | Give the element an `id` attribute. You can then use Javascript to check it's innerHTML property once the page has loaded. If innerHTML has a length of zero, then you can set it's display property to none. [This page](http://www.tizag.com/javascriptT/javascript-innerHTML.php) might help if you don't know your javascrip... | Don't use padding on container, use margin on content. Than when there is no content, container remains invisible. |
1,992,827 | I am creating a poll in php. I have a table with an id column.
When a user submits a choice, I want the php to first query the database and check whether the table "id" has the id of the current user.
I am pretty new at mysql, can someone help me with the query? | 2010/01/02 | ['https://Stackoverflow.com/questions/1992827', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/107922/'] | If it's *necessary* to have the `div.someElement` in the HTML, the best CSS/HTML way to do that would be to add an extra `div` around the added content that has the padding property
```
.someElement > div{padding-top:5px;}
<div class="someElement"><div>Content</div></div>
```
Otherwise, do as Pekka says, or take a ... | At the point where you populate the optional `div`, if there is no text to put in it, try changing the CSS `display` property to `none.` According to [this source](http://webdesign.about.com/od/css/f/blfaqhidden.htm) (and others), `display: none` removes the element completely from the document. It does not take up any... |
1,992,827 | I am creating a poll in php. I have a table with an id column.
When a user submits a choice, I want the php to first query the database and check whether the table "id" has the id of the current user.
I am pretty new at mysql, can someone help me with the query? | 2010/01/02 | ['https://Stackoverflow.com/questions/1992827', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/107922/'] | If it's *necessary* to have the `div.someElement` in the HTML, the best CSS/HTML way to do that would be to add an extra `div` around the added content that has the padding property
```
.someElement > div{padding-top:5px;}
<div class="someElement"><div>Content</div></div>
```
Otherwise, do as Pekka says, or take a ... | Don't use padding on container, use margin on content. Than when there is no content, container remains invisible. |
1,992,827 | I am creating a poll in php. I have a table with an id column.
When a user submits a choice, I want the php to first query the database and check whether the table "id" has the id of the current user.
I am pretty new at mysql, can someone help me with the query? | 2010/01/02 | ['https://Stackoverflow.com/questions/1992827', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/107922/'] | You can do the trick with the CSS3 pseudo-class :empty
```
.someElement
{
// your standard style
}
.someElement:empty
{
display:none;
}
```
Sadly Internet explorer doesn't support that feauture yet. For all the other browsers it shall do just fine... | Give the empty element a different class (say `someHiddenElement`) when you are generating the content. Then add `someHiddenElement { display: none }` to your style sheet. |
1,992,827 | I am creating a poll in php. I have a table with an id column.
When a user submits a choice, I want the php to first query the database and check whether the table "id" has the id of the current user.
I am pretty new at mysql, can someone help me with the query? | 2010/01/02 | ['https://Stackoverflow.com/questions/1992827', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/107922/'] | ```
<style>
.someElement{padding-top: 5px; display:table;}
</style>
<div class="someElement">With padded content</div>
<div class="someElement"><!-- shouldn't render since it has no content --></div>
```
Adding display:table; should do the trick. | I can't think of a CSS only way to do that.
I would try to decide whether the element is rendered at the time I know whether there will be any content in it. That is probably the cleanest solution. |
1,992,827 | I am creating a poll in php. I have a table with an id column.
When a user submits a choice, I want the php to first query the database and check whether the table "id" has the id of the current user.
I am pretty new at mysql, can someone help me with the query? | 2010/01/02 | ['https://Stackoverflow.com/questions/1992827', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/107922/'] | ```
<style>
.someElement{padding-top: 5px; display:table;}
</style>
<div class="someElement">With padded content</div>
<div class="someElement"><!-- shouldn't render since it has no content --></div>
```
Adding display:table; should do the trick. | Don't use padding on container, use margin on content. Than when there is no content, container remains invisible. |
1,992,827 | I am creating a poll in php. I have a table with an id column.
When a user submits a choice, I want the php to first query the database and check whether the table "id" has the id of the current user.
I am pretty new at mysql, can someone help me with the query? | 2010/01/02 | ['https://Stackoverflow.com/questions/1992827', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/107922/'] | I can't think of a CSS only way to do that.
I would try to decide whether the element is rendered at the time I know whether there will be any content in it. That is probably the cleanest solution. | At the point where you populate the optional `div`, if there is no text to put in it, try changing the CSS `display` property to `none.` According to [this source](http://webdesign.about.com/od/css/f/blfaqhidden.htm) (and others), `display: none` removes the element completely from the document. It does not take up any... |
20,354,862 | Even If I choose only one branch in git extensions it still shows me something like this. Why are there additional vertical lines? As I found out, red one is branch in my local repo, why is there a separate blue line with tags, why aren't they on red line?
Edit: and what are these circles and rectangles mean?
![ente... | 2013/12/03 | ['https://Stackoverflow.com/questions/20354862', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/260894/'] | A git branch is basically a name that points to a commit, but the commit it points to is updated whenever a new commit is added to the branch.
Git is an acyclic directed graph. Each git commit has a) an optional [tree object](http://www.gitguys.com/topics/git-object-tree/), b) an optional parent commit (or two or more... | And for your edit:
The circles represent revisions in the history.
The squares represent a revision which is referenced by one ore more branches. |
19,142 | I have a new LCD for my HTC phone, but unfortunately it's not press-fit or screw on like some older phones. I have to re-glue it back. What domestic glues (not superglue as I've heard it cracks when dry) could I use to put my LCD screen back onto my phone please? I was thinking a more glutenous glue like vinyl repair o... | 2018/09/05 | ['https://lifehacks.stackexchange.com/questions/19142', 'https://lifehacks.stackexchange.com', 'https://lifehacks.stackexchange.com/users/25469/'] | Replacement screens, event rebuilds, may come with an adhesive strip already attached. This is also how these screens were mounted in the first place.
If that is not the case we may use double-sided adhesive tape (AKA double-sided sticky tape, mounting tape, carpet tape) that we cut into the desired dimensions.
Befor... | If you're mounting a screen assembly (protective glass/touch sensitive digitiser/LCD display) onto a phone chassis, a double sided sticky foam as Takkat recommends - surprised it didn't come with the display/wasn't already attached but may be available separately, computer cut for your exact phone dimensions
If you m... |
15,594,289 | I am trying to display some images in a ListView and have not been successful. I am using WPF MVVM and the ListView is a holdover from simply displaying suits and rank data. (See my previous post: [MVVM in WPF - How to alert ViewModel of changes in Model... or should I?](https://stackoverflow.com/questions/15439841/mvv... | 2013/03/24 | ['https://Stackoverflow.com/questions/15594289', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/286641/'] | First, you should not use Image controls in your ViewModel. You already have an Image control in the DateTemplate of your view. You want to bind the `Source` property of this Image conntrol, and the source property of this binding can't be another Image.
Instead your ViewModel would either use [`ImageSource`](http://m... | I didn't really try to reproduce your problem, but I will if this is not solving it:
In your first xaml block, I think you mixed up the bindings. This would be how I expect it, ItemsSource to the ObservableCollection of Images, Image source to the Image.
```
<Image Source="{Binding}" ... />
<ListView Name="lvwTitles... |
14,950,314 | UPDATE 1
========
I did some more debugging and found that the constructor is run from the main UI thread but the handleMessage(Message) method is run on the Thread I created, which completely contradicts my understanding of Handlers.
Problem
=======
I've been working on Android for a while now and I've run into an ... | 2013/02/19 | ['https://Stackoverflow.com/questions/14950314', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/783338/'] | You should use <http://developer.android.com/reference/android/os/Handler.html#sendMessage(android.os.Message)>
to send the message that will be later processed by handleMessage. | The problem was that I was calling dispatchMessage(Message) which is executed imediately on the current thread. I should have been using sendMessage(Message) which would enqueue the given Message to the original thread's message queue that created the Handler in the first place. |
63,394,559 | I have POJO attribute as below,
```
@Column(name = "timeStamp")
private LocalDateTime timeStamp;
```
This attribute coming from a service, and need to retain the format. I am streaming input from Kafka and need to store in Cassandra.
I'm creating table using datastax API,
```
CreateTable createTable = SchemaBui... | 2020/08/13 | ['https://Stackoverflow.com/questions/63394559', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2182920/'] | For Java driver 3.x you need to use a separate package - so-called "Optional codecs" by including an additional dependency:
```xml
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-extras</artifactId>
<version>driver-version</version>
</dependency>
```
For `LocalDateTime` from... | Just convert it to Instant and it will be mapped automatically:
```
message.getLocalDateTime().toInstant(ZoneOffset.UTC)
``` |
48,798,101 | What I want to do is save one y dataframe for each file in the loop below.Right now, I only have the last one.
```
temp = list.files(pattern="*.csv")
myfiles = lapply(temp, read.csv)
for (file in myfiles){
y <- some code
}
```
y has 26 observations of 2 variables.
Sorry if this is not a working example. My data ... | 2018/02/14 | ['https://Stackoverflow.com/questions/48798101', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7747528/'] | `df <- do.call("rbind",lapply(list.files(pattern = "*.csv"),read.csv, header = TRUE))`
Here is an [example](https://stat.ethz.ch/pipermail/r-help/2003-April/032077.html). | If I understand well, you want to save `y` as a `csv`? You could do something like this:
```
temp = list.files(pattern="*.csv")
myfiles = lapply(temp, read.csv)
## Adding a counter to be incremented in the loop
counter <- 1
for (file in myfiles){
y <- some code
## writing the csv
write.csv(y, file = paste0("my_csv... |
25,582,291 | I am trying to call a stored procedure using entity framework 6. I get an error on the output message.
>
> A first chance exception of type 'System.Data.Entity.Core.EntityCommandExecutionException' occurred in EntityFramework.SqlServer.dll
>
>
>
```
using (var context = new PartnerPortalEntities2())
{
var o... | 2014/08/30 | ['https://Stackoverflow.com/questions/25582291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/193247/'] | As suggested by @Shoe, i had embeded the call to stored procedure with in a try catch block which caught the exception and showed the exact error.
It turned out to be that i was not passing the exact variable as the output parameter. Changed result to results as the variable defined in stored procedure was results
``... | I just had the same error and I managed to fix it!
This error could be a result of other reasons, but the reason for this error was that the SQL server was not configured to accept transport from my debugging station- I had to configure the IP of my computer in the Sql server settings and then it worked perfectly.
Ho... |
19,600,123 | I have created a timeline card with a custom menu item. I would like to get a callback when the user has selected that menu item.
```
// Create a menu item for the card
var mnuActivate = new MenuItem() {
Action = "CUSTOM",
RemoveWhenSelected = new bool?(true),
Id = ACCEPT_ID,
Values = new List<MenuVal... | 2013/10/25 | ['https://Stackoverflow.com/questions/19600123', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/281336/'] | The main thing you need to keep in mind is [endianness](http://en.wikipedia.org/wiki/Endianness). That is, the order the bytes are interpreted in is different on different platforms.
For example, your Intel CPU might interpret the byte string `0x01 0x00` to be the number 1, but someone else's PowerPC would interpret t... | Also, you'd obviously want to send both bytes using a single socket write operation. Don't write one byte and then write the other using two writes as that could end up being very inefficient over the wire. That is, don't write uint8\_t[0] followed by uint8\_t[1]. Writing &uint16\_t will avoid that situation. |
41,422,231 | I am developing an app with input field, and for pattern using angular js ui-mask.
**HTML**
```
<input type="tel" class="input-field " data-ng-model="registrationField.debitcard" ui-mask="9999 9999 9999 9999" placeholder="Enter ATM/Debit Card Number" ui-mask-placeholder ui-mask-placeholder-char="space" id=... | 2017/01/02 | ['https://Stackoverflow.com/questions/41422231', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2979319/'] | You can use conditional aggregation for this:
```
SELECT column1,
column2
FROM your_table t
GROUP BY column1,
column2
HAVING COUNT(CASE WHEN source = 'a' THEN 1 END) = 0;
``` | You can achieve the desired result using below query:
SELECT DISTINCT COLUMN1, COLUMN2
FROM TABLE1
WHERE Source <> 'a' |
36,939,625 | I'm looking for a way to evaluate price expressions stored in database in Postgres 9.1+
I tried code below from answer in
[How to evaluate expression in select statement in Postgres](https://stackoverflow.com/questions/26063328/how-to-evaluate-expression-in-select-statement-in-postgres)
but got error
```
ERROR: mi... | 2016/04/29 | ['https://Stackoverflow.com/questions/36939625', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/742402/'] | *Serg* is basically right. **Your *dyna-SQL* is executed "on its own"** so it needs to be a valid SQL statement (**having "to know" all involved tables**). I [updated my answer in the referred thread](https://stackoverflow.com/a/36909941/1915920) to reflect this.
But to properly cite it in here your example should be ... | Just add the table name somwhere. May be
```
insert into customer values (1, 'product.price*0.95 FROM product'),(2,'cost+12.0 FROM product' );
```
or may be
```
execute 'select ' || sql || ' FROM product' into as_txt ;
```
at your choice.
Hope this `priceexpression` is not exposed to users but only to res... |
14,249,367 | below is a terminal session illustrating the problem:
```
$ pip install scrappy --user
Requirement already satisfied (use --upgrade to upgrade): scrappy in /home/louist/Documents/Python/Scrappy
Downloading/unpacking guessit (from scrappy)
Downloading guessit-0.5.3.tar.gz (45Kb): 45Kb downloaded
Running setup.py eg... | 2013/01/10 | ['https://Stackoverflow.com/questions/14249367', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1156707/'] | By default new virtualenv doesn't include packages installed outside of it (created without `--system-site-packages` option). Therefore your `test` virtualenv doesn't see packages installed to `~/.local` (due to `--user` option).
Either create virtualenv with --system-site-packages option or don't use --user while ins... | I had a similar issue, it was a distros problem
When i installed using the following -
```
sudo apt-get install python-scrapy
```
from command line it work. Do make sure you update your repository before hitting the above command to get a current version |
444,376 | **Duplicate of: [In Python, how do I get the path and name of the file that is currently executing?](https://stackoverflow.com/questions/50499/in-python-how-do-i-get-the-path-and-name-of-the-file-that-is-currently-executing)**
I would like to find out the path to the currently executing script.
I have tried os.getcwd(... | 2009/01/14 | ['https://Stackoverflow.com/questions/444376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/32933/'] | In Python, `__file__` identifies the current Python file. Thus:
```
print "I'm inside Python file %s" % __file__
```
will print the current Python file. Note that this works in imported Python modules, as well as scripts. | How about using sys.path[0]
You can do something like
'print os.path.join(sys.path[0], sys.argv[0])'
<https://docs.python.org/library/sys.html> |
19,517,707 | I'd like to sort a `List` on element *counts* of `IGrouping`s.
And that's it, the list should ideally be the same. I would compromise with a new list, but then the elements should be the very same original objects, not copies (however shallow) and definitely not anonymous objects.
**Specifically:** We have an entity ... | 2013/10/22 | ['https://Stackoverflow.com/questions/19517707', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2266481/'] | Almost no operation in .NET clones an object. Neither deeply nor shallowly. LINQ also does not clone the elements it processes. Therefore, a simple LINQ query will work:
```
var oldList = ...;
var newList = (from x in oldList
group x by something into g
orderby g.Count()
fr... | Well, this is embarrassing.
My mistake was indeed based on a misunderstanding:
```
class Item
{
internal string Value { get; set; }
internal string Qux { get; set; }
internal string Quux { get; set; }
}
var query = from i in list
group i by new { i.Value, i.Qux } into g // Note: no Quux, no p... |
19,517,707 | I'd like to sort a `List` on element *counts* of `IGrouping`s.
And that's it, the list should ideally be the same. I would compromise with a new list, but then the elements should be the very same original objects, not copies (however shallow) and definitely not anonymous objects.
**Specifically:** We have an entity ... | 2013/10/22 | ['https://Stackoverflow.com/questions/19517707', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2266481/'] | ```
var mySortedList = myList.GroupBy(x => x.Name).OrderByDescending(g => g.Count())
.SelectMany(x => x).ToList();
``` | Almost no operation in .NET clones an object. Neither deeply nor shallowly. LINQ also does not clone the elements it processes. Therefore, a simple LINQ query will work:
```
var oldList = ...;
var newList = (from x in oldList
group x by something into g
orderby g.Count()
fr... |
19,517,707 | I'd like to sort a `List` on element *counts* of `IGrouping`s.
And that's it, the list should ideally be the same. I would compromise with a new list, but then the elements should be the very same original objects, not copies (however shallow) and definitely not anonymous objects.
**Specifically:** We have an entity ... | 2013/10/22 | ['https://Stackoverflow.com/questions/19517707', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2266481/'] | ```
var mySortedList = myList.GroupBy(x => x.Name).OrderByDescending(g => g.Count())
.SelectMany(x => x).ToList();
``` | Well, this is embarrassing.
My mistake was indeed based on a misunderstanding:
```
class Item
{
internal string Value { get; set; }
internal string Qux { get; set; }
internal string Quux { get; set; }
}
var query = from i in list
group i by new { i.Value, i.Qux } into g // Note: no Quux, no p... |
806,400 | We have a project with several applications including web applications, web services, windows services and windows applications. We also have prerequisites like SQL Server Express, .NET 2.0 and others. We don't have much user interaction during the setup but we want to add more intelligence to it.
We are currently usi... | 2009/04/30 | ['https://Stackoverflow.com/questions/806400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44547/'] | I have used [Installshield](http://www.acresso.com/products/is/installshield-overview.htm), [NSIS](http://nsis.sourceforge.net/), Visual Studio and [WiX](http://wix.sourceforge.net/). Installshield always produced a bloated installer for me and costs alot. Visual Studio can be limited in some of the things that it can ... | We have chosen WiX too. Mind you that you will still need to know all about Windows Installer mechanisms. WiX is version control friendly and very transparent
If you need custom actions and would like to write that in a .NET language then go for the CustomActionAttribute approach. You can write setup dialogs using Win... |
806,400 | We have a project with several applications including web applications, web services, windows services and windows applications. We also have prerequisites like SQL Server Express, .NET 2.0 and others. We don't have much user interaction during the setup but we want to add more intelligence to it.
We are currently usi... | 2009/04/30 | ['https://Stackoverflow.com/questions/806400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44547/'] | I have used [Installshield](http://www.acresso.com/products/is/installshield-overview.htm), [NSIS](http://nsis.sourceforge.net/), Visual Studio and [WiX](http://wix.sourceforge.net/). Installshield always produced a bloated installer for me and costs alot. Visual Studio can be limited in some of the things that it can ... | Since you mention Visual Studio and .net, I'm assuming you are deploying to Windows based servers, but even still you might want to take a look at [fabric](http://www.nongnu.org/fab/). It is a python based deployment tool. You can write and launch scripts to deploy and setup your servers, web services, etc.. The only t... |
806,400 | We have a project with several applications including web applications, web services, windows services and windows applications. We also have prerequisites like SQL Server Express, .NET 2.0 and others. We don't have much user interaction during the setup but we want to add more intelligence to it.
We are currently usi... | 2009/04/30 | ['https://Stackoverflow.com/questions/806400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44547/'] | WiX is your friend here.
<http://wix.sourceforge.net/>
WiX is an incredibly flexible setup technology, xml driven and with a lot of tools and knowledge out there.
There are a number of blogs that are relevant to WiX out there. Check out:
<http://www.joyofsetup.com/>
<http://robmensching.com/blog/> | There are three things I don't like about InstallShield:
1. It seems overly complex
2. There is no way (to my knowledge) of generating from the command line, you always have to use the GUI, which is a hindrance for automated builds.
3. It seems to add an excessive amount of overhead.
I've used [NSIS](http://nsis.sour... |
806,400 | We have a project with several applications including web applications, web services, windows services and windows applications. We also have prerequisites like SQL Server Express, .NET 2.0 and others. We don't have much user interaction during the setup but we want to add more intelligence to it.
We are currently usi... | 2009/04/30 | ['https://Stackoverflow.com/questions/806400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44547/'] | After reading these answers we ended up deciding to use Advanced Installer, it has the advantage of adhering to the MSI standards and also of being quite simple to use. | WiX is your friend here.
<http://wix.sourceforge.net/>
WiX is an incredibly flexible setup technology, xml driven and with a lot of tools and knowledge out there.
There are a number of blogs that are relevant to WiX out there. Check out:
<http://www.joyofsetup.com/>
<http://robmensching.com/blog/> |
806,400 | We have a project with several applications including web applications, web services, windows services and windows applications. We also have prerequisites like SQL Server Express, .NET 2.0 and others. We don't have much user interaction during the setup but we want to add more intelligence to it.
We are currently usi... | 2009/04/30 | ['https://Stackoverflow.com/questions/806400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44547/'] | I have used [Installshield](http://www.acresso.com/products/is/installshield-overview.htm), [NSIS](http://nsis.sourceforge.net/), Visual Studio and [WiX](http://wix.sourceforge.net/). Installshield always produced a bloated installer for me and costs alot. Visual Studio can be limited in some of the things that it can ... | There are three things I don't like about InstallShield:
1. It seems overly complex
2. There is no way (to my knowledge) of generating from the command line, you always have to use the GUI, which is a hindrance for automated builds.
3. It seems to add an excessive amount of overhead.
I've used [NSIS](http://nsis.sour... |
806,400 | We have a project with several applications including web applications, web services, windows services and windows applications. We also have prerequisites like SQL Server Express, .NET 2.0 and others. We don't have much user interaction during the setup but we want to add more intelligence to it.
We are currently usi... | 2009/04/30 | ['https://Stackoverflow.com/questions/806400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44547/'] | After reading these answers we ended up deciding to use Advanced Installer, it has the advantage of adhering to the MSI standards and also of being quite simple to use. | I have used [Installshield](http://www.acresso.com/products/is/installshield-overview.htm), [NSIS](http://nsis.sourceforge.net/), Visual Studio and [WiX](http://wix.sourceforge.net/). Installshield always produced a bloated installer for me and costs alot. Visual Studio can be limited in some of the things that it can ... |
806,400 | We have a project with several applications including web applications, web services, windows services and windows applications. We also have prerequisites like SQL Server Express, .NET 2.0 and others. We don't have much user interaction during the setup but we want to add more intelligence to it.
We are currently usi... | 2009/04/30 | ['https://Stackoverflow.com/questions/806400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44547/'] | After reading these answers we ended up deciding to use Advanced Installer, it has the advantage of adhering to the MSI standards and also of being quite simple to use. | If you want to or have to adhere to the MSI standard installs for the Windows platform, I'd second Martin Peck's recommendation for WiX. It's basically the same technology the VS-setup projects and Installshield use - with all its pros and cons.
If you do **not** need to be on the MSI train, you could also look at sim... |
806,400 | We have a project with several applications including web applications, web services, windows services and windows applications. We also have prerequisites like SQL Server Express, .NET 2.0 and others. We don't have much user interaction during the setup but we want to add more intelligence to it.
We are currently usi... | 2009/04/30 | ['https://Stackoverflow.com/questions/806400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44547/'] | After reading these answers we ended up deciding to use Advanced Installer, it has the advantage of adhering to the MSI standards and also of being quite simple to use. | We have chosen WiX too. Mind you that you will still need to know all about Windows Installer mechanisms. WiX is version control friendly and very transparent
If you need custom actions and would like to write that in a .NET language then go for the CustomActionAttribute approach. You can write setup dialogs using Win... |
806,400 | We have a project with several applications including web applications, web services, windows services and windows applications. We also have prerequisites like SQL Server Express, .NET 2.0 and others. We don't have much user interaction during the setup but we want to add more intelligence to it.
We are currently usi... | 2009/04/30 | ['https://Stackoverflow.com/questions/806400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44547/'] | After reading these answers we ended up deciding to use Advanced Installer, it has the advantage of adhering to the MSI standards and also of being quite simple to use. | Since you mention Visual Studio and .net, I'm assuming you are deploying to Windows based servers, but even still you might want to take a look at [fabric](http://www.nongnu.org/fab/). It is a python based deployment tool. You can write and launch scripts to deploy and setup your servers, web services, etc.. The only t... |
806,400 | We have a project with several applications including web applications, web services, windows services and windows applications. We also have prerequisites like SQL Server Express, .NET 2.0 and others. We don't have much user interaction during the setup but we want to add more intelligence to it.
We are currently usi... | 2009/04/30 | ['https://Stackoverflow.com/questions/806400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44547/'] | WiX is your friend here.
<http://wix.sourceforge.net/>
WiX is an incredibly flexible setup technology, xml driven and with a lot of tools and knowledge out there.
There are a number of blogs that are relevant to WiX out there. Check out:
<http://www.joyofsetup.com/>
<http://robmensching.com/blog/> | If you want to or have to adhere to the MSI standard installs for the Windows platform, I'd second Martin Peck's recommendation for WiX. It's basically the same technology the VS-setup projects and Installshield use - with all its pros and cons.
If you do **not** need to be on the MSI train, you could also look at sim... |
56,685,913 | I am pulling data out of a SQL server using pyodbc. The issue is I need to pull data from a certain date frame, however; the date comes across in both an incorrect data type and format. Float64 and 90502(5/02/09 is what I would like.) I am very new to python and far from really even being very good at this and would ap... | 2019/06/20 | ['https://Stackoverflow.com/questions/56685913', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8112192/'] | One option is to use the base R function `setNames`
```
aggregate_mtcars <- mtcars_copy[, setNames(.(sum(carb)), new_col)]
```
Or you could use `data.table::setnames`
```
aggregate_mtcars <- setnames(mtcars_copy[, .(sum(carb))], new_col)
``` | I think what you want is to simply make a copy when doing case 1.
```
aggregate_mtcars <- copy(mtcars_copy)[, eval(new_col) := sum(carb)]
```
That retains `mtcars_copy` as a separate dataset to the new `aggregate_metcars`, without the new columns. |
56,685,913 | I am pulling data out of a SQL server using pyodbc. The issue is I need to pull data from a certain date frame, however; the date comes across in both an incorrect data type and format. Float64 and 90502(5/02/09 is what I would like.) I am very new to python and far from really even being very good at this and would ap... | 2019/06/20 | ['https://Stackoverflow.com/questions/56685913', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8112192/'] | I think what you want is to simply make a copy when doing case 1.
```
aggregate_mtcars <- copy(mtcars_copy)[, eval(new_col) := sum(carb)]
```
That retains `mtcars_copy` as a separate dataset to the new `aggregate_metcars`, without the new columns. | The reason is because case 2 uses `data.frame` way to create column in a data frame (as a new list).
There is hidden parameter in data.table : `with` that handles the way the object is returned. It can be a data.table or a vector.
>
> ?data.table :
>
> By default with=TRUE and j is evaluated within the frame of x... |
56,685,913 | I am pulling data out of a SQL server using pyodbc. The issue is I need to pull data from a certain date frame, however; the date comes across in both an incorrect data type and format. Float64 and 90502(5/02/09 is what I would like.) I am very new to python and far from really even being very good at this and would ap... | 2019/06/20 | ['https://Stackoverflow.com/questions/56685913', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8112192/'] | One option is to use the base R function `setNames`
```
aggregate_mtcars <- mtcars_copy[, setNames(.(sum(carb)), new_col)]
```
Or you could use `data.table::setnames`
```
aggregate_mtcars <- setnames(mtcars_copy[, .(sum(carb))], new_col)
``` | The reason is because case 2 uses `data.frame` way to create column in a data frame (as a new list).
There is hidden parameter in data.table : `with` that handles the way the object is returned. It can be a data.table or a vector.
>
> ?data.table :
>
> By default with=TRUE and j is evaluated within the frame of x... |
26,974,838 | I want to run Python on 3Dsmax 2014. I saw the website and know 3Dsmax 2014 can use the Python script . But when I try with example from the website, it does not work. Maybe lack of some software or anything else.
I used this code in "MAXscript Listener":
```
python.Execute "print 'hello'"
```
And result was:
```
... | 2014/11/17 | ['https://Stackoverflow.com/questions/26974838', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4261541/'] | You would need the Extension 1 (Subscription Advantage Pack) to be able to run python scripts like that. | You need to load python first. Try this:
```
python.init()
python.execute "print 'Hello World'"
``` |
6,824,604 | How to get the default HTTP USER AGENT and its default settings from the android device?
thanks
Nohsib | 2011/07/26 | ['https://Stackoverflow.com/questions/6824604', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/530993/'] | as Varundroid mentioned in his answer,
```
String userAgent = System.getProperty("http.agent");
```
is better way to do it for Android 2.1 and above.
====================
From android source code.
```
public static String getDefaultUserAgent() {
StringBuilder result = new StringBuilder(64);
result.appe... | **Edit: See Prakash's answer, which is better for 2.1+.**
Try <http://developer.android.com/reference/android/webkit/WebSettings.html#getUserAgentString>
Note that this User Agent will only apply for the embedded WebKit browser that's used by default in Android. Unfortunately, you'll need to create a new WebView obje... |
6,824,604 | How to get the default HTTP USER AGENT and its default settings from the android device?
thanks
Nohsib | 2011/07/26 | ['https://Stackoverflow.com/questions/6824604', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/530993/'] | **Edit: See Prakash's answer, which is better for 2.1+.**
Try <http://developer.android.com/reference/android/webkit/WebSettings.html#getUserAgentString>
Note that this User Agent will only apply for the embedded WebKit browser that's used by default in Android. Unfortunately, you'll need to create a new WebView obje... | When you use web view to access the user-agent, make sure you run the
`new WebView(this).getSettings().getUserAgentString();`
on the UI thread.
If you want access the user agent on background thread.
use
`System.getProperty("http.agent")`
To check whether a user-agent is valid or not use this
<https://deviceatlas... |
6,824,604 | How to get the default HTTP USER AGENT and its default settings from the android device?
thanks
Nohsib | 2011/07/26 | ['https://Stackoverflow.com/questions/6824604', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/530993/'] | **Edit: See Prakash's answer, which is better for 2.1+.**
Try <http://developer.android.com/reference/android/webkit/WebSettings.html#getUserAgentString>
Note that this User Agent will only apply for the embedded WebKit browser that's used by default in Android. Unfortunately, you'll need to create a new WebView obje... | An alternative
```
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
String userAgent = WebSettings.getDefaultUserAgent(context);
}
``` |
6,824,604 | How to get the default HTTP USER AGENT and its default settings from the android device?
thanks
Nohsib | 2011/07/26 | ['https://Stackoverflow.com/questions/6824604', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/530993/'] | as Varundroid mentioned in his answer,
```
String userAgent = System.getProperty("http.agent");
```
is better way to do it for Android 2.1 and above.
====================
From android source code.
```
public static String getDefaultUserAgent() {
StringBuilder result = new StringBuilder(64);
result.appe... | When you use web view to access the user-agent, make sure you run the
`new WebView(this).getSettings().getUserAgentString();`
on the UI thread.
If you want access the user agent on background thread.
use
`System.getProperty("http.agent")`
To check whether a user-agent is valid or not use this
<https://deviceatlas... |
6,824,604 | How to get the default HTTP USER AGENT and its default settings from the android device?
thanks
Nohsib | 2011/07/26 | ['https://Stackoverflow.com/questions/6824604', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/530993/'] | as Varundroid mentioned in his answer,
```
String userAgent = System.getProperty("http.agent");
```
is better way to do it for Android 2.1 and above.
====================
From android source code.
```
public static String getDefaultUserAgent() {
StringBuilder result = new StringBuilder(64);
result.appe... | An alternative
```
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
String userAgent = WebSettings.getDefaultUserAgent(context);
}
``` |
6,824,604 | How to get the default HTTP USER AGENT and its default settings from the android device?
thanks
Nohsib | 2011/07/26 | ['https://Stackoverflow.com/questions/6824604', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/530993/'] | When you use web view to access the user-agent, make sure you run the
`new WebView(this).getSettings().getUserAgentString();`
on the UI thread.
If you want access the user agent on background thread.
use
`System.getProperty("http.agent")`
To check whether a user-agent is valid or not use this
<https://deviceatlas... | An alternative
```
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
String userAgent = WebSettings.getDefaultUserAgent(context);
}
``` |
19,532,982 | I tried to give `@Column(name = "message")` only for the field, but it didn't work.
I have a Bean class, that contains 10 fields but i want to insert only 2 fields using HIBERNATE ANNOTATION..?
How can i omit rest of the fields??
I am getting full Query:
```
insert into message (circle, day, destNumber, encryptedBod... | 2013/10/23 | ['https://Stackoverflow.com/questions/19532982', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2888996/'] | According to the [documentation](http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch05.html#mapping-declaration-property), you need to annotate the properties that you **don't** want to be persisted as `@Transient`:
```
@Entity
public class Message implements Serializable {
Long id;
int circle;
i... | For the MsgId issue
1.Make sure that your MsgId field is set to Primary key and auto increment
2.add these annotations for MsgId
>
> @Id
>
>
> @GeneratedValue(strategy=GenerationType.AUTO)
>
>
> public Long getMsgId() {
>
>
> return id;
>
>
> }
>
>
> |
19,532,982 | I tried to give `@Column(name = "message")` only for the field, but it didn't work.
I have a Bean class, that contains 10 fields but i want to insert only 2 fields using HIBERNATE ANNOTATION..?
How can i omit rest of the fields??
I am getting full Query:
```
insert into message (circle, day, destNumber, encryptedBod... | 2013/10/23 | ['https://Stackoverflow.com/questions/19532982', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2888996/'] | >
> Use Dynamic insert or dynamic-update
>
>
>
The dynamic-insert attribute tells Hibernate whether to include null properties in the SQL INSERT statement.
To update only modified values Use dynamic-update option
If dynamic-update set to true, then hibernate excludes unmodified properties in the Hibernate’s SQL... | For the MsgId issue
1.Make sure that your MsgId field is set to Primary key and auto increment
2.add these annotations for MsgId
>
> @Id
>
>
> @GeneratedValue(strategy=GenerationType.AUTO)
>
>
> public Long getMsgId() {
>
>
> return id;
>
>
> }
>
>
> |
47,113,078 | I have a matrix `A` of size 13472x1537. This matrix contains values smaller than 1. In my case I seek for a solution to satisfy the following condition:
If a column contains a value smaller than 1, replace all other values in the same column with `NaN`.
I was able to implement a code that could replace these values (s... | 2017/11/04 | ['https://Stackoverflow.com/questions/47113078', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7758301/'] | A version, which gets rid of the loop would look like this:
```
A = randn(5)+2; % Random example
[row,col] = find(A<1);
A(:,col) = NaN;
```
If you would want to keep the values smaller than 1 in the matrix a solution could look something like this:
```
A = randn(5)+2; % Random example
[row,col,ind] = find(A<1);
b =... | That would be like the following
```
for i = 1:size(A,2)
if ~isempty(find(A(:,i) <= 1))
A(:,i)=nan(size(A,1),1);
end
end
``` |
14,108,373 | I am developing an application in swing which has 5 tabs with following 5 operations on an image :No Operation ,Color Convert ,Affine Transform ,Convolve and Look Up.
Here is the code :
```
import java.awt.color.ColorSpace;
import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt... | 2013/01/01 | ['https://Stackoverflow.com/questions/14108373', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1460665/'] | The `LookupOp.filter` method says that:
*Performs a lookup operation on a BufferedImage. If the color model in the source image is not the same as that in the destination image, the pixels will be converted in the destination. If the destination image is null, a BufferedImage will be created with an appropriate ColorM... | You need to remove alpha channel from your image before using any filter on it. To make your code working, change:
```
try
{
source=ImageIO.read(new File("src/abc.jpg"));
} catch(IOException e){System.out.println("Exception Here :"+e);}
```
with this:
```
try
{
BufferedImage src = Imag... |
17,284,128 | It just occured to me I do not know how to best handle cases like these were I am retrieving an object from the disk, in this case I know it only is supposed to be of type `NSDictionary`. But it´s not good coding practice to make assumptions so... is the norm to do a check on which class it is and then convert it to Di... | 2013/06/24 | ['https://Stackoverflow.com/questions/17284128', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1526334/'] | You don't know how `initWithContentsOfFile` is implemented. Chances are that it checks the start of the file to see if it matches a dictionary and bails early if it doesn't (returning `nil`). It might be much more efficient than getting the data first.
As per the docs for `initWithContentsOfFile`, the method checks th... | Implementing persistence in the way you describe is quite fragile. Any little change can break your persistence solution and introduce unexpected errors. If you need light weight persistence, you may take a look at [Mantle from Github](https://github.com/github/Mantle). Mantle allows you to build a typed serializable m... |
17,284,128 | It just occured to me I do not know how to best handle cases like these were I am retrieving an object from the disk, in this case I know it only is supposed to be of type `NSDictionary`. But it´s not good coding practice to make assumptions so... is the norm to do a check on which class it is and then convert it to Di... | 2013/06/24 | ['https://Stackoverflow.com/questions/17284128', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1526334/'] | You don't know how `initWithContentsOfFile` is implemented. Chances are that it checks the start of the file to see if it matches a dictionary and bails early if it doesn't (returning `nil`). It might be much more efficient than getting the data first.
As per the docs for `initWithContentsOfFile`, the method checks th... | Persist first class models that make sense to your application. Implement `NSCoding`and use `NSKeyedArchiver` and `NSKeyedUnarchiver`. Or as @allprog suggests, go with Mantle, this is effectively what they're doing, they just make it less boilerplate code for you. |
7,603 | If my interpretation is correct, Kant argued in the Critique of pure reason and Prolegomena that:
>
> The existence of an external world guarantees that we can intuit, conceive, etc internally.
>
>
>
This argument bears that "transcendental" essence in it.
Now my question is:
Does the Brain-in-a-Vat thought exp... | 2013/07/18 | ['https://philosophy.stackexchange.com/questions/7603', 'https://philosophy.stackexchange.com', 'https://philosophy.stackexchange.com/users/1671/'] | >
> The existence of an external world guarantees that we can intuit,
> conceive, etc internally. Does the Brain-in-a-Vat thought experiment
> undermines Kant's transcendental argument above?
>
>
>
I think your central question is “Does external exist, and we conceive internally, if we are a brain in the vat?
An... | Kant was reacting to two positions - the wholly idealistic philosophy of Berkeley - which is a very rough equivalent to the 'brain in a vat' thought experiment which is more akin to classical solipsism - in which everything is mind and objective reality disappears, and the radical scepticism of Hume which totally under... |
29,314,841 | I want to use Raspberry PI's system command `raspistill`to take images in a c program, the program line is: `system("raspistill -q 5 -vf -hf -o pic1.jpg -t 1 -th 0:0:0");`
However, when I run the program sometimes error occurs,
it shows that:
>
> mmal\_vc\_component\_enable- failed to enable component- ENOSPC
> mm... | 2015/03/28 | ['https://Stackoverflow.com/questions/29314841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4407689/'] | In my case I ran the following on a Pi 4 model B
```
vcgencmd get_camera
supported=1 detected=1
raspistill -w 3280 -h 2464 -n -t 2000 -o test.png
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to ... | This error occurs when you use I/O during camera recording operation.
I faced the same issue on using used I/O while recording.
So you can either add before recording or after not in between. |
29,314,841 | I want to use Raspberry PI's system command `raspistill`to take images in a c program, the program line is: `system("raspistill -q 5 -vf -hf -o pic1.jpg -t 1 -th 0:0:0");`
However, when I run the program sometimes error occurs,
it shows that:
>
> mmal\_vc\_component\_enable- failed to enable component- ENOSPC
> mm... | 2015/03/28 | ['https://Stackoverflow.com/questions/29314841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4407689/'] | This error will appear when the RPi Camera is "On" and is streaming. The component: ENOSPC cannot start unless the RPi Camera is not streaming or being used by another process.
One solution is to try to stop the Camera stream before the Snapshot and then restart it after. | This error occurs when you use I/O during camera recording operation.
I faced the same issue on using used I/O while recording.
So you can either add before recording or after not in between. |
29,314,841 | I want to use Raspberry PI's system command `raspistill`to take images in a c program, the program line is: `system("raspistill -q 5 -vf -hf -o pic1.jpg -t 1 -th 0:0:0");`
However, when I run the program sometimes error occurs,
it shows that:
>
> mmal\_vc\_component\_enable- failed to enable component- ENOSPC
> mm... | 2015/03/28 | ['https://Stackoverflow.com/questions/29314841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4407689/'] | Stop any other processes using the camera (e.g.raspimjpeg)
```
$ ps -aux
```
// locate the process pid and kill it using the pid number (e.g. 764)
```
$ sudo kill 764
```
Note: You might have more than one process running so be sure to kill them all before trying again. | I use a Raspberry Pi 4 Model B and I had faced the same issue.
My solution was to **set the GPU Memory from 128 to 256** in the Raspberry Pi Configuration. |
29,314,841 | I want to use Raspberry PI's system command `raspistill`to take images in a c program, the program line is: `system("raspistill -q 5 -vf -hf -o pic1.jpg -t 1 -th 0:0:0");`
However, when I run the program sometimes error occurs,
it shows that:
>
> mmal\_vc\_component\_enable- failed to enable component- ENOSPC
> mm... | 2015/03/28 | ['https://Stackoverflow.com/questions/29314841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4407689/'] | Stop any other processes using the camera (e.g.raspimjpeg)
```
$ ps -aux
```
// locate the process pid and kill it using the pid number (e.g. 764)
```
$ sudo kill 764
```
Note: You might have more than one process running so be sure to kill them all before trying again. | This error occurs when you use I/O during camera recording operation.
I faced the same issue on using used I/O while recording.
So you can either add before recording or after not in between. |
29,314,841 | I want to use Raspberry PI's system command `raspistill`to take images in a c program, the program line is: `system("raspistill -q 5 -vf -hf -o pic1.jpg -t 1 -th 0:0:0");`
However, when I run the program sometimes error occurs,
it shows that:
>
> mmal\_vc\_component\_enable- failed to enable component- ENOSPC
> mm... | 2015/03/28 | ['https://Stackoverflow.com/questions/29314841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4407689/'] | finally i can solve this problem after a lot of hours troubleshooting.
I already share it in my YouTube (<https://youtu.be/on8UlkRvLok>)
This problem only occur in camera raspberry pi V2.1 (IMX219) from **Element14**. But in camera raspberry pi V2.1 from **OKdo**, i don't get this error
So, the solution when error
"... | This error occurs when you use I/O during camera recording operation.
I faced the same issue on using used I/O while recording.
So you can either add before recording or after not in between. |
29,314,841 | I want to use Raspberry PI's system command `raspistill`to take images in a c program, the program line is: `system("raspistill -q 5 -vf -hf -o pic1.jpg -t 1 -th 0:0:0");`
However, when I run the program sometimes error occurs,
it shows that:
>
> mmal\_vc\_component\_enable- failed to enable component- ENOSPC
> mm... | 2015/03/28 | ['https://Stackoverflow.com/questions/29314841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4407689/'] | Stop any other processes using the camera (e.g.raspimjpeg)
```
$ ps -aux
```
// locate the process pid and kill it using the pid number (e.g. 764)
```
$ sudo kill 764
```
Note: You might have more than one process running so be sure to kill them all before trying again. | finally i can solve this problem after a lot of hours troubleshooting.
I already share it in my YouTube (<https://youtu.be/on8UlkRvLok>)
This problem only occur in camera raspberry pi V2.1 (IMX219) from **Element14**. But in camera raspberry pi V2.1 from **OKdo**, i don't get this error
So, the solution when error
"... |
29,314,841 | I want to use Raspberry PI's system command `raspistill`to take images in a c program, the program line is: `system("raspistill -q 5 -vf -hf -o pic1.jpg -t 1 -th 0:0:0");`
However, when I run the program sometimes error occurs,
it shows that:
>
> mmal\_vc\_component\_enable- failed to enable component- ENOSPC
> mm... | 2015/03/28 | ['https://Stackoverflow.com/questions/29314841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4407689/'] | In my case I ran the following on a Pi 4 model B
```
vcgencmd get_camera
supported=1 detected=1
raspistill -w 3280 -h 2464 -n -t 2000 -o test.png
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to ... | I use a Raspberry Pi 4 Model B and I had faced the same issue.
My solution was to **set the GPU Memory from 128 to 256** in the Raspberry Pi Configuration. |
29,314,841 | I want to use Raspberry PI's system command `raspistill`to take images in a c program, the program line is: `system("raspistill -q 5 -vf -hf -o pic1.jpg -t 1 -th 0:0:0");`
However, when I run the program sometimes error occurs,
it shows that:
>
> mmal\_vc\_component\_enable- failed to enable component- ENOSPC
> mm... | 2015/03/28 | ['https://Stackoverflow.com/questions/29314841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4407689/'] | This error will appear when the RPi Camera is "On" and is streaming. The component: ENOSPC cannot start unless the RPi Camera is not streaming or being used by another process.
One solution is to try to stop the Camera stream before the Snapshot and then restart it after. | I use a Raspberry Pi 4 Model B and I had faced the same issue.
My solution was to **set the GPU Memory from 128 to 256** in the Raspberry Pi Configuration. |
29,314,841 | I want to use Raspberry PI's system command `raspistill`to take images in a c program, the program line is: `system("raspistill -q 5 -vf -hf -o pic1.jpg -t 1 -th 0:0:0");`
However, when I run the program sometimes error occurs,
it shows that:
>
> mmal\_vc\_component\_enable- failed to enable component- ENOSPC
> mm... | 2015/03/28 | ['https://Stackoverflow.com/questions/29314841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4407689/'] | Stop any other processes using the camera (e.g.raspimjpeg)
```
$ ps -aux
```
// locate the process pid and kill it using the pid number (e.g. 764)
```
$ sudo kill 764
```
Note: You might have more than one process running so be sure to kill them all before trying again. | This error will appear when the RPi Camera is "On" and is streaming. The component: ENOSPC cannot start unless the RPi Camera is not streaming or being used by another process.
One solution is to try to stop the Camera stream before the Snapshot and then restart it after. |
29,314,841 | I want to use Raspberry PI's system command `raspistill`to take images in a c program, the program line is: `system("raspistill -q 5 -vf -hf -o pic1.jpg -t 1 -th 0:0:0");`
However, when I run the program sometimes error occurs,
it shows that:
>
> mmal\_vc\_component\_enable- failed to enable component- ENOSPC
> mm... | 2015/03/28 | ['https://Stackoverflow.com/questions/29314841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4407689/'] | In my case I ran the following on a Pi 4 model B
```
vcgencmd get_camera
supported=1 detected=1
raspistill -w 3280 -h 2464 -n -t 2000 -o test.png
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to ... | This error will appear when the RPi Camera is "On" and is streaming. The component: ENOSPC cannot start unless the RPi Camera is not streaming or being used by another process.
One solution is to try to stop the Camera stream before the Snapshot and then restart it after. |
35,521,868 | I cannot change the color of this SVG Image: <http://uxrepo.com/download/pause-by-iconic/000000>
Here's the SVG's code:
```
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="1000" width="705">
<path d="M18 946.5l0 -893l223 0l0 893l-223 0zm446 0l0 -893l224 0l0 893l-224 0z" fill... | 2016/02/20 | ['https://Stackoverflow.com/questions/35521868', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/'] | Try using this:
```
let selectedTube = "circle"
let headers = ["cache-control": "no-cache",]
let request = NSMutableURLRequest(URL: NSURL(string: "https://api.tfl.gov.uk/Line/\(selectedTube)/Arrivals?app_id=6573044a&app_key=7a97df35339dc68625384077a5e07304")!,
... | I'm not quite sure what your problem is. The following code works just fine in a playground. I would suspect the problem lies within your custom `JSON` function:
```
import Foundation
let selectedTube = "Circle"
let url = NSURL(string: "https://api.tfl.gov.uk/Line/\(selectedTube)/Arrivals?app_id=6573044a&app_key=7a97... |
394,610 | I accidentally add a locale, e.g. sudo locale-gen zh\_TW
e.g. locale -a
```
zh_TW
```
But how to remove it? | 2012/06/01 | ['https://serverfault.com/questions/394610', 'https://serverfault.com', 'https://serverfault.com/users/50774/'] | I think you can do this by editing `/var/lib/locales/supported.d/local` and removing that locale. Then run `locale-gen` to regenerate the compiled locales. | You can also reconfigure the locales package using `dpkg-reconfigure locales`. |
394,610 | I accidentally add a locale, e.g. sudo locale-gen zh\_TW
e.g. locale -a
```
zh_TW
```
But how to remove it? | 2012/06/01 | ['https://serverfault.com/questions/394610', 'https://serverfault.com', 'https://serverfault.com/users/50774/'] | I think you can do this by editing `/var/lib/locales/supported.d/local` and removing that locale. Then run `locale-gen` to regenerate the compiled locales. | **Which locales are installed on my machine?**
You can check which locales are generated and configured on your system using the locale command:
* **`locale`** ... list the current locale configuration
* **`locale -a`** ... lists all all locales that were generated on your system
* **`locale -a -v`** ... list all loc... |
394,610 | I accidentally add a locale, e.g. sudo locale-gen zh\_TW
e.g. locale -a
```
zh_TW
```
But how to remove it? | 2012/06/01 | ['https://serverfault.com/questions/394610', 'https://serverfault.com', 'https://serverfault.com/users/50774/'] | I think you can do this by editing `/var/lib/locales/supported.d/local` and removing that locale. Then run `locale-gen` to regenerate the compiled locales. | **Note:** Some of the commands below require root privileges, consider the use of `sudo`.
### Basic info
According to [`man locale-gen`](http://manpages.ubuntu.com/manpages/jammy/man8/locale-gen.8.html), locales are set in several files.
>
> `/etc/locale.gen`
>
>
> The main configuration file, which has a simple ... |
394,610 | I accidentally add a locale, e.g. sudo locale-gen zh\_TW
e.g. locale -a
```
zh_TW
```
But how to remove it? | 2012/06/01 | ['https://serverfault.com/questions/394610', 'https://serverfault.com', 'https://serverfault.com/users/50774/'] | I think you can do this by editing `/var/lib/locales/supported.d/local` and removing that locale. Then run `locale-gen` to regenerate the compiled locales. | I am unsure why the most Distributions and Users are unaware from [localepurge](https://manpages.ubuntu.com/manpages/kinetic/en/man8/localepurge.8.html)
For Debian based Systems, should it be available by
```bash
apt-get install localepurge
```
From the Manpage:
>
> localepurge is a small script to recover disk s... |
394,610 | I accidentally add a locale, e.g. sudo locale-gen zh\_TW
e.g. locale -a
```
zh_TW
```
But how to remove it? | 2012/06/01 | ['https://serverfault.com/questions/394610', 'https://serverfault.com', 'https://serverfault.com/users/50774/'] | You can also reconfigure the locales package using `dpkg-reconfigure locales`. | **Note:** Some of the commands below require root privileges, consider the use of `sudo`.
### Basic info
According to [`man locale-gen`](http://manpages.ubuntu.com/manpages/jammy/man8/locale-gen.8.html), locales are set in several files.
>
> `/etc/locale.gen`
>
>
> The main configuration file, which has a simple ... |
394,610 | I accidentally add a locale, e.g. sudo locale-gen zh\_TW
e.g. locale -a
```
zh_TW
```
But how to remove it? | 2012/06/01 | ['https://serverfault.com/questions/394610', 'https://serverfault.com', 'https://serverfault.com/users/50774/'] | You can also reconfigure the locales package using `dpkg-reconfigure locales`. | I am unsure why the most Distributions and Users are unaware from [localepurge](https://manpages.ubuntu.com/manpages/kinetic/en/man8/localepurge.8.html)
For Debian based Systems, should it be available by
```bash
apt-get install localepurge
```
From the Manpage:
>
> localepurge is a small script to recover disk s... |
394,610 | I accidentally add a locale, e.g. sudo locale-gen zh\_TW
e.g. locale -a
```
zh_TW
```
But how to remove it? | 2012/06/01 | ['https://serverfault.com/questions/394610', 'https://serverfault.com', 'https://serverfault.com/users/50774/'] | **Which locales are installed on my machine?**
You can check which locales are generated and configured on your system using the locale command:
* **`locale`** ... list the current locale configuration
* **`locale -a`** ... lists all all locales that were generated on your system
* **`locale -a -v`** ... list all loc... | **Note:** Some of the commands below require root privileges, consider the use of `sudo`.
### Basic info
According to [`man locale-gen`](http://manpages.ubuntu.com/manpages/jammy/man8/locale-gen.8.html), locales are set in several files.
>
> `/etc/locale.gen`
>
>
> The main configuration file, which has a simple ... |
394,610 | I accidentally add a locale, e.g. sudo locale-gen zh\_TW
e.g. locale -a
```
zh_TW
```
But how to remove it? | 2012/06/01 | ['https://serverfault.com/questions/394610', 'https://serverfault.com', 'https://serverfault.com/users/50774/'] | **Which locales are installed on my machine?**
You can check which locales are generated and configured on your system using the locale command:
* **`locale`** ... list the current locale configuration
* **`locale -a`** ... lists all all locales that were generated on your system
* **`locale -a -v`** ... list all loc... | I am unsure why the most Distributions and Users are unaware from [localepurge](https://manpages.ubuntu.com/manpages/kinetic/en/man8/localepurge.8.html)
For Debian based Systems, should it be available by
```bash
apt-get install localepurge
```
From the Manpage:
>
> localepurge is a small script to recover disk s... |
394,610 | I accidentally add a locale, e.g. sudo locale-gen zh\_TW
e.g. locale -a
```
zh_TW
```
But how to remove it? | 2012/06/01 | ['https://serverfault.com/questions/394610', 'https://serverfault.com', 'https://serverfault.com/users/50774/'] | **Note:** Some of the commands below require root privileges, consider the use of `sudo`.
### Basic info
According to [`man locale-gen`](http://manpages.ubuntu.com/manpages/jammy/man8/locale-gen.8.html), locales are set in several files.
>
> `/etc/locale.gen`
>
>
> The main configuration file, which has a simple ... | I am unsure why the most Distributions and Users are unaware from [localepurge](https://manpages.ubuntu.com/manpages/kinetic/en/man8/localepurge.8.html)
For Debian based Systems, should it be available by
```bash
apt-get install localepurge
```
From the Manpage:
>
> localepurge is a small script to recover disk s... |
70,755,860 | I have done until now to create a button and inside a tag button I have created another div with class background to give same property for animation effects when click on button.
But I am not sure if in this way is regular syntax for HTML to put another div into tag button in my case?
I AM SHARING MY CODE:
```css
... | 2022/01/18 | ['https://Stackoverflow.com/questions/70755860', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15796964/'] | The issue in your approach is that you are setting the background `width` and `height` to 1:1 proportions. This would make circle for a square button. For you to create circle you need to make it proportional to the width and height of your button. For example:
```css
button {
height: 73px;
min-width: ... | ```
button:hover .background {
width: 120%;
height: 300%;
}
``` |
33,325,137 | **Problem**
I would like to use the [MailGun](https://documentation.mailgun.com/quickstart-sending.html#how-to-start-sending-email) service to send emails from a pure Swift app.
**Research So Far**
As I understand it, [there are two methods to send an email](https://documentation.mailgun.com/quickstart-sending.html#... | 2015/10/25 | ['https://Stackoverflow.com/questions/33325137', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3892545/'] | In python, the `auth` is being passed in the header.
You have to do a http post request, passing both the header and the body.
This is a working code:
```
func test() {
let session = NSURLSession.sharedSession()
let request = NSMutableURLRequest(URL: NSURL(string: "https://api.mailgun.net/v3/sandbox... | [`requests.post`](http://docs.python-requests.org/en/latest/user/quickstart/#more-complicated-post-requests) sends an HTTP POST request, encoding key/value pairs as `application/x-www-form-urlencoded`. You need to do the same.
* convert the set of key-value pairs into `application/x-www-form-urlencoded` as per [How to... |
33,325,137 | **Problem**
I would like to use the [MailGun](https://documentation.mailgun.com/quickstart-sending.html#how-to-start-sending-email) service to send emails from a pure Swift app.
**Research So Far**
As I understand it, [there are two methods to send an email](https://documentation.mailgun.com/quickstart-sending.html#... | 2015/10/25 | ['https://Stackoverflow.com/questions/33325137', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3892545/'] | people are getting 400 or 401 errors because none of the other answers construct the url correctly. here is some code that works in swift 5 and iOS15:
```
func sendEmail() {
// variablize our https path with API key, recipient and message text
let mailgunAPIPath = "https://api:YOUR_API_KEY@api.mailgun.net/v3/Y... | [`requests.post`](http://docs.python-requests.org/en/latest/user/quickstart/#more-complicated-post-requests) sends an HTTP POST request, encoding key/value pairs as `application/x-www-form-urlencoded`. You need to do the same.
* convert the set of key-value pairs into `application/x-www-form-urlencoded` as per [How to... |
33,325,137 | **Problem**
I would like to use the [MailGun](https://documentation.mailgun.com/quickstart-sending.html#how-to-start-sending-email) service to send emails from a pure Swift app.
**Research So Far**
As I understand it, [there are two methods to send an email](https://documentation.mailgun.com/quickstart-sending.html#... | 2015/10/25 | ['https://Stackoverflow.com/questions/33325137', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3892545/'] | In python, the `auth` is being passed in the header.
You have to do a http post request, passing both the header and the body.
This is a working code:
```
func test() {
let session = NSURLSession.sharedSession()
let request = NSMutableURLRequest(URL: NSURL(string: "https://api.mailgun.net/v3/sandbox... | I spent hours trying to get the selected answer working, but to no avail.
Although I was finally able to get this working properly with a large HTTP response. I put the full path into Keys.plist so that I can upload my code to github and broke out some of the arguments into variables so I can have them programmaticall... |
33,325,137 | **Problem**
I would like to use the [MailGun](https://documentation.mailgun.com/quickstart-sending.html#how-to-start-sending-email) service to send emails from a pure Swift app.
**Research So Far**
As I understand it, [there are two methods to send an email](https://documentation.mailgun.com/quickstart-sending.html#... | 2015/10/25 | ['https://Stackoverflow.com/questions/33325137', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3892545/'] | In python, the `auth` is being passed in the header.
You have to do a http post request, passing both the header and the body.
This is a working code:
```
func test() {
let session = NSURLSession.sharedSession()
let request = NSMutableURLRequest(URL: NSURL(string: "https://api.mailgun.net/v3/sandbox... | Swift 3 answer:
```
func test() {
let session = URLSession.shared
var request = URLRequest(url: URL(string: "https://api.mailgun.net/v3/sandbox(Personal info).mailgun.org/messages")!)
request.httpMethod = "POST"
let data = "from: Excited User <(Personal info)>&to: [bar@example.com,(... |
33,325,137 | **Problem**
I would like to use the [MailGun](https://documentation.mailgun.com/quickstart-sending.html#how-to-start-sending-email) service to send emails from a pure Swift app.
**Research So Far**
As I understand it, [there are two methods to send an email](https://documentation.mailgun.com/quickstart-sending.html#... | 2015/10/25 | ['https://Stackoverflow.com/questions/33325137', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3892545/'] | In python, the `auth` is being passed in the header.
You have to do a http post request, passing both the header and the body.
This is a working code:
```
func test() {
let session = NSURLSession.sharedSession()
let request = NSMutableURLRequest(URL: NSURL(string: "https://api.mailgun.net/v3/sandbox... | people are getting 400 or 401 errors because none of the other answers construct the url correctly. here is some code that works in swift 5 and iOS15:
```
func sendEmail() {
// variablize our https path with API key, recipient and message text
let mailgunAPIPath = "https://api:YOUR_API_KEY@api.mailgun.net/v3/Y... |
33,325,137 | **Problem**
I would like to use the [MailGun](https://documentation.mailgun.com/quickstart-sending.html#how-to-start-sending-email) service to send emails from a pure Swift app.
**Research So Far**
As I understand it, [there are two methods to send an email](https://documentation.mailgun.com/quickstart-sending.html#... | 2015/10/25 | ['https://Stackoverflow.com/questions/33325137', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3892545/'] | people are getting 400 or 401 errors because none of the other answers construct the url correctly. here is some code that works in swift 5 and iOS15:
```
func sendEmail() {
// variablize our https path with API key, recipient and message text
let mailgunAPIPath = "https://api:YOUR_API_KEY@api.mailgun.net/v3/Y... | I spent hours trying to get the selected answer working, but to no avail.
Although I was finally able to get this working properly with a large HTTP response. I put the full path into Keys.plist so that I can upload my code to github and broke out some of the arguments into variables so I can have them programmaticall... |
33,325,137 | **Problem**
I would like to use the [MailGun](https://documentation.mailgun.com/quickstart-sending.html#how-to-start-sending-email) service to send emails from a pure Swift app.
**Research So Far**
As I understand it, [there are two methods to send an email](https://documentation.mailgun.com/quickstart-sending.html#... | 2015/10/25 | ['https://Stackoverflow.com/questions/33325137', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3892545/'] | people are getting 400 or 401 errors because none of the other answers construct the url correctly. here is some code that works in swift 5 and iOS15:
```
func sendEmail() {
// variablize our https path with API key, recipient and message text
let mailgunAPIPath = "https://api:YOUR_API_KEY@api.mailgun.net/v3/Y... | Swift 3 answer:
```
func test() {
let session = URLSession.shared
var request = URLRequest(url: URL(string: "https://api.mailgun.net/v3/sandbox(Personal info).mailgun.org/messages")!)
request.httpMethod = "POST"
let data = "from: Excited User <(Personal info)>&to: [bar@example.com,(... |
2,428,907 | $$\lim\_{x\to0}\frac{\sin^2(3x)}{x^2\cos x}=\lim\_{u\to0}\frac{\sin^2(u)}{\left(\dfrac u3\right)^2}=9\left(\lim\_{u\to0}\frac{\sin u}u\right)^2.$$
>
> A bit of confusion on the little steps that are missing. 1. Why does $\sin(x)$ go away. It is because $\cos(0)=1$? 2. How does the change of variable work, completely ... | 2017/09/14 | ['https://math.stackexchange.com/questions/2428907', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/418493/'] | Hint:$$\quad{\lim\_{x\to0}\frac{\sin^2(3x)}{x^2\cos x}=\\\lim\_{x\to0}\frac{\sin(3x)}{x}.\lim\_{x\to0}\frac{\sin(3x)}{x}.\lim\_{x\to0}\frac{1}{\cos x}=\\
\lim\_{x\to0}\color{red} {3}\frac{\sin(3x)}{\color{red} {3}x}.\lim\_{x\to0}\color{red} {3}\frac{\sin(3x)}{\color{red} {3}x}.\lim\_{x\to0}\frac{1}{\cos x}=\\
\color{re... | $$\lim\_{x\to0}\frac{\sin^2(3x)}{x^2\cos x}=3^2\left(\lim\_{x\to0}\dfrac{\sin3x}{3x}\right)^2\cdot\dfrac1{\lim\_{x\to0}\cos x}=?$$ |
846,695 | Is $\delta \_{mn}=1$ when $m\neq n$, and $\delta \_{mm}=0$?
I am not very good at Math. So would you give me the answer and explanation please? | 2014/06/25 | ['https://math.stackexchange.com/questions/846695', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/135962/'] | You got it. [For example, this.](http://www.wolframalpha.com/input/?i=sin%20300) What is your worry? | $$\cos^2\theta + \sin^2\theta = 1^2$$
$$r^2(\cos^2\theta + \sin^2\theta) = r^2(1^2)$$
$$(r\cos\theta)^2 + (r\sin\theta)^2 = r^2$$
$$x^2+y^2 = r^2$$
Draw a circle of radius 2. For what values of $\theta$ would the y-coordinate of the circle $x^2+y^2=2^2$ intersect the line $y = -\sqrt{3}$?
![enter image description h... |
26,900,359 | Currently i am designing WPF application using MahApps.Metro style UI.
Tile control which provided by MahApps can not showing icon in center of tile
I saw example in MahApps website where it could show image as tile background, but I couldn't figure out how to show icon instead of image (icon such as IE logo, people l... | 2014/11/13 | ['https://Stackoverflow.com/questions/26900359', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3540114/'] | i figure it out
use icons.xaml as resource, and add rectangle control inside tile, here is the example on how to show character inside tile control
```
<Controls:Tile x:Name="mahTileExit" Background="Green" Foreground="Yellow" Title="Exit" Width="100" Height="100" TiltFactor ="4" Margin="936,404,0,0" VerticalAli... | You can use [FontAwesome.Wpf](https://github.com/charri/Font-Awesome-WPF/blob/master/README-WPF.md) which has more icons and requires less code.
```
<Controls:Tile Width="300" Height="150" Grid.Column="0" Grid.Row="1" Title="Hello!">
<Grid Width="50" Height="50">
<fa:ImageAwesome Icon="Flag" Foreground="#F... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.