qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
360,559 | I am trying to install Debian but i don't know how to partition it. I have an 1tb hard disk. I want to give 60gb for debian files,2gb for swap and want to use the others for media files. What is /,/home,/usr/local? | 2017/04/22 | [
"https://unix.stackexchange.com/questions/360559",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/227559/"
] | On my machine the solution is to add
```
set -g default-terminal "xterm-256color"
```
to `~/.tmux.conf`. | ### Change $TERM to xterm-256color
No color:
```
$ echo $TERM
screen
```
With color:
```
TERM=xterm-256color
```
Add this to your dotfile.
### Remarks
This may not be the OPs situation but in case anyone else has landed on this page with this situation I'm hoping i... |
360,559 | I am trying to install Debian but i don't know how to partition it. I have an 1tb hard disk. I want to give 60gb for debian files,2gb for swap and want to use the others for media files. What is /,/home,/usr/local? | 2017/04/22 | [
"https://unix.stackexchange.com/questions/360559",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/227559/"
] | ### Change $TERM to xterm-256color
No color:
```
$ echo $TERM
screen
```
With color:
```
TERM=xterm-256color
```
Add this to your dotfile.
### Remarks
This may not be the OPs situation but in case anyone else has landed on this page with this situation I'm hoping i... | I had this issue when working on Ubuntu 20.04.
While [Panki's answer](https://unix.stackexchange.com/a/493472/390383) worked for me, I found myself always specifying `source ~/.bashrc` whenever I logged into **Tmux** shell following [evaristegd](https://unix.stackexchange.com/users/324019/evaristegd)'s comment.
**Her... |
6,781,919 | For a website powered by Liferay EE 6.0 SP1, there will be cases where some pages will need to "share" the same instance of certain portlets, but other pages will have their own instances.
For example (contrived, but hopefully illustrative), consider a portlet with a preference that changes the portlet's background co... | 2011/07/21 | [
"https://Stackoverflow.com/questions/6781919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It looks like the way to go is to create named sets of settings and let each page have its own instance of the portlet.
In the example from the OP, the Products page would have a unique instance of the portlet which would be configured to use e.g., the "orange" setting set. Any changes made to the portlet's settings w... | You're having a custom portlet of your own and you want it to be instanceable or non-instanceable depending on the placement where it is deployed, right? *(As said on the link on your comment)*
One possibility is to deploy another version of your portlet with slightly different name (portlet1 vs. portlet2) and now on ... |
6,781,919 | For a website powered by Liferay EE 6.0 SP1, there will be cases where some pages will need to "share" the same instance of certain portlets, but other pages will have their own instances.
For example (contrived, but hopefully illustrative), consider a portlet with a preference that changes the portlet's background co... | 2011/07/21 | [
"https://Stackoverflow.com/questions/6781919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It looks like the way to go is to create named sets of settings and let each page have its own instance of the portlet.
In the example from the OP, the Products page would have a unique instance of the portlet which would be configured to use e.g., the "orange" setting set. Any changes made to the portlet's settings w... | Yes, this is possible by creating non-instancable portlet, and using a scope for those pages. Here's Liferay wiki page on scopes: <http://www.liferay.com/community/wiki/-/wiki/Main/Scope>
UPD:
There are also a couple of Liferay-specific settings that allow you to control scope for portlet preferences: "preferences-co... |
53,006,461 | I have a number.
num = 5
I want to create a pattern of question marks i.e **'(?,?,?,....n times)'** where n is the number.
in this case the output should be string containing **5** Question marks seperated by comma.
```
(?,?,?,?,?) #dtype str
```
I tried it using the below method:
```
q = '?'
q2 = '('+q
num =... | 2018/10/26 | [
"https://Stackoverflow.com/questions/53006461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6803114/"
] | Try this:
```
s = '({})'.format(','.join('?' for _ in range(5)))
print(s)
```
**Output**
```
(?,?,?,?,?)
```
Or:
```
s = '({})'.format(','.join('?' * 5))
```
**Explanation**
1. The first approach creates a generator using [range](https://docs.python.org/3/library/functions.html#func-range) and [join](https:/... | You can try:
```
>>> '('+','.join(num*["?"])+')'
'(?,?,?,?,?)'
``` |
53,006,461 | I have a number.
num = 5
I want to create a pattern of question marks i.e **'(?,?,?,....n times)'** where n is the number.
in this case the output should be string containing **5** Question marks seperated by comma.
```
(?,?,?,?,?) #dtype str
```
I tried it using the below method:
```
q = '?'
q2 = '('+q
num =... | 2018/10/26 | [
"https://Stackoverflow.com/questions/53006461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6803114/"
] | Try this:
```
s = '({})'.format(','.join('?' for _ in range(5)))
print(s)
```
**Output**
```
(?,?,?,?,?)
```
Or:
```
s = '({})'.format(','.join('?' * 5))
```
**Explanation**
1. The first approach creates a generator using [range](https://docs.python.org/3/library/functions.html#func-range) and [join](https:/... | Here you go
```
'(' + ','.join('?'*num) + ')'
``` |
53,006,461 | I have a number.
num = 5
I want to create a pattern of question marks i.e **'(?,?,?,....n times)'** where n is the number.
in this case the output should be string containing **5** Question marks seperated by comma.
```
(?,?,?,?,?) #dtype str
```
I tried it using the below method:
```
q = '?'
q2 = '('+q
num =... | 2018/10/26 | [
"https://Stackoverflow.com/questions/53006461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6803114/"
] | Try this:
```
s = '({})'.format(','.join('?' for _ in range(5)))
print(s)
```
**Output**
```
(?,?,?,?,?)
```
Or:
```
s = '({})'.format(','.join('?' * 5))
```
**Explanation**
1. The first approach creates a generator using [range](https://docs.python.org/3/library/functions.html#func-range) and [join](https:/... | ```
print(f"({','.join(['?'] * n)})")
``` |
53,006,461 | I have a number.
num = 5
I want to create a pattern of question marks i.e **'(?,?,?,....n times)'** where n is the number.
in this case the output should be string containing **5** Question marks seperated by comma.
```
(?,?,?,?,?) #dtype str
```
I tried it using the below method:
```
q = '?'
q2 = '('+q
num =... | 2018/10/26 | [
"https://Stackoverflow.com/questions/53006461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6803114/"
] | Try this:
```
s = '({})'.format(','.join('?' for _ in range(5)))
print(s)
```
**Output**
```
(?,?,?,?,?)
```
Or:
```
s = '({})'.format(','.join('?' * 5))
```
**Explanation**
1. The first approach creates a generator using [range](https://docs.python.org/3/library/functions.html#func-range) and [join](https:/... | I would assemble the string using f-string syntax, as it allows to use a higher level abstraction after the more basic logic is sorted out:
```
q = '?'
n = 5
s = ",".join(q*n) # You get a string without parenthesis: '?,?,?,?,?'
print(f'({s})') # Here you are adding the parenthesis
```
There are several ways to do i... |
53,006,461 | I have a number.
num = 5
I want to create a pattern of question marks i.e **'(?,?,?,....n times)'** where n is the number.
in this case the output should be string containing **5** Question marks seperated by comma.
```
(?,?,?,?,?) #dtype str
```
I tried it using the below method:
```
q = '?'
q2 = '('+q
num =... | 2018/10/26 | [
"https://Stackoverflow.com/questions/53006461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6803114/"
] | You can try:
```
>>> '('+','.join(num*["?"])+')'
'(?,?,?,?,?)'
``` | I would assemble the string using f-string syntax, as it allows to use a higher level abstraction after the more basic logic is sorted out:
```
q = '?'
n = 5
s = ",".join(q*n) # You get a string without parenthesis: '?,?,?,?,?'
print(f'({s})') # Here you are adding the parenthesis
```
There are several ways to do i... |
53,006,461 | I have a number.
num = 5
I want to create a pattern of question marks i.e **'(?,?,?,....n times)'** where n is the number.
in this case the output should be string containing **5** Question marks seperated by comma.
```
(?,?,?,?,?) #dtype str
```
I tried it using the below method:
```
q = '?'
q2 = '('+q
num =... | 2018/10/26 | [
"https://Stackoverflow.com/questions/53006461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6803114/"
] | Here you go
```
'(' + ','.join('?'*num) + ')'
``` | I would assemble the string using f-string syntax, as it allows to use a higher level abstraction after the more basic logic is sorted out:
```
q = '?'
n = 5
s = ",".join(q*n) # You get a string without parenthesis: '?,?,?,?,?'
print(f'({s})') # Here you are adding the parenthesis
```
There are several ways to do i... |
53,006,461 | I have a number.
num = 5
I want to create a pattern of question marks i.e **'(?,?,?,....n times)'** where n is the number.
in this case the output should be string containing **5** Question marks seperated by comma.
```
(?,?,?,?,?) #dtype str
```
I tried it using the below method:
```
q = '?'
q2 = '('+q
num =... | 2018/10/26 | [
"https://Stackoverflow.com/questions/53006461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6803114/"
] | ```
print(f"({','.join(['?'] * n)})")
``` | I would assemble the string using f-string syntax, as it allows to use a higher level abstraction after the more basic logic is sorted out:
```
q = '?'
n = 5
s = ",".join(q*n) # You get a string without parenthesis: '?,?,?,?,?'
print(f'({s})') # Here you are adding the parenthesis
```
There are several ways to do i... |
29,300,441 | I have a string like this ,
```
NSString *strTest = @"Hii how are you doing @Ravi , how do u do @Kiran where are you @Varun";
```
I want a substring from the above string which contains only the words which starts with '@'
i.e I need
```
NSString *strSubstring = @"Ravi @kiran @varun";
```
Please help me o... | 2015/03/27 | [
"https://Stackoverflow.com/questions/29300441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2289480/"
] | Separate the string like below :-
```
NSArray * names = [myString componentsSeparatedByString:@" "];
```
names array will now contain all the words in the string, now you can iterate over the array and check which of its index contains "@" character.
If you find "@", store that index value in some variable. | you will love implementing this code. I have used a regular expression to perform the job. It will give you the matching strings.
```
NSString *strTest = @"Hii how are you doing @Ravi , how do u do @Kiran where are you @Varun";
NSError *error;
//&[^;]*;
NSRegularExpression *exp =[NSRegularExpression regularExpression... |
13,566,856 | I am trying to target following with jQuery:
```
<link rel="stylesheet" href="css/test.css">
```
What I cannot figure out is how to set default path (css folder) ?
```
<button data-button="test">Just a Test</button>
<script>
var button = $('button'),
link = $('link'),
stylesheet = $(this).data('button');
... | 2012/11/26 | [
"https://Stackoverflow.com/questions/13566856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1293740/"
] | As easy as this
```
link.attr('href', 'css/' + stylesheet + '.css');
``` | Why don't you simply mention the path `css/` in the code itself
```
link.attr('href', 'css/'+stylesheet + '.css');
```
To answer to your other question,
`var $something` and `var something` are both valid variable names. Your pick. |
13,566,856 | I am trying to target following with jQuery:
```
<link rel="stylesheet" href="css/test.css">
```
What I cannot figure out is how to set default path (css folder) ?
```
<button data-button="test">Just a Test</button>
<script>
var button = $('button'),
link = $('link'),
stylesheet = $(this).data('button');
... | 2012/11/26 | [
"https://Stackoverflow.com/questions/13566856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1293740/"
] | As easy as this
```
link.attr('href', 'css/' + stylesheet + '.css');
``` | If you want to switch stylesheet, you should use [alternate stylesheets](http://www.w3.org/Style/Examples/007/alternatives.en.html) instead.
```
<link rel="alternate stylesheet" href="css/test1.css">
<link rel="alternate stylesheet" href="css/test2.css" disabled>
```
In jQuery you can then remove/add the `disabled` ... |
29,903,228 | in iOS I would simply use this;
```
if (arc4random() % 2 == 0) {
//Do 1 Thing
}else{
// Do another
}
```
What would be the same method but using Unity3D for that ? | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4403689/"
] | Try go to the new Azure portal (preview portal), browse to your API App and set the **App Service Plan/Pricing Tier** to **Standard**.
I am having problem too when I first deployed my API App in Azure with the default App Service Plan and it seems like there is no instance created for the API App when it's the Free pl... | The process I use when the deployed version does not work is.
1. Set access to public - to remove gateway introduced issues.
2. Check a known end point api - https:\|xxxxx\yourapi
3. Turn on Remote Errors in web.config
4. Resolve any missing references not included in build (set Copy to Output Directory to true)
5. Re... |
29,903,228 | in iOS I would simply use this;
```
if (arc4random() % 2 == 0) {
//Do 1 Thing
}else{
// Do another
}
```
What would be the same method but using Unity3D for that ? | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4403689/"
] | Try go to the new Azure portal (preview portal), browse to your API App and set the **App Service Plan/Pricing Tier** to **Standard**.
I am having problem too when I first deployed my API App in Azure with the default App Service Plan and it seems like there is no instance created for the API App when it's the Free pl... | You have to just update the Swashbuckle version and everything working fine
* Install-Package Swashbuckle -Version 5.2.2 is not working
* Install-Package Swashbuckle -Version 5.2.1 is working perfectly |
29,903,228 | in iOS I would simply use this;
```
if (arc4random() % 2 == 0) {
//Do 1 Thing
}else{
// Do another
}
```
What would be the same method but using Unity3D for that ? | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4403689/"
] | Try go to the new Azure portal (preview portal), browse to your API App and set the **App Service Plan/Pricing Tier** to **Standard**.
I am having problem too when I first deployed my API App in Azure with the default App Service Plan and it seems like there is no instance created for the API App when it's the Free pl... | I had the same issue and it was solved by upgrading the service plan and updating the nuget package. |
29,903,228 | in iOS I would simply use this;
```
if (arc4random() % 2 == 0) {
//Do 1 Thing
}else{
// Do another
}
```
What would be the same method but using Unity3D for that ? | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4403689/"
] | Try go to the new Azure portal (preview portal), browse to your API App and set the **App Service Plan/Pricing Tier** to **Standard**.
I am having problem too when I first deployed my API App in Azure with the default App Service Plan and it seems like there is no instance created for the API App when it's the Free pl... | Ran across this recently and found that the app.UseSwaggerUI in the Config method of Startup.cs was wrapped in a If Debug Compiler directive. Not sure if it was a developer or part of an Automated template but thoutght it worth mentioning. |
29,903,228 | in iOS I would simply use this;
```
if (arc4random() % 2 == 0) {
//Do 1 Thing
}else{
// Do another
}
```
What would be the same method but using Unity3D for that ? | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4403689/"
] | Ran across this recently and found that the app.UseSwaggerUI in the Config method of Startup.cs was wrapped in a If Debug Compiler directive. Not sure if it was a developer or part of an Automated template but thoutght it worth mentioning. | The process I use when the deployed version does not work is.
1. Set access to public - to remove gateway introduced issues.
2. Check a known end point api - https:\|xxxxx\yourapi
3. Turn on Remote Errors in web.config
4. Resolve any missing references not included in build (set Copy to Output Directory to true)
5. Re... |
29,903,228 | in iOS I would simply use this;
```
if (arc4random() % 2 == 0) {
//Do 1 Thing
}else{
// Do another
}
```
What would be the same method but using Unity3D for that ? | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4403689/"
] | Ran across this recently and found that the app.UseSwaggerUI in the Config method of Startup.cs was wrapped in a If Debug Compiler directive. Not sure if it was a developer or part of an Automated template but thoutght it worth mentioning. | You have to just update the Swashbuckle version and everything working fine
* Install-Package Swashbuckle -Version 5.2.2 is not working
* Install-Package Swashbuckle -Version 5.2.1 is working perfectly |
29,903,228 | in iOS I would simply use this;
```
if (arc4random() % 2 == 0) {
//Do 1 Thing
}else{
// Do another
}
```
What would be the same method but using Unity3D for that ? | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4403689/"
] | Ran across this recently and found that the app.UseSwaggerUI in the Config method of Startup.cs was wrapped in a If Debug Compiler directive. Not sure if it was a developer or part of an Automated template but thoutght it worth mentioning. | I had the same issue and it was solved by upgrading the service plan and updating the nuget package. |
468,495 | My short example `.tex` line is:
```
$\myCommand$ or $\boldsymbol{d}_{x}^{\textrm{word1},\textrm{word2}}$
```
Where I have defined:
```
\newcommand{\myCommand}{
\boldsymbol{d}_{x}^{\textrm{word1},\textrm{word2}} %identical to second version
}
```
Yet the result has very noticeably different sizes for the supe... | 2019/01/04 | [
"https://tex.stackexchange.com/questions/468495",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/178811/"
] | To achieve automatic equation line breaking, `breqn` has to make drastic changes. These changes include, unfortunately, the primitive `\mathchoice` (in the supplementary package `mathstyle`). This change breaks `amstext`βs `\text`, which uses `\mathchoice`.
We have two more options here (in addition to removing `breqn... | As I don't want to leave this question hanging for others: this issue was caused by the inclusion of:
```
\usepackage{breqn}
```
in the preamble. Simply including the package above with no other options, and the superscript texts will be incorrect in macros but not in normal mathmode, which is a strange incompatibil... |
480,026 | I use Ubuntu 18.04 with Ansible installed this way:
```
apt-get update -y
install software-properties-common
apt-add-repository ppa:ansible/ansible
apt install ansible
```
I also have a small Bash script I store in GitHub that I sometimes copy-paste into the terminal of remote machines I hire to store my own website... | 2018/11/06 | [
"https://unix.stackexchange.com/questions/480026",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/-1/"
] | Just copy the playbook file to the new host and play it to the local host using the following yaml directives:
* `hosts: 127.0.0.1`: The `localhost` address [for nearly any machine](https://en.wikipedia.org/wiki/Localhost).
* `connection: local`: A yaml direction for the type of connection; given we work locally in th... | From the Ansible Docs:
```
- name: Install a list of packages
apt:
name: "{{ packages }}"
vars:
packages:
- foo
- foo-tools
- name: Download foo.conf
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
mode: 0440
```
Since this is written in Ansible Playbook forma... |
16,492,600 | I am modeling a complex purchasing workflow in Rails that converts Requisitions to Orders. I'm using FactoryGirl to do my testing and all is well, until I try to test the OrderLineItem, which depends on an Order and a Quote, which each depend on other objects, and so on...
The test in question checks behavior on the O... | 2013/05/11 | [
"https://Stackoverflow.com/questions/16492600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/300421/"
] | I have to disagree w/ cpuguy. I agree that the law of demeter is a great thing, but your object graph only seems to be violating it due to the impedence mismatch between your relational database and the hierarchical data you're storing.
If there's something here that could be refactored, it might be your model struct... | I would say try to refactor this so you are testing one thing. If you are doing that you don't need to create all these objects (and in turn slow down your test).
If you are not violating LoD, <https://www.google.com/search?q=law+of+demeter&ie=UTF-8&oe=UTF-8&hl=en&client=safari#itp=open0>, then this becomes a lot easi... |
55,952,596 | I want to have the following setup in Azure.
\* Main Traffic manager
βββββββ - WebAppA (West Europe)
βββββββ - Nested Endpoint
βββββββββββββββββ\* WebAppB (West Europe)
WebappA has a custom domain name linked with a CName to the main traffic manager.
Now WebAppB also needs this custom domain name, but I'... | 2019/05/02 | [
"https://Stackoverflow.com/questions/55952596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/809881/"
] | As @Carsten said, you can't hide a cell, but only hide it's content. You can use a `template` for that:
```
template: "# if (data.Age < 18 || data.Age > 20) { #<input type='checkbox' name='Gender'># } #"
```
[Dojo](https://dojo.telerik.com/ayEdAKan)
In your case, using Asp.Net MVC you should use `ClientTemplate`. S... | You can't hide the cell but you can hide the content depending of the other columns. See <https://docs.telerik.com/aspnet-mvc/helpers/grid/faq#how-to-apply-conditional-logic-to-client-column-templates> on how to apply conditional logic to columns. |
45,433,100 | I am trying to extract information from a google docs table.
There maybe multiple tables in the document and the one I am trying to obtain is the one that contains the value 'mean value'
I then want to get the value from the corresponding row next column along:
Type-----------| Value
max------------| 0
min--------... | 2017/08/01 | [
"https://Stackoverflow.com/questions/45433100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4881617/"
] | I contacted direct AWS Support and this is the solution which they provided to me:
>
> I looked at the logs that you posted in case, I found that the agent
> is Jorgee, which is a common malware agent. I came across the blog
> regarding to this agent [1], though it is not official one but got
> insights of it.
>
... | To solve the issue,
I changed the elasticbeans load balancer to application level one and enabled WAF integration.
In WAF, I defined following rules to prevent malware requests.
```
URI contains: "/pma" after converting to lowercase.
URI contains: "/sql" after converting to lowercase.
URI contains: "/admin" afte... |
45,433,100 | I am trying to extract information from a google docs table.
There maybe multiple tables in the document and the one I am trying to obtain is the one that contains the value 'mean value'
I then want to get the value from the corresponding row next column along:
Type-----------| Value
max------------| 0
min--------... | 2017/08/01 | [
"https://Stackoverflow.com/questions/45433100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4881617/"
] | For me, I didn't have a Response for the root(`/`) so by simply adding a dummy page in spring-boot my problem with ELB went away.
```
@GetMapping("/")
@ResponseBody
public String sayHello() {
return "hello";
}
``` | To solve the issue,
I changed the elasticbeans load balancer to application level one and enabled WAF integration.
In WAF, I defined following rules to prevent malware requests.
```
URI contains: "/pma" after converting to lowercase.
URI contains: "/sql" after converting to lowercase.
URI contains: "/admin" afte... |
5,410,761 | When doing form validation, I encountered this code:
```
//check each input to ensure it isn't empty
$( "#frmReservation :input" ).each( function(i) {
if($(this).val() == '' && !$(this).is('.optional'))
{
success = false;
}
});
```
"optional" is a class that's defined on each input that's, well, ... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5410761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282112/"
] | Maybe try this:
```
if(.. !$(this).hasClass('optional'))
``` | How about using `if($(this).val() == '' && !$(this).hasClass('.optional'))` |
5,410,761 | When doing form validation, I encountered this code:
```
//check each input to ensure it isn't empty
$( "#frmReservation :input" ).each( function(i) {
if($(this).val() == '' && !$(this).is('.optional'))
{
success = false;
}
});
```
"optional" is a class that's defined on each input that's, well, ... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5410761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282112/"
] | Works for me.
[Fiddle](http://jsfiddle.net/3eSQq/) | Maybe try this:
```
if(.. !$(this).hasClass('optional'))
``` |
5,410,761 | When doing form validation, I encountered this code:
```
//check each input to ensure it isn't empty
$( "#frmReservation :input" ).each( function(i) {
if($(this).val() == '' && !$(this).is('.optional'))
{
success = false;
}
});
```
"optional" is a class that's defined on each input that's, well, ... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5410761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282112/"
] | Maybe try this:
```
if(.. !$(this).hasClass('optional'))
``` | I'm a bit late to this question. A better way is to check inputs on the fly when you focus out of an input. Inputs with class optional will not be counted.
```
$('input').not('.optional').blur(function() {
if ($(this).val().length < 1) {
$(this).addClass('error')
} else {
$(this).removeClass('e... |
5,410,761 | When doing form validation, I encountered this code:
```
//check each input to ensure it isn't empty
$( "#frmReservation :input" ).each( function(i) {
if($(this).val() == '' && !$(this).is('.optional'))
{
success = false;
}
});
```
"optional" is a class that's defined on each input that's, well, ... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5410761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282112/"
] | Works for me.
[Fiddle](http://jsfiddle.net/3eSQq/) | How about using `if($(this).val() == '' && !$(this).hasClass('.optional'))` |
5,410,761 | When doing form validation, I encountered this code:
```
//check each input to ensure it isn't empty
$( "#frmReservation :input" ).each( function(i) {
if($(this).val() == '' && !$(this).is('.optional'))
{
success = false;
}
});
```
"optional" is a class that's defined on each input that's, well, ... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5410761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282112/"
] | Works for me.
[Fiddle](http://jsfiddle.net/3eSQq/) | I'm a bit late to this question. A better way is to check inputs on the fly when you focus out of an input. Inputs with class optional will not be counted.
```
$('input').not('.optional').blur(function() {
if ($(this).val().length < 1) {
$(this).addClass('error')
} else {
$(this).removeClass('e... |
60,801,821 | I have the following dataframes:
```
df1 = {'col1': {0: 'IL', 1: 'NE', 2: 'NE', 3: 'IL', 4: 'TX', 5: 'TX'},
'col2': {0: 'bob', 1: 'fred', 2: 'alex', 3: 'ted', 4: 'frank', 5: 'tim'}}
df2 = {'IL': {0},'NE': {0},'TX': {0}}
```
[dataframes and expected result](https://i.stack.imgur.com/AGD5N.png)
I want to add the col... | 2020/03/22 | [
"https://Stackoverflow.com/questions/60801821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13095741/"
] | Try:
```
df1.set_index(['col1', df1.groupby('col1').cumcount()])['col2'].unstack(0)
```
Output:
```
col1 IL NE TX
0 bob fred frank
1 ted alex tim
``` | use a [pivot table](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.pivot_table.html) to aggregate col2 into a list,and apply pandas [explode](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.explode.html) to each column :
```
(df1.pivot_table(columns='col1',values='col2... |
38,661,419 | In SQL Server, I am trying to get the student id for which the below subject has to be assigned:
```
'English', 'Tamil', 'Maths'
```
in which I need to get the student id for which the subject 'Maths' is assigned today and subject 'English', 'Tamil' assigned on any day .
But the below query checking for all subject... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38661419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1313339/"
] | Try this:
```
Select ca.student_id
From student st
Where Exists
(Select * from student_subject mss
join subject ms on ms.sub_id = mss.sub_id
Where mss.student_id=st.student_id
And ms.student_subject_txt = 'Maths'
And student_subject_assigned_Date =
dateAdd(day, DateDiff(day, ... | I am not sure what your query is trying to do but if you only want results having a count = 3 do this (I changed the group by to having):
```
SELECT DISTINCT ca.student_id FROM student st
INNER JOIN student_subject ON student_subject.student_id=st.student_id
INNER JOIN subject ON subject.sub_id=student_subje... |
38,661,419 | In SQL Server, I am trying to get the student id for which the below subject has to be assigned:
```
'English', 'Tamil', 'Maths'
```
in which I need to get the student id for which the subject 'Maths' is assigned today and subject 'English', 'Tamil' assigned on any day .
But the below query checking for all subject... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38661419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1313339/"
] | This should work. Notice you don't need `distinct`:
```
SELECT ca.student_id
FROM student st
INNER JOIN student_subject
ON student_subject.student_id=st.student_id
INNER JOIN subject
ON subject.sub_id=student_subject.sub_id
WHERE student_subject_txt in( 'English','Tamil', 'Ma... | I am not sure what your query is trying to do but if you only want results having a count = 3 do this (I changed the group by to having):
```
SELECT DISTINCT ca.student_id FROM student st
INNER JOIN student_subject ON student_subject.student_id=st.student_id
INNER JOIN subject ON subject.sub_id=student_subje... |
38,661,419 | In SQL Server, I am trying to get the student id for which the below subject has to be assigned:
```
'English', 'Tamil', 'Maths'
```
in which I need to get the student id for which the subject 'Maths' is assigned today and subject 'English', 'Tamil' assigned on any day .
But the below query checking for all subject... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38661419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1313339/"
] | Try this:
```
Select ca.student_id
From student st
Where Exists
(Select * from student_subject mss
join subject ms on ms.sub_id = mss.sub_id
Where mss.student_id=st.student_id
And ms.student_subject_txt = 'Maths'
And student_subject_assigned_Date =
dateAdd(day, DateDiff(day, ... | This should work. Notice you don't need `distinct`:
```
SELECT ca.student_id
FROM student st
INNER JOIN student_subject
ON student_subject.student_id=st.student_id
INNER JOIN subject
ON subject.sub_id=student_subject.sub_id
WHERE student_subject_txt in( 'English','Tamil', 'Ma... |
62,893,106 | Does redis provide support for secondary index on string data type?
I would like to know how i can store the data in redis along with seconday key.
Example let say i want to store the entity with key value as 'id:<some\_string>' and it's payload as a compressed json string. but sometimes i need to search the payload ... | 2020/07/14 | [
"https://Stackoverflow.com/questions/62893106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13920550/"
] | *"sometimes i need to search the payload with another value in json"*
You can't, Redis isn't built for this. Redis is fast, mostly for key-value storage. You'll need a relational database if you have a lot of fields in json to index. Yes, you can use redissearch.io, though you should note its free version won't allow ... | [JRediSearch](https://github.com/RediSearch/JRediSearch) a client for the Redis module [RediSearch](https://redisearch.io), provides an extension to Jedis that allows to easily define secondary indexes in Redis with a simple query command.
e.g.
```java
Query q = new Query("@brand:Toyota")
.addFilt... |
9,661,368 | For certain reasons, I have to create a 1024 kb .txt file.
Below is my current code:
```
int size = 1024000 //1024 kb..
byte[] bytearray = new byte[size];
foreach (byte bit in bytearray)
{
bit = 0;
}
string tobewritten = string.Empty;
foreach (byte bit in bytearray)
{
tobewritten += bit.ToString();
}
/... | 2012/03/12 | [
"https://Stackoverflow.com/questions/9661368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1037008/"
] | Instead of `next()` use `find()` or `children()`:
```
$('div.details').find('p.jQuery1').html('Changed 1');
``` | use find instead of next because you are trying to look a children inside the div with class details
```
$('div.details').find('p.jQuery1').html('Changed 1');
```
<http://jsfiddle.net/HTaKV/2/>
and in the second binding you are doing slideToggle so the changed the content is getting hided. So i commented that line... |
9,661,368 | For certain reasons, I have to create a 1024 kb .txt file.
Below is my current code:
```
int size = 1024000 //1024 kb..
byte[] bytearray = new byte[size];
foreach (byte bit in bytearray)
{
bit = 0;
}
string tobewritten = string.Empty;
foreach (byte bit in bytearray)
{
tobewritten += bit.ToString();
}
/... | 2012/03/12 | [
"https://Stackoverflow.com/questions/9661368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1037008/"
] | The `.next()` method returns the next *sibling* of the element you call it on, but you are trying to find *children* of the element you call it on so you should use `.children()` (to retrieve only direct children) or `.find()` (to get descendants including children, grandchildren, etc.).
Try the following:
```
$('inp... | use find instead of next because you are trying to look a children inside the div with class details
```
$('div.details').find('p.jQuery1').html('Changed 1');
```
<http://jsfiddle.net/HTaKV/2/>
and in the second binding you are doing slideToggle so the changed the content is getting hided. So i commented that line... |
189,369 | I've seen tons of problems with `Alt`-`Tab` and the desktop cursor showing up.
But my problem is that the desktop cursor shows up without ever tabbing out. It seems like it happens when I'm running (`shift`) and moving (`w`) forward and/or turning (`a`).
When I do that, my computer beeps and the Windows cursor shows... | 2014/10/25 | [
"https://gaming.stackexchange.com/questions/189369",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/90764/"
] | You might want to try SKSE: <http://skse.silverlock.org> (installer)
It makes it easy to "mod" skyrim and use certain fixes.
SKSE: The Skyrim Script Extender, or SKSE for short, is a modder's resource
that expands the scripting capabilities of Skyrim. It does so without
modifying the executable files on disk, so ... | Running (shift)(W) while strafing (A) and then jumping (space) will key-jam most keyboards.
[Key Jamming](http://en.wikipedia.org/wiki/Rollover_%28key%29):
>
> Key ghosting occurs on matrix keyboards for certain combinations of three keys. When these three keys are pressed simultaneously a fourth keypress is erron... |
189,369 | I've seen tons of problems with `Alt`-`Tab` and the desktop cursor showing up.
But my problem is that the desktop cursor shows up without ever tabbing out. It seems like it happens when I'm running (`shift`) and moving (`w`) forward and/or turning (`a`).
When I do that, my computer beeps and the Windows cursor shows... | 2014/10/25 | [
"https://gaming.stackexchange.com/questions/189369",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/90764/"
] | You might want to try SKSE: <http://skse.silverlock.org> (installer)
It makes it easy to "mod" skyrim and use certain fixes.
SKSE: The Skyrim Script Extender, or SKSE for short, is a modder's resource
that expands the scripting capabilities of Skyrim. It does so without
modifying the executable files on disk, so ... | Sticky Keys is triggered by pressing the shift key multiple times in succession, which doesn't sound like what you are doing. A related but slightly-less-known feature is [Filter Keys](http://en.wikipedia.org/wiki/FilterKeys), which is triggered by holding down the shift key for eight seconds.
I suspect this is why y... |
189,369 | I've seen tons of problems with `Alt`-`Tab` and the desktop cursor showing up.
But my problem is that the desktop cursor shows up without ever tabbing out. It seems like it happens when I'm running (`shift`) and moving (`w`) forward and/or turning (`a`).
When I do that, my computer beeps and the Windows cursor shows... | 2014/10/25 | [
"https://gaming.stackexchange.com/questions/189369",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/90764/"
] | You might want to try SKSE: <http://skse.silverlock.org> (installer)
It makes it easy to "mod" skyrim and use certain fixes.
SKSE: The Skyrim Script Extender, or SKSE for short, is a modder's resource
that expands the scripting capabilities of Skyrim. It does so without
modifying the executable files on disk, so ... | This problem drove me crazy also. Found a mod on the Nexus that absolutely works. Instead of trying to hide the cursor, as most others do, it disables the background cursor while the game is running. I've had absolutely zero problems since installing, and it has other advantages also. Get it here: <http://www.nexusmods... |
21,097,852 | I am totally new to cocos2d-x ios game development and really learning a lot from stackoverflow.Just want to thank all the software coders.Now my question is I am making a game with levels and high score.But still couldn't find a way to store the high score and the levels cleared.When the game restarts all the values a... | 2014/01/13 | [
"https://Stackoverflow.com/questions/21097852",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2545465/"
] | CCUserDefault acts as a key value pair and stores a value corresponding to the keys.Suppose you want to store a high score of your game so that when the user restarts the game after exiting,the changes should persist
For this,in your .cpp file take a const key value at the top after header inclusion
```
const char *HI... | If you want to store basic information like High Score, Current Level etc then you can use `CCUserDefault` and if you want to store complex data then either you can use `SQLite` or `CCDictionary`
Here is pseudo code to store and retrieve High Score in `Cocos2dx-3.0`:
```
const char* KEY_HIGH_SCORE = "high_score";
/... |
18,936,331 | Why isn't this functioning properly? I'm aware of the advanced slice ([::-1]) option but I would like to figure out how to reverse the str this way as well.
```
word = input("Please enter a word to reverse: ")
cut = len(word)
print(word[cut:-cut])
``` | 2013/09/21 | [
"https://Stackoverflow.com/questions/18936331",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2668974/"
] | ```
word[cut:-cut]
```
May go from `cut` to `-cut`, which you could also write
```
word[cut:0]
```
but the *step* is still 1, which is *still positive*. So it will slice *forward* from the end, and stop because it's reached the end!
This implies that the step is needed either way, `word[cut:-cut:-1]`. When indexi... | Unless you specify a negative step, slices always go forwards. Specifying a start position after the end of the slice will only produce an empty slice. You need the negative step. |
29,675,989 | I have a timer countdown with javascript.It countdowns from 3 minutes.But if user reloads the page I have to resume the countdown.I mean user loaded the page and countdown starts from 3 minutes then after 1 minute user reloads the page countdown should start from 2 minutes.How can I do this ? I don't want any code I ne... | 2015/04/16 | [
"https://Stackoverflow.com/questions/29675989",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4266906/"
] | After each second change, you need to save the state of the counter into some kind of persistent storage.
I'd just use:
```
localStorage['time_left'] = JSON.stringify(time_left);
```
When you load the page, first you try to load the state of the timer.
```
time_left = JSON.parse(localStorage['time_left']);
```
... | You need to persist the current time left to the end of the timer somewhere where you can access it later, even after the page has been refreshed. [Local storage](http://www.w3schools.com/html/html5_webstorage.asp) comes to mind, but other methods may be possible.
Instead of setting the timer to 3 minutes, you [set an... |
29,675,989 | I have a timer countdown with javascript.It countdowns from 3 minutes.But if user reloads the page I have to resume the countdown.I mean user loaded the page and countdown starts from 3 minutes then after 1 minute user reloads the page countdown should start from 2 minutes.How can I do this ? I don't want any code I ne... | 2015/04/16 | [
"https://Stackoverflow.com/questions/29675989",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4266906/"
] | After each second change, you need to save the state of the counter into some kind of persistent storage.
I'd just use:
```
localStorage['time_left'] = JSON.stringify(time_left);
```
When you load the page, first you try to load the state of the timer.
```
time_left = JSON.parse(localStorage['time_left']);
```
... | ```
var remaining = localStorage.remaining || 180;
window.setInterval(function(){
remaining = remaining - 1;
document.querySelector('#countdown').innerHTML = remaining;
}, 1000);
window.onbeforeunload = function(){
// Save remaining time as the window is closed or navigated elsewhere
localSto... |
42,330,078 | Consider the following code and output:
```
#include <iostream>
int Add(int a, int b) {
return a + b;
}
int Subtract(int a, int b) {
return a - b;
}
int main() {
int (*fn1)(int, int);
int (*fn2)(int, int);
fn1 = &Add;
fn2 = &Subtract;
std::cout << "fn1 = " << fn1 << "\n";
std::cout << "*fn1 = " << ... | 2017/02/19 | [
"https://Stackoverflow.com/questions/42330078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032413/"
] | You can perform interpolation with most CSS functions, including `rgba()` (see an example [here](https://stackoverflow.com/questions/40010597/how-do-i-apply-opacity-to-a-css-color-variable/41265350#41265350)). In fact, interpolation is one of the main features of custom properties.
But you cannot do this with `url()`,... | I had the same issue on a project with Cordova so I used:
```
header{
--bg-header: url(../img/header_home.png) left center/cover no-repeat;
background: var(--bg-header,
url("../img/header_home.png") left center/cover no-repeat
);
}
```
Apparently, if you use **url("")** with double quotes on the **--var*... |
42,330,078 | Consider the following code and output:
```
#include <iostream>
int Add(int a, int b) {
return a + b;
}
int Subtract(int a, int b) {
return a - b;
}
int main() {
int (*fn1)(int, int);
int (*fn2)(int, int);
fn1 = &Add;
fn2 = &Subtract;
std::cout << "fn1 = " << fn1 << "\n";
std::cout << "*fn1 = " << ... | 2017/02/19 | [
"https://Stackoverflow.com/questions/42330078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032413/"
] | You can perform interpolation with most CSS functions, including `rgba()` (see an example [here](https://stackoverflow.com/questions/40010597/how-do-i-apply-opacity-to-a-css-color-variable/41265350#41265350)). In fact, interpolation is one of the main features of custom properties.
But you cannot do this with `url()`,... | here is the solution which works in vue3
```
<script setup>
const backImage = ref("url(/img/imImage.webp)")
</script>
<style>
div {
background-image: v-bind(backImage );
}
</style>
``` |
42,330,078 | Consider the following code and output:
```
#include <iostream>
int Add(int a, int b) {
return a + b;
}
int Subtract(int a, int b) {
return a - b;
}
int main() {
int (*fn1)(int, int);
int (*fn2)(int, int);
fn1 = &Add;
fn2 = &Subtract;
std::cout << "fn1 = " << fn1 << "\n";
std::cout << "*fn1 = " << ... | 2017/02/19 | [
"https://Stackoverflow.com/questions/42330078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032413/"
] | You can perform interpolation with most CSS functions, including `rgba()` (see an example [here](https://stackoverflow.com/questions/40010597/how-do-i-apply-opacity-to-a-css-color-variable/41265350#41265350)). In fact, interpolation is one of the main features of custom properties.
But you cannot do this with `url()`,... | You cannot interpolate css variables with url but what you can do is to implement the url function as part of your variable like this:
```
:root {
--url: url("https://download.unsplash.com/photo-1420708392410-3c593b80d416");
}
body {
background: var(--url);
}
```
in HTML could be:
```
<div class="css_class... |
42,330,078 | Consider the following code and output:
```
#include <iostream>
int Add(int a, int b) {
return a + b;
}
int Subtract(int a, int b) {
return a - b;
}
int main() {
int (*fn1)(int, int);
int (*fn2)(int, int);
fn1 = &Add;
fn2 = &Subtract;
std::cout << "fn1 = " << fn1 << "\n";
std::cout << "*fn1 = " << ... | 2017/02/19 | [
"https://Stackoverflow.com/questions/42330078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032413/"
] | here is the solution which works in vue3
```
<script setup>
const backImage = ref("url(/img/imImage.webp)")
</script>
<style>
div {
background-image: v-bind(backImage );
}
</style>
``` | I had the same issue on a project with Cordova so I used:
```
header{
--bg-header: url(../img/header_home.png) left center/cover no-repeat;
background: var(--bg-header,
url("../img/header_home.png") left center/cover no-repeat
);
}
```
Apparently, if you use **url("")** with double quotes on the **--var*... |
42,330,078 | Consider the following code and output:
```
#include <iostream>
int Add(int a, int b) {
return a + b;
}
int Subtract(int a, int b) {
return a - b;
}
int main() {
int (*fn1)(int, int);
int (*fn2)(int, int);
fn1 = &Add;
fn2 = &Subtract;
std::cout << "fn1 = " << fn1 << "\n";
std::cout << "*fn1 = " << ... | 2017/02/19 | [
"https://Stackoverflow.com/questions/42330078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032413/"
] | You cannot interpolate css variables with url but what you can do is to implement the url function as part of your variable like this:
```
:root {
--url: url("https://download.unsplash.com/photo-1420708392410-3c593b80d416");
}
body {
background: var(--url);
}
```
in HTML could be:
```
<div class="css_class... | I had the same issue on a project with Cordova so I used:
```
header{
--bg-header: url(../img/header_home.png) left center/cover no-repeat;
background: var(--bg-header,
url("../img/header_home.png") left center/cover no-repeat
);
}
```
Apparently, if you use **url("")** with double quotes on the **--var*... |
42,330,078 | Consider the following code and output:
```
#include <iostream>
int Add(int a, int b) {
return a + b;
}
int Subtract(int a, int b) {
return a - b;
}
int main() {
int (*fn1)(int, int);
int (*fn2)(int, int);
fn1 = &Add;
fn2 = &Subtract;
std::cout << "fn1 = " << fn1 << "\n";
std::cout << "*fn1 = " << ... | 2017/02/19 | [
"https://Stackoverflow.com/questions/42330078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032413/"
] | You cannot interpolate css variables with url but what you can do is to implement the url function as part of your variable like this:
```
:root {
--url: url("https://download.unsplash.com/photo-1420708392410-3c593b80d416");
}
body {
background: var(--url);
}
```
in HTML could be:
```
<div class="css_class... | here is the solution which works in vue3
```
<script setup>
const backImage = ref("url(/img/imImage.webp)")
</script>
<style>
div {
background-image: v-bind(backImage );
}
</style>
``` |
72,482 | Is it possible in a large GWT project, load some portion of JavaScript lazy, on the fly?
Like overlays.
PS: Iframes is not a solution. | 2008/09/16 | [
"https://Stackoverflow.com/questions/72482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12259/"
] | Check out `GWT.runAsync` as well as the Google I/O talk below, which goes into lazy loading of `JavaScript` in `GWT` projects.
* <http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting>
* <http://code.google.com/events/io/sessions/GoogleWavePoweredByGWT.html> (around time 25:30) | I think this is what you are looking for.
```
<body onload="onloadHandler();">
<script type="text/javascript">
function onloadHandler() {
if (document.createElement && document.getElementsByTagName) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src... |
72,482 | Is it possible in a large GWT project, load some portion of JavaScript lazy, on the fly?
Like overlays.
PS: Iframes is not a solution. | 2008/09/16 | [
"https://Stackoverflow.com/questions/72482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12259/"
] | Check out `GWT.runAsync` as well as the Google I/O talk below, which goes into lazy loading of `JavaScript` in `GWT` projects.
* <http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting>
* <http://code.google.com/events/io/sessions/GoogleWavePoweredByGWT.html> (around time 25:30) | GWT doesn't readily support this since all Java code that is (or rather may be) required for the module that you load is compiled into a single JavaScript file. This single JavaScript file can be large but for non-trivial modules it is smaller than the equivalent hand written JavaScript.
Do you have a scenario where t... |
72,482 | Is it possible in a large GWT project, load some portion of JavaScript lazy, on the fly?
Like overlays.
PS: Iframes is not a solution. | 2008/09/16 | [
"https://Stackoverflow.com/questions/72482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12259/"
] | Check out `GWT.runAsync` as well as the Google I/O talk below, which goes into lazy loading of `JavaScript` in `GWT` projects.
* <http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting>
* <http://code.google.com/events/io/sessions/GoogleWavePoweredByGWT.html> (around time 25:30) | You could conceivably split your application up into multiple GWT modules but you need to remember that this will limit your ability to share code between modules. So if one module has classes that reference the same class that another module references, the code for the common class will get included twice.
Effective... |
72,482 | Is it possible in a large GWT project, load some portion of JavaScript lazy, on the fly?
Like overlays.
PS: Iframes is not a solution. | 2008/09/16 | [
"https://Stackoverflow.com/questions/72482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12259/"
] | Check out `GWT.runAsync` as well as the Google I/O talk below, which goes into lazy loading of `JavaScript` in `GWT` projects.
* <http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting>
* <http://code.google.com/events/io/sessions/GoogleWavePoweredByGWT.html> (around time 25:30) | Try to load a big GWT application with the "one upfront" approach using a iPhone or an iPod touch...it will never load.
The module approach is a but more complexe to manage but better for smaller client devices.
Now, how do I load a module from my Java code without using an iFrame?
* Erick |
34,808,669 | I have a table `tmp`.
Query:
```
select * from tmp
```
[](https://i.stack.imgur.com/cjr4g.png)
I want the result in following way:
```
customer_id | subscriber_id | totalSubscribers
320 | 433 | 3
320 | 434 ... | 2016/01/15 | [
"https://Stackoverflow.com/questions/34808669",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3593678/"
] | Here is solution for you question
```
SELECT customer_id , subscriber_id , count(*) AS totalSubscribers
FROM `tmp` GROUP BY 1,2
```
or
```
SELECT customer_id , subscriber_id , count(*) AS totalSubscribers
FROM `tmp` GROUP BY customer_id , subscriber_id
```
Here is screnshot for executed query
[![enter image ... | Here is the answer
```
SELECT customer_id , subscriber_id , count(*) as [TOTAL]
FROM tmp
GROUP BY customer_id , subscriber_id
``` |
23,400 | Assume we have a sequence of symbols
$$S= \{0, 0, 1+j, -1-j, 0 ,0 , 1+j,-1+j\}$$
and that this sequence is a frequency domain sequence and will be input to an IFFT operation.
Is the output a *continous time* or *discrete time* signal?
Thanks | 2015/05/14 | [
"https://dsp.stackexchange.com/questions/23400",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/15315/"
] | This generating (check if it's a primitive polynomial - those are usually used) polynomial representing a simple Linear Feedback Shift Register (LFSR). The circuit is given below, the gate is a XOR gate (an addition over GF(2) ). You can follow the output of this shift register very easily
[![enter image description h... | ```
boolean mls[127];
unsigned D = 0x7F;
for (i=0; i<127; i++)
{
mls[i] = D&1;
D = D>>1;
if (mls[i])
{
D = D^0x48;
}
}
``` |
23,400 | Assume we have a sequence of symbols
$$S= \{0, 0, 1+j, -1-j, 0 ,0 , 1+j,-1+j\}$$
and that this sequence is a frequency domain sequence and will be input to an IFFT operation.
Is the output a *continous time* or *discrete time* signal?
Thanks | 2015/05/14 | [
"https://dsp.stackexchange.com/questions/23400",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/15315/"
] | This generating (check if it's a primitive polynomial - those are usually used) polynomial representing a simple Linear Feedback Shift Register (LFSR). The circuit is given below, the gate is a XOR gate (an addition over GF(2) ). You can follow the output of this shift register very easily
[![enter image description h... | or it might be
```
boolean mls[127];
unsigned D = 0x7F;
for (i=0; i<127; i++)
{
mls[i] = (D & 0x40)>>6;
D = D<<1;
if (mls[i])
{
D = D^0x11;
}
}
```
all depends on if we're shifting left or right. |
23,039,374 | I have a number input text box and I want to allow the user to edit but do not want to allow the user to enter any other text except numbers. I want them only to be able to use the arrows on the number input box.
```
<input type = "number" min="0" max="10" step="0.5" input id="rating" name = "rating" class = "logi... | 2014/04/13 | [
"https://Stackoverflow.com/questions/23039374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3474775/"
] | You can achieve this by pure `JavaScript`. Create this function that you can reuse in your script.
```
function allowNumbersOnly(e) {
var code = (e.which) ? e.which : e.keyCode;
if (code > 31 && (code < 48 || code > 57)) {
e.preventDefault();
}
}
```
You may preferably call this `onkeypress` even... | `document.getElementById('rating').onkeypress = function() { return false; }`
This will prevent the default behavior of keypresses on that element i.e. text showing up. |
23,039,374 | I have a number input text box and I want to allow the user to edit but do not want to allow the user to enter any other text except numbers. I want them only to be able to use the arrows on the number input box.
```
<input type = "number" min="0" max="10" step="0.5" input id="rating" name = "rating" class = "logi... | 2014/04/13 | [
"https://Stackoverflow.com/questions/23039374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3474775/"
] | You can achieve this by pure `JavaScript`. Create this function that you can reuse in your script.
```
function allowNumbersOnly(e) {
var code = (e.which) ? e.which : e.keyCode;
if (code > 31 && (code < 48 || code > 57)) {
e.preventDefault();
}
}
```
You may preferably call this `onkeypress` even... | HTML
```
<input type="text" class="IntOnly">
```
Javascript
```
let ele = document.getElementsByClassName('IntOnly');
for (const e of ele) {
//e.addEventListener('change', filterNonIntOut.bind(null, e));
//e.addEventListener('paste', filterNonIntOut.bind(null, e));
e.addEventListener('input', filterN... |
22,760 | Recently, I heard of three tourists from Germany drowning in a lake in Alaska. Their boat overturned and they ended up in the water. All three of them were wearing life jackets. This is what I don't understand, how can people still drown if they are wearing a life jacket? | 2019/08/02 | [
"https://outdoors.stackexchange.com/questions/22760",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/18360/"
] | PFDs come in various flavours:
The best ones have sufficient floatation around the neck, and enough more flotation on the front compared to the back, than an unconscious victim is naturally rotated onto his back with is face out of the water. The classic design is the "Key hole" design. This is what you find in the lo... | Without witnessing or knowing anything about what really happened, it is a 100% safe bet to claim that these three people *didn't* drown. They certainly, without any doubt, died from hypothermia (in particular the one whose body was not found in the water but on an ice floe).
That being said, a life vest makes it easi... |
22,760 | Recently, I heard of three tourists from Germany drowning in a lake in Alaska. Their boat overturned and they ended up in the water. All three of them were wearing life jackets. This is what I don't understand, how can people still drown if they are wearing a life jacket? | 2019/08/02 | [
"https://outdoors.stackexchange.com/questions/22760",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/18360/"
] | I've fallen into the water where these people unfortunately died. In almost 40 years I have never been in as much pain as when that happened. The water is sub 45F (~7C) or even colder. Exposure will kill you in minutes from hypothermia.
These people didn't drown, they froze to death.
>
> Two of the touristsβ bodies ... | Without witnessing or knowing anything about what really happened, it is a 100% safe bet to claim that these three people *didn't* drown. They certainly, without any doubt, died from hypothermia (in particular the one whose body was not found in the water but on an ice floe).
That being said, a life vest makes it easi... |
22,760 | Recently, I heard of three tourists from Germany drowning in a lake in Alaska. Their boat overturned and they ended up in the water. All three of them were wearing life jackets. This is what I don't understand, how can people still drown if they are wearing a life jacket? | 2019/08/02 | [
"https://outdoors.stackexchange.com/questions/22760",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/18360/"
] | PFDs come in various flavours:
The best ones have sufficient floatation around the neck, and enough more flotation on the front compared to the back, than an unconscious victim is naturally rotated onto his back with is face out of the water. The classic design is the "Key hole" design. This is what you find in the lo... | I've fallen into the water where these people unfortunately died. In almost 40 years I have never been in as much pain as when that happened. The water is sub 45F (~7C) or even colder. Exposure will kill you in minutes from hypothermia.
These people didn't drown, they froze to death.
>
> Two of the touristsβ bodies ... |
22,760 | Recently, I heard of three tourists from Germany drowning in a lake in Alaska. Their boat overturned and they ended up in the water. All three of them were wearing life jackets. This is what I don't understand, how can people still drown if they are wearing a life jacket? | 2019/08/02 | [
"https://outdoors.stackexchange.com/questions/22760",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/18360/"
] | Life jackets do not make one drownproof, just increase your odds significantly.
>
> Our data also show that **over 80% of drowning victims were NOT wearing life jackets when
> found.** We know from other data that most of those victims could have been saved had
> they been wearing a life jacket before the mishap oc... | In the specific case you mention, both the [NY Post](https://nypost.com/2019/07/31/3-tourist-kayakers-found-dead-in-glacial-lake-in-alaska-officials/) and [Deutsche Welle](https://www.dw.com/en/german-tourists-perish-in-alaskan-glacier-lake/a-49838528) say that the cause of death is still being investigated, and both o... |
22,760 | Recently, I heard of three tourists from Germany drowning in a lake in Alaska. Their boat overturned and they ended up in the water. All three of them were wearing life jackets. This is what I don't understand, how can people still drown if they are wearing a life jacket? | 2019/08/02 | [
"https://outdoors.stackexchange.com/questions/22760",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/18360/"
] | Something not widely understood yet of critical importance is the **cold water shock** phenomenon.
>
> Cold-water shock is the first stage of the sudden and unexpected immersion in water which temperature is of 15 Β°C or lower and occurs during the first minute of exposure. Cold-water shock likely causes more deaths t... | I've fallen into the water where these people unfortunately died. In almost 40 years I have never been in as much pain as when that happened. The water is sub 45F (~7C) or even colder. Exposure will kill you in minutes from hypothermia.
These people didn't drown, they froze to death.
>
> Two of the touristsβ bodies ... |
22,760 | Recently, I heard of three tourists from Germany drowning in a lake in Alaska. Their boat overturned and they ended up in the water. All three of them were wearing life jackets. This is what I don't understand, how can people still drown if they are wearing a life jacket? | 2019/08/02 | [
"https://outdoors.stackexchange.com/questions/22760",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/18360/"
] | Life jackets do not make one drownproof, just increase your odds significantly.
>
> Our data also show that **over 80% of drowning victims were NOT wearing life jackets when
> found.** We know from other data that most of those victims could have been saved had
> they been wearing a life jacket before the mishap oc... | Something not widely understood yet of critical importance is the **cold water shock** phenomenon.
>
> Cold-water shock is the first stage of the sudden and unexpected immersion in water which temperature is of 15 Β°C or lower and occurs during the first minute of exposure. Cold-water shock likely causes more deaths t... |
22,760 | Recently, I heard of three tourists from Germany drowning in a lake in Alaska. Their boat overturned and they ended up in the water. All three of them were wearing life jackets. This is what I don't understand, how can people still drown if they are wearing a life jacket? | 2019/08/02 | [
"https://outdoors.stackexchange.com/questions/22760",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/18360/"
] | Something not widely understood yet of critical importance is the **cold water shock** phenomenon.
>
> Cold-water shock is the first stage of the sudden and unexpected immersion in water which temperature is of 15 Β°C or lower and occurs during the first minute of exposure. Cold-water shock likely causes more deaths t... | There are a multitude of ways to die in open water while wearing a life vest. It is contingent upon a variety of scenarios whether you survive and the best scenario assumes that the person overboard is in reasonably good health, not intoxicated and doesn't panic. As well, it also assumes that the water is as close to 9... |
22,760 | Recently, I heard of three tourists from Germany drowning in a lake in Alaska. Their boat overturned and they ended up in the water. All three of them were wearing life jackets. This is what I don't understand, how can people still drown if they are wearing a life jacket? | 2019/08/02 | [
"https://outdoors.stackexchange.com/questions/22760",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/18360/"
] | In the specific case you mention, both the [NY Post](https://nypost.com/2019/07/31/3-tourist-kayakers-found-dead-in-glacial-lake-in-alaska-officials/) and [Deutsche Welle](https://www.dw.com/en/german-tourists-perish-in-alaskan-glacier-lake/a-49838528) say that the cause of death is still being investigated, and both o... | Without witnessing or knowing anything about what really happened, it is a 100% safe bet to claim that these three people *didn't* drown. They certainly, without any doubt, died from hypothermia (in particular the one whose body was not found in the water but on an ice floe).
That being said, a life vest makes it easi... |
22,760 | Recently, I heard of three tourists from Germany drowning in a lake in Alaska. Their boat overturned and they ended up in the water. All three of them were wearing life jackets. This is what I don't understand, how can people still drown if they are wearing a life jacket? | 2019/08/02 | [
"https://outdoors.stackexchange.com/questions/22760",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/18360/"
] | Life jackets do not make one drownproof, just increase your odds significantly.
>
> Our data also show that **over 80% of drowning victims were NOT wearing life jackets when
> found.** We know from other data that most of those victims could have been saved had
> they been wearing a life jacket before the mishap oc... | I've fallen into the water where these people unfortunately died. In almost 40 years I have never been in as much pain as when that happened. The water is sub 45F (~7C) or even colder. Exposure will kill you in minutes from hypothermia.
These people didn't drown, they froze to death.
>
> Two of the touristsβ bodies ... |
22,760 | Recently, I heard of three tourists from Germany drowning in a lake in Alaska. Their boat overturned and they ended up in the water. All three of them were wearing life jackets. This is what I don't understand, how can people still drown if they are wearing a life jacket? | 2019/08/02 | [
"https://outdoors.stackexchange.com/questions/22760",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/18360/"
] | There are a multitude of ways to die in open water while wearing a life vest. It is contingent upon a variety of scenarios whether you survive and the best scenario assumes that the person overboard is in reasonably good health, not intoxicated and doesn't panic. As well, it also assumes that the water is as close to 9... | Without witnessing or knowing anything about what really happened, it is a 100% safe bet to claim that these three people *didn't* drown. They certainly, without any doubt, died from hypothermia (in particular the one whose body was not found in the water but on an ice floe).
That being said, a life vest makes it easi... |
2,388,229 | I am storing the the latitude and longitude as a charfield like ("latitude, longitude"). I prefer to keep it this way.
I need to filter the results to show only latitude > w, latitude < x, longitude > y, longitude < z.
How can I do this without change how I store the lat,long? | 2010/03/05 | [
"https://Stackoverflow.com/questions/2388229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The Django ORM isn't going to be able to help you filter on that field. Your schema isn't designed properly for the type of query you're attempting.
My suggestions:
* Modify your schema to use separate numeric columns to begin with. (I know you are specifically looking for an option that avoids this but it's still th... | As one of the commenters mentioned, you should definitely look at [Geodjango](http://geodjango.org/), which offers native geo-information support. From their page: GeoDjango is an add-on for Django that turns it into a world-class geographic web framework. GeoDjango strives to make at as simple as possible to create ge... |
735,863 | I have one file which is gets details from ldapsearch command and create file as below
```
# lschuler, people, pl.s2-eu.XXXXXXXXX.local
dn: uid=lschuler,ou=people,dc=pl,dc=s2-eu,dc=XXXXXXXXX,dc=local
objectClass: posixAccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
loginShell: ... | 2023/02/17 | [
"https://unix.stackexchange.com/questions/735863",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/434257/"
] | The easiest way to add the key with its value has been covered [in another answer](https://unix.stackexchange.com/a/735762/116858). That answer adds the key to the end of the list of keys in the `compilerOptions` object. Normally, the ordering of the keys does not matter, and if you need things ordered in a particular ... | Like this:
```
$ jq '.compilerOptions.skipLibCheck=true' file.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"skipLibCheck": true
}
}
``` |
41,011,853 | I will try to explain my problem as good as possible to you all.
Currently I am trying to get some Information of Serial numbers and Manufacturer names of Computers in my Domain.
Here is a gap of my code I'm currently using for this:
```
$computername = import-csv "C:\Daten\pc.csv" | select -ExpandProperty Computerna... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41011853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7260941/"
] | You can use `auth().listUsers()` method provided in the admin sdk. Detailed example code can be found here.
[Firebase Admin SDK Documentation](https://firebase.google.com/docs/auth/admin/manage-users#list_all_users) | In March 2020, after a lot of fighting with documentation and various posts, i found the following works:
```
const admin = require("firebase-admin");
const serviceAccount = require('./serviceAccount.json'); // see notes below about this.
const listAllUsers = () => {
const app = admin.initializeApp({
dat... |
41,011,853 | I will try to explain my problem as good as possible to you all.
Currently I am trying to get some Information of Serial numbers and Manufacturer names of Computers in my Domain.
Here is a gap of my code I'm currently using for this:
```
$computername = import-csv "C:\Daten\pc.csv" | select -ExpandProperty Computerna... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41011853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7260941/"
] | In March 2020, after a lot of fighting with documentation and various posts, i found the following works:
```
const admin = require("firebase-admin");
const serviceAccount = require('./serviceAccount.json'); // see notes below about this.
const listAllUsers = () => {
const app = admin.initializeApp({
dat... | ```
public async getAllUsers(): Promise<UserRecord[]> {
const records: UserRecord[] = [];
const listAllUsers = async (maxResults = 1000, nextPageToken?: string): Promise<void> => {
const listAllUsersResult = await firebase.auth().listUsers(maxResults, nextPageToken);
listAllUsersResult.users.f... |
41,011,853 | I will try to explain my problem as good as possible to you all.
Currently I am trying to get some Information of Serial numbers and Manufacturer names of Computers in my Domain.
Here is a gap of my code I'm currently using for this:
```
$computername = import-csv "C:\Daten\pc.csv" | select -ExpandProperty Computerna... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41011853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7260941/"
] | The latest `firebase-admin sdk` (as of now version `5.4.2`) has `listUsers` API that would do that. The example is [here](https://firebase.google.com/docs/auth/admin/manage-users#list_all_users).
One thing to add to the example, the `nextPageToken` has to be omitted or a valid userid. (IMO, it's not obvious in neither... | Its not a good solution, but you can export user data using Firebase CLI and integrate with your application.
>
> auth:export
>
>
> firebase auth:export account\_file --format=file\_format
>
>
>
<https://firebase.google.com/docs/cli/auth> |
41,011,853 | I will try to explain my problem as good as possible to you all.
Currently I am trying to get some Information of Serial numbers and Manufacturer names of Computers in my Domain.
Here is a gap of my code I'm currently using for this:
```
$computername = import-csv "C:\Daten\pc.csv" | select -ExpandProperty Computerna... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41011853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7260941/"
] | The latest `firebase-admin sdk` (as of now version `5.4.2`) has `listUsers` API that would do that. The example is [here](https://firebase.google.com/docs/auth/admin/manage-users#list_all_users).
One thing to add to the example, the `nextPageToken` has to be omitted or a valid userid. (IMO, it's not obvious in neither... | As described in the official doc. [Firebase Documentation](https://firebase.google.com/docs/auth/admin/manage-users#list_all_users) the method to get list of users is mentioned already but it only lists max of 1000 users at a time. But if users are more than 1000 we need to use our own logic to get those remaining user... |
41,011,853 | I will try to explain my problem as good as possible to you all.
Currently I am trying to get some Information of Serial numbers and Manufacturer names of Computers in my Domain.
Here is a gap of my code I'm currently using for this:
```
$computername = import-csv "C:\Daten\pc.csv" | select -ExpandProperty Computerna... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41011853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7260941/"
] | I got this async version working:
(I haven't thought about the flow of the code so the use of async here may be inefficient in terms of performance... I honestly only use async because I don't like looking at deeply nested promise code)
```
const firebase = require('firebase-admin');
const credential = require('./cre... | ```
public async getAllUsers(): Promise<UserRecord[]> {
const records: UserRecord[] = [];
const listAllUsers = async (maxResults = 1000, nextPageToken?: string): Promise<void> => {
const listAllUsersResult = await firebase.auth().listUsers(maxResults, nextPageToken);
listAllUsersResult.users.f... |
41,011,853 | I will try to explain my problem as good as possible to you all.
Currently I am trying to get some Information of Serial numbers and Manufacturer names of Computers in my Domain.
Here is a gap of my code I'm currently using for this:
```
$computername = import-csv "C:\Daten\pc.csv" | select -ExpandProperty Computerna... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41011853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7260941/"
] | In March 2020, after a lot of fighting with documentation and various posts, i found the following works:
```
const admin = require("firebase-admin");
const serviceAccount = require('./serviceAccount.json'); // see notes below about this.
const listAllUsers = () => {
const app = admin.initializeApp({
dat... | I got this async version working:
(I haven't thought about the flow of the code so the use of async here may be inefficient in terms of performance... I honestly only use async because I don't like looking at deeply nested promise code)
```
const firebase = require('firebase-admin');
const credential = require('./cre... |
41,011,853 | I will try to explain my problem as good as possible to you all.
Currently I am trying to get some Information of Serial numbers and Manufacturer names of Computers in my Domain.
Here is a gap of my code I'm currently using for this:
```
$computername = import-csv "C:\Daten\pc.csv" | select -ExpandProperty Computerna... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41011853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7260941/"
] | You can use `auth().listUsers()` method provided in the admin sdk. Detailed example code can be found here.
[Firebase Admin SDK Documentation](https://firebase.google.com/docs/auth/admin/manage-users#list_all_users) | Its not a good solution, but you can export user data using Firebase CLI and integrate with your application.
>
> auth:export
>
>
> firebase auth:export account\_file --format=file\_format
>
>
>
<https://firebase.google.com/docs/cli/auth> |
41,011,853 | I will try to explain my problem as good as possible to you all.
Currently I am trying to get some Information of Serial numbers and Manufacturer names of Computers in my Domain.
Here is a gap of my code I'm currently using for this:
```
$computername = import-csv "C:\Daten\pc.csv" | select -ExpandProperty Computerna... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41011853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7260941/"
] | **Update** As @Webp says in their answer, there **is** now an [API to list all users](https://firebase.google.com/docs/auth/admin/manage-users#list_all_users) in the Admin SDK.
Original answer:
There is no public API to retrieve a list of users from the Firebase Admin SDK.
The typical way to deal with this scenario ... | ```
public async getAllUsers(): Promise<UserRecord[]> {
const records: UserRecord[] = [];
const listAllUsers = async (maxResults = 1000, nextPageToken?: string): Promise<void> => {
const listAllUsersResult = await firebase.auth().listUsers(maxResults, nextPageToken);
listAllUsersResult.users.f... |
41,011,853 | I will try to explain my problem as good as possible to you all.
Currently I am trying to get some Information of Serial numbers and Manufacturer names of Computers in my Domain.
Here is a gap of my code I'm currently using for this:
```
$computername = import-csv "C:\Daten\pc.csv" | select -ExpandProperty Computerna... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41011853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7260941/"
] | **Update** As @Webp says in their answer, there **is** now an [API to list all users](https://firebase.google.com/docs/auth/admin/manage-users#list_all_users) in the Admin SDK.
Original answer:
There is no public API to retrieve a list of users from the Firebase Admin SDK.
The typical way to deal with this scenario ... | As described in the official doc. [Firebase Documentation](https://firebase.google.com/docs/auth/admin/manage-users#list_all_users) the method to get list of users is mentioned already but it only lists max of 1000 users at a time. But if users are more than 1000 we need to use our own logic to get those remaining user... |
41,011,853 | I will try to explain my problem as good as possible to you all.
Currently I am trying to get some Information of Serial numbers and Manufacturer names of Computers in my Domain.
Here is a gap of my code I'm currently using for this:
```
$computername = import-csv "C:\Daten\pc.csv" | select -ExpandProperty Computerna... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41011853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7260941/"
] | The latest `firebase-admin sdk` (as of now version `5.4.2`) has `listUsers` API that would do that. The example is [here](https://firebase.google.com/docs/auth/admin/manage-users#list_all_users).
One thing to add to the example, the `nextPageToken` has to be omitted or a valid userid. (IMO, it's not obvious in neither... | ```
public async getAllUsers(): Promise<UserRecord[]> {
const records: UserRecord[] = [];
const listAllUsers = async (maxResults = 1000, nextPageToken?: string): Promise<void> => {
const listAllUsersResult = await firebase.auth().listUsers(maxResults, nextPageToken);
listAllUsersResult.users.f... |
30,346,748 | I am using a datatable for my application. How do I get the total count of the rows in the datatable `onload`? My code:
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": []
});
)};
... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30346748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2696569/"
] | **Update for New Versions**
```
table.data().count()
```
Reference:<https://datatables.net/reference/api/count()>
**For older versions:**
```
$(document).ready(function() {
//Initialize your table
var table = $('#jobSearchResultTable').dataTable();
//Get the total rows
alert(table.fnGetData().length);
});
```... | Get response from serverside processing following way it works for me:
```
// tested with : DataTables 1.10.15
t1 = $('#item-list').DataTable({
"processing": true,
"serverSide": true,
"ajax":'url',
"drawCallback": function( settings, start, end, max, total, pre ) {
console.log(this.fnSettings... |
30,346,748 | I am using a datatable for my application. How do I get the total count of the rows in the datatable `onload`? My code:
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": []
});
)};
... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30346748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2696569/"
] | **Update for New Versions**
```
table.data().count()
```
Reference:<https://datatables.net/reference/api/count()>
**For older versions:**
```
$(document).ready(function() {
//Initialize your table
var table = $('#jobSearchResultTable').dataTable();
//Get the total rows
alert(table.fnGetData().length);
});
```... | //get number of entire rows
table.rows().eq(0).length; |
30,346,748 | I am using a datatable for my application. How do I get the total count of the rows in the datatable `onload`? My code:
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": []
});
)};
... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30346748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2696569/"
] | **Update for New Versions**
```
table.data().count()
```
Reference:<https://datatables.net/reference/api/count()>
**For older versions:**
```
$(document).ready(function() {
//Initialize your table
var table = $('#jobSearchResultTable').dataTable();
//Get the total rows
alert(table.fnGetData().length);
});
```... | ```
$('#jobSearchResultTable').dataTable().rows().count()
``` |
30,346,748 | I am using a datatable for my application. How do I get the total count of the rows in the datatable `onload`? My code:
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": []
});
)};
... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30346748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2696569/"
] | Please check out the following code
```
var table = $('#example').DataTable();
alert(
'Number of row entries: '+
table
.column( 0 )
.data()
.length
);
``` | //get number of entire rows
table.rows().eq(0).length; |
30,346,748 | I am using a datatable for my application. How do I get the total count of the rows in the datatable `onload`? My code:
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": []
});
)};
... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30346748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2696569/"
] | I tried most of the solution from the answers but not worked for me.
Some work but when we search,it shows same number instead number of rows after search.
```
var tbl=$('#tbl_name').DataTable();
console.log(tbl['context'][0]['aiDisplay'].length);
```
Its worked for me even after search,shows current number of r... | According to your description I assume that you have table with id="jobSearchResultTable".
Try this it could work for you.
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": [... |
30,346,748 | I am using a datatable for my application. How do I get the total count of the rows in the datatable `onload`? My code:
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": []
});
)};
... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30346748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2696569/"
] | **Update for New Versions**
```
table.data().count()
```
Reference:<https://datatables.net/reference/api/count()>
**For older versions:**
```
$(document).ready(function() {
//Initialize your table
var table = $('#jobSearchResultTable').dataTable();
//Get the total rows
alert(table.fnGetData().length);
});
```... | **October 2021** for Yajra Datatables
```
myTable.rows().count();
``` |
30,346,748 | I am using a datatable for my application. How do I get the total count of the rows in the datatable `onload`? My code:
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": []
});
)};
... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30346748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2696569/"
] | ```
$('#jobSearchResultTable').dataTable().rows().count()
``` | Please check out the following code
```
var table = $('#example').DataTable();
alert(
'Number of row entries: '+
table
.column( 0 )
.data()
.length
);
``` |
30,346,748 | I am using a datatable for my application. How do I get the total count of the rows in the datatable `onload`? My code:
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": []
});
)};
... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30346748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2696569/"
] | I tried most of the solution from the answers but not worked for me.
Some work but when we search,it shows same number instead number of rows after search.
```
var tbl=$('#tbl_name').DataTable();
console.log(tbl['context'][0]['aiDisplay'].length);
```
Its worked for me even after search,shows current number of r... | //get number of entire rows
table.rows().eq(0).length; |
30,346,748 | I am using a datatable for my application. How do I get the total count of the rows in the datatable `onload`? My code:
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": []
});
)};
... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30346748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2696569/"
] | I tried most of the solution from the answers but not worked for me.
Some work but when we search,it shows same number instead number of rows after search.
```
var tbl=$('#tbl_name').DataTable();
console.log(tbl['context'][0]['aiDisplay'].length);
```
Its worked for me even after search,shows current number of r... | **October 2021** for Yajra Datatables
```
myTable.rows().count();
``` |
30,346,748 | I am using a datatable for my application. How do I get the total count of the rows in the datatable `onload`? My code:
```
$(document).ready( function() {
$('#jobSearchResultTable').dataTable({
responsive: true,
"scrollY": 500,
"scrollCollapse": true,
"jQueryUI": true,
"aaSorting": []
});
)};
... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30346748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2696569/"
] | Get response from serverside processing following way it works for me:
```
// tested with : DataTables 1.10.15
t1 = $('#item-list').DataTable({
"processing": true,
"serverSide": true,
"ajax":'url',
"drawCallback": function( settings, start, end, max, total, pre ) {
console.log(this.fnSettings... | ```
$('#jobSearchResultTable').dataTable().rows().count()
``` |
10,768,298 | i have a gridview automaticly connecting with sqldatasource1, etc. For the grid, I also have a search textbox If the user needs to filter the records it calls an another ((sqldatasource2-another procuder)) and put it in the same gridview ..,so i need to change the gridView.datasourceID to the another sqldatasource oncl... | 2012/05/26 | [
"https://Stackoverflow.com/questions/10768298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1359555/"
] | In the onclick button event just set
>
> gridview.datasource = newDataSource;
>
>
>
Then call the
>
> girdView.DataBind();
>
>
>
Let me know if this is what you needed.
If you are using visual studio 2010, you need to click on your .aspx file and then click design view in the bottom right of the window.... | You can give data source in code behind according to the condition.
```
if(someCondition)
myStoredProcedure = "storedProc1";
else
myStoredProcedure = "storedProc2";
SqlDataSource dataSource = new SqlDataSource(ConfigurationManager.ConnectionStrings["connstr"].ConnectionString, searchQuery);
... |
937,398 | I would like to log datetime, sender and recipient to a MySQL table for all mail send through Postfix/Dovecot (virtual users setup).
How can this be done?
Best regards. | 2018/10/26 | [
"https://serverfault.com/questions/937398",
"https://serverfault.com",
"https://serverfault.com/users/347107/"
] | Welcome [Phill Coxon](https://serverfault.com/users/493608/phill-coxon),
**Method 1**
This pure bash script seem to fit your needs
```
#!/usr/bin/env bash
declare id
declare name
declare url
declare version
while read line; do
if [[ ! ${line} =~ ^[\+\| ]]; then
if [[ ${line} =~ \|[[:space:]]*([[:digit:]]+)[[:... | While you can carefully parse text with bash, sometimes it's easier to rely on a dedicated text-processing tool, such as awk:
```
awk -F'|' ' NR > 3 && !/^+--/ { print $2, $3, $4} ' > log.txt
```
This tells awk to split up lines into fields based on a separator of `|`; the program code inside the single-quotes break... |
937,398 | I would like to log datetime, sender and recipient to a MySQL table for all mail send through Postfix/Dovecot (virtual users setup).
How can this be done?
Best regards. | 2018/10/26 | [
"https://serverfault.com/questions/937398",
"https://serverfault.com",
"https://serverfault.com/users/347107/"
] | Welcome [Phill Coxon](https://serverfault.com/users/493608/phill-coxon),
**Method 1**
This pure bash script seem to fit your needs
```
#!/usr/bin/env bash
declare id
declare name
declare url
declare version
while read line; do
if [[ ! ${line} =~ ^[\+\| ]]; then
if [[ ${line} =~ \|[[:space:]]*([[:digit:]]+)[[:... | Thank you so much @bioinfornatics and @jeff Schaller - I'm very appreciative of the level of detail you each provided.
I used both of your answers for my solution shown below where list\_command generates the table output and process\_command runs against each website id. I've tested it and it's working perfectly - I... |
937,398 | I would like to log datetime, sender and recipient to a MySQL table for all mail send through Postfix/Dovecot (virtual users setup).
How can this be done?
Best regards. | 2018/10/26 | [
"https://serverfault.com/questions/937398",
"https://serverfault.com",
"https://serverfault.com/users/347107/"
] | Thank you so much @bioinfornatics and @jeff Schaller - I'm very appreciative of the level of detail you each provided.
I used both of your answers for my solution shown below where list\_command generates the table output and process\_command runs against each website id. I've tested it and it's working perfectly - I... | While you can carefully parse text with bash, sometimes it's easier to rely on a dedicated text-processing tool, such as awk:
```
awk -F'|' ' NR > 3 && !/^+--/ { print $2, $3, $4} ' > log.txt
```
This tells awk to split up lines into fields based on a separator of `|`; the program code inside the single-quotes break... |
59,053,720 | I want a copy of each email sent from my HTML online form to create a log file in my server root filepath, which each phpmail() sent, adding to the log file.
I am using the current php post file. Is there any method to do it?
```
<?php
$webmaster_email = ("myemail@domain.co.uk");
$email_address = $_REQUEST['email'] ... | 2019/11/26 | [
"https://Stackoverflow.com/questions/59053720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can log the `mail` result and other info directly in a file used as log:
```
if(mail( "$webmaster_email", "Contact Form Results", $msg ))
{
// email sent
logMail("$webmaster_email", "Contact Form Results", 1);
}
else
{
// email failed
logMail("$webmaster_email", "Contact Form Results", 0);
}
funct... | Have you tried to configure `mail.log` (Available since PHP 5.3.0) in `php.ini`?
<https://www.php.net/manual/en/mail.configuration.php>
>
> mail.log string
>
>
> The path to a log file that will log all mail() calls. Log entries include the full path of the script, line number, To address and headers.
>
>
> |
33,815,531 | I am learning to use Java and code on my own, I am network Tech and wanted to learn how to Code. I am learning from a site called programming by doing and I am stuck on one assignment:
<https://programmingbydoing.com/a/twenty-questions.html>
below is my code, it will compile but the issue is with the nested if statem... | 2015/11/19 | [
"https://Stackoverflow.com/questions/33815531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5583490/"
] | First off all, you need to remove the semicolon after
```
else if (question1.equals("mineral"))
```
Then, you need to add a final `else` block at the end of the `if` statement to catch input that does not match any of the three inputs. Then it will be able to compile:
```
...
else if (question1.equals("min... | THANK YOU ALL here is my final code that works thanks to everyone...:
import java.util.Scanner;
public class twentyQuestions
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
String question1, question2, guess = "";
```
System.out.println("TWO QUESTIONS!");
System.out... |
39,901,934 | I'm working with Nexus3 groovy scripting to Provision/Bootstrap my Nexus3 - OSS instance. While looking through [the complex scripting examples and the shell scripting examples](https://github.com/sonatype/nexus-book-examples/tree/nexus-3.0.x/scripting) as well as [the sonatype books](http://books.sonatype.com/nexus-bo... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39901934",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6933266/"
] | I think, it's bit a late update.
It seems , you are passing up the wrong parameter type for privilege and role.
I'd suggest you try below :-
`security.addRole('admin.role', 'Admin', 'Some Description', ['nx-admin'], ['LDAPGroupName'])` | The script below adds mapping from LDAP role to nexus role.
```
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import org.sonatype.nexus.security.SecuritySystem
def request = new JsonSlurper().parseText(args)
String ldap = request.ldap
String name = request.name ?: request.ldap
String nexus = request.ne... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.