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 |
|---|---|---|---|---|---|
5,453,487 | Example my current URL is
```
http://domain.com/category/health-beauty/?session={%22session_key%22%3A%22df1eca3f79e122bd915651e5-1325102496%22%2C%22uid%22%3A%221325102496%22%2C%22expires%22%3A0%2C%22secret%22%3A%229eb858d1fc7dda2b37be912282a41382%22%2C%22base_domain%22%3A%22domain.com%22%2C%22access_token%22%3A%221939... | 2011/03/28 | [
"https://Stackoverflow.com/questions/5453487",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/106111/"
] | The following will strip out the query string from the url and refresh the page
```
if(window.location.indexOf('?') > -1) {
window.location = window.location.substr(0, window.location.indexOf('?'));
}
```
Also if you want to do this in php
```
$uri = $_SERVER['REQUEST_URI'];
if(strpos($uri, '?') !== false) {
he... | Have you looked at the PHP Server and Environment variables?
Server: <http://www.php.net/manual/en/reserved.variables.server.php>
Environment: <http://www.php.net/manual/en/reserved.variables.environment.php>
With your URL "http://domain.com/category/health-beauty/?session=..." they should contain something like... |
7,174,710 | I am well aware of techniques to convert `CString` to a C-style character. One of them is to use `strcpy`/`_tcscpy`, and others include using `CStrBuf`.
The problem:
```
char Destination[100];
CStringA Source; // A is for simplicity and explicit ANSI specification.
Source = "This is source string."
```
Now I want... | 2011/08/24 | [
"https://Stackoverflow.com/questions/7174710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264325/"
] | You cannot assign to arrays. This makes what you want impossible. Also, honestly, it's a pretty wrong thing to do - a magic-number-sized buffer? | An operator on `CString` won't solve the problem since you need to copy to `Destination` buffer although this assignment would change the value of Destination, which is impossible.
Somehow, you need an operator to achive this line:
```
strcpy(Destination, LPCSTR(Source)); // + buffer overflow protection
```
As you ... |
7,174,710 | I am well aware of techniques to convert `CString` to a C-style character. One of them is to use `strcpy`/`_tcscpy`, and others include using `CStrBuf`.
The problem:
```
char Destination[100];
CStringA Source; // A is for simplicity and explicit ANSI specification.
Source = "This is source string."
```
Now I want... | 2011/08/24 | [
"https://Stackoverflow.com/questions/7174710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264325/"
] | Well, I don't want to say that this is in any way recommendable, but you could hijack some lesser-used operator for a quick hack:
```
void operator<<=(char * dst, const std::string & s)
{
std::strcpy(dst, s.c_str());
}
int main()
{
char buf[100];
std::string s = "Hello";
buf <<= s;
}
```
You could even rig... | An operator on `CString` won't solve the problem since you need to copy to `Destination` buffer although this assignment would change the value of Destination, which is impossible.
Somehow, you need an operator to achive this line:
```
strcpy(Destination, LPCSTR(Source)); // + buffer overflow protection
```
As you ... |
154,244 | Is there a word for a shared idiolect or a dialect understood by only two people? | 2014/02/26 | [
"https://english.stackexchange.com/questions/154244",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/64001/"
] | **"[cryptolect](http://en.wiktionary.org/wiki/cryptolect)"** or "[**cant**](http://en.wikipedia.org/wiki/Cant_%28language%29)" would fit.
>
> **cryptolect** *(linguistics)* A secretive language form used by a subculture; an arcane cant.
>
>
>
---
>
> A **cant** (or **cryptolect**) is the jargon or argot of a g... | The phrase secret language is commonly used. |
48,294,352 | I think the reason I can't Google this answer, is because I don't know the terms to use. So apologies if this post frustrates.
What I want to create is an array of multi-part variables; so that a set of keywords can correspond with a corresponding MQTT topic. The background (unrelated to the question) - I intend natur... | 2018/01/17 | [
"https://Stackoverflow.com/questions/48294352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9227692/"
] | What you're asking for is a bash 4 feature called an *associative array*.
```
declare -A commands=(
["lounge tv on"]="lounge/tv{on}"
["lounge tv off"]="lounge/tv{off}"
["bedroom tv on"]="bedroom/tv{on}"
["bedroom tv off"]="bedroom/tv{off}"
)
```
A lookup is something like the following:
```
input="lounge tv... | Easiest way was to create a separate file, rather than creating a table.
so this is the contents of commands.txt:
```
lounge tv on;lounge/tv{on}
lounge television on;lounge/tv{on}
lounge tv off;lounge/tv{off}
lounge television off;lounge/tv{off}
```
..and the code to process the file:
```
commandsfile="/config/Scr... |
30,770,502 | In this entity:
```
public class Foo
{
public Guid Id { get; set; }
public string Type { get; set; }
public string Name { get; set; }
}
```
How can I customize the validation message in runtime using another property of entity or any other string obtained from the database?
The validation message for `R... | 2015/06/11 | [
"https://Stackoverflow.com/questions/30770502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3469098/"
] | With SVG, it would be easy - a circle is an element, and can have a click handler, and has `fill` that you can manipulate to change colour.
With Canvas, you need to:
* save the data for each circle you draw (center and radius)
* capture click on canvas as `cx, cy`
* check every circle data `x, y, r` you have, see whe... | With Canvas, you can use function addEventListener. There are quite a few mouse events you can detect: mousedown, mouseup, mousemove, mouseout and mouseover.
Here is a example:
```
<!DOCTYPE HTML>
<html>
<head>
<style>
html,
body {
width: 100%;
height: 10... |
30,770,502 | In this entity:
```
public class Foo
{
public Guid Id { get; set; }
public string Type { get; set; }
public string Name { get; set; }
}
```
How can I customize the validation message in runtime using another property of entity or any other string obtained from the database?
The validation message for `R... | 2015/06/11 | [
"https://Stackoverflow.com/questions/30770502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3469098/"
] | With SVG, it would be easy - a circle is an element, and can have a click handler, and has `fill` that you can manipulate to change colour.
With Canvas, you need to:
* save the data for each circle you draw (center and radius)
* capture click on canvas as `cx, cy`
* check every circle data `x, y, r` you have, see whe... | Just add the arc path again and use `isPointInPath()` with the mouse position. Only one arc can be tested at once, but it's fast to clear and add new paths. Do this in a loop.
Example
=======
```js
var c = document.querySelector("canvas"), ctx = c.getContext("2d");
getArc(50, 50, 40);
ctx.fill();
c.onclick = fun... |
30,770,502 | In this entity:
```
public class Foo
{
public Guid Id { get; set; }
public string Type { get; set; }
public string Name { get; set; }
}
```
How can I customize the validation message in runtime using another property of entity or any other string obtained from the database?
The validation message for `R... | 2015/06/11 | [
"https://Stackoverflow.com/questions/30770502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3469098/"
] | Just add the arc path again and use `isPointInPath()` with the mouse position. Only one arc can be tested at once, but it's fast to clear and add new paths. Do this in a loop.
Example
=======
```js
var c = document.querySelector("canvas"), ctx = c.getContext("2d");
getArc(50, 50, 40);
ctx.fill();
c.onclick = fun... | With Canvas, you can use function addEventListener. There are quite a few mouse events you can detect: mousedown, mouseup, mousemove, mouseout and mouseover.
Here is a example:
```
<!DOCTYPE HTML>
<html>
<head>
<style>
html,
body {
width: 100%;
height: 10... |
20,416,579 | Consider this table:
```
name mark1 mark2 mark3
x 1 2 2
y 2 2 2
z 1 2 3
```
Here, I need to select the non distinct for example consider row three, where it contains only one "2" in column2. For this how to write a SQL code? I have made it of using the count and distinct comma... | 2013/12/06 | [
"https://Stackoverflow.com/questions/20416579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3073085/"
] | Try it this way
```sql
SELECT *
FROM table1
WHERE mark1 <> mark2
AND mark1 <> mark3
AND mark2 <> mark3;
```
Output:
```
| NAME | MARK1 | MARK2 | MARK3 |
|------|-------|-------|-------|
| z | 1 | 2 | 3 |
```
Here is **[SQLFiddle](http://sqlfiddle.com/#!2/1b6004/1)** demo | in case you need to select all columns contain values that are unequal
like in this case row3
```
SELECT *
FROM table a
WHERE a.m1<>a.m2
AND a.m2<>a.m3
AND a.m1<>a.m3
```
`[see fiddle here](http://www.sqlfiddle.com/#!6/0659d/2)`
--------------------------------------------------------- |
20,416,579 | Consider this table:
```
name mark1 mark2 mark3
x 1 2 2
y 2 2 2
z 1 2 3
```
Here, I need to select the non distinct for example consider row three, where it contains only one "2" in column2. For this how to write a SQL code? I have made it of using the count and distinct comma... | 2013/12/06 | [
"https://Stackoverflow.com/questions/20416579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3073085/"
] | Try it this way
```sql
SELECT *
FROM table1
WHERE mark1 <> mark2
AND mark1 <> mark3
AND mark2 <> mark3;
```
Output:
```
| NAME | MARK1 | MARK2 | MARK3 |
|------|-------|-------|-------|
| z | 1 | 2 | 3 |
```
Here is **[SQLFiddle](http://sqlfiddle.com/#!2/1b6004/1)** demo | If I understand your question enough, it would be like this:
select \* from mark where (mark1<>mark2 and mark1<>mark3 and mark2<>mark3); |
80,227 | If I want to construct a word embedding by predicting a target word given context words, is it better to remove stop words or keep them?
>
> the quick brown fox jumped over the lazy dog
>
>
>
or
>
> quick brown fox jumped lazy dog
>
>
>
As a human, I feel like keeping the stop words makes it easier to under... | 2020/08/13 | [
"https://datascience.stackexchange.com/questions/80227",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/90404/"
] | It actually depends on the role you get as a Data Scientist. If you have to write production-quality code at a large software company, then you need to be knowing the basics of *Object-Oriented Programming (OOP)*. Object-Oriented Design (OOD), however, is something you need not necessarily know in a Data Science role. ... | **The $1^{st}$ is all about productionization of machine learning solutions.**
OOPs and OOD are just computer programming paradigms that you use to achieve this, and you can learn this independent of your background. Python is used for production systems (among other things).
Even though now you can get away with ave... |
80,227 | If I want to construct a word embedding by predicting a target word given context words, is it better to remove stop words or keep them?
>
> the quick brown fox jumped over the lazy dog
>
>
>
or
>
> quick brown fox jumped lazy dog
>
>
>
As a human, I feel like keeping the stop words makes it easier to under... | 2020/08/13 | [
"https://datascience.stackexchange.com/questions/80227",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/90404/"
] | It actually depends on the role you get as a Data Scientist. If you have to write production-quality code at a large software company, then you need to be knowing the basics of *Object-Oriented Programming (OOP)*. Object-Oriented Design (OOD), however, is something you need not necessarily know in a Data Science role. ... | Using python vs R is more of a personal choice, but most people I know in data science, including myself, use python.
If you decide to take up python, almost all of the python ML libraries are written using the OOP approach, hence, some of the API design and interactions (such as error/warning messages) will make more... |
80,227 | If I want to construct a word embedding by predicting a target word given context words, is it better to remove stop words or keep them?
>
> the quick brown fox jumped over the lazy dog
>
>
>
or
>
> quick brown fox jumped lazy dog
>
>
>
As a human, I feel like keeping the stop words makes it easier to under... | 2020/08/13 | [
"https://datascience.stackexchange.com/questions/80227",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/90404/"
] | Using python vs R is more of a personal choice, but most people I know in data science, including myself, use python.
If you decide to take up python, almost all of the python ML libraries are written using the OOP approach, hence, some of the API design and interactions (such as error/warning messages) will make more... | **The $1^{st}$ is all about productionization of machine learning solutions.**
OOPs and OOD are just computer programming paradigms that you use to achieve this, and you can learn this independent of your background. Python is used for production systems (among other things).
Even though now you can get away with ave... |
76,896 | I recently got a raise, which is great. However, I got my paycheck today and it seems to indicate that my raise is double what they told me it would be. My first instinct is that they are trying to make the raise retroactively apply to the previous pay period, but in case the next paycheck has a similar overpayment, wh... | 2016/09/29 | [
"https://workplace.stackexchange.com/questions/76896",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/22926/"
] | Instead of worrying about all the things that will happen if you secretly don't say anything and get overpaid a long time, the solution is simple.
Talk to your boss. Or potentially your payroll system administrator, if you have a way to check your salary online in a system and can verify it is correctly updated.
Figu... | They will want the money back and if it is a lot they will try to make repayment easier. This is because taking a employee to court is not a good idea. Think of the working atmosphere. Think of the cost. It is easier for all if you pay a bit back each month out of your pay instead.
If you think you are getting overpai... |
76,896 | I recently got a raise, which is great. However, I got my paycheck today and it seems to indicate that my raise is double what they told me it would be. My first instinct is that they are trying to make the raise retroactively apply to the previous pay period, but in case the next paycheck has a similar overpayment, wh... | 2016/09/29 | [
"https://workplace.stackexchange.com/questions/76896",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/22926/"
] | Instead of worrying about all the things that will happen if you secretly don't say anything and get overpaid a long time, the solution is simple.
Talk to your boss. Or potentially your payroll system administrator, if you have a way to check your salary online in a system and can verify it is correctly updated.
Figu... | >
> I got my paycheck today and it seems to indicate that my raise is
> double what they told me it would be. My first instinct is that they
> are trying to make the raise retroactively apply to the previous pay
> period, but in case the next paycheck has a similar overpayment, what
> should I do?
>
>
>
You sh... |
76,896 | I recently got a raise, which is great. However, I got my paycheck today and it seems to indicate that my raise is double what they told me it would be. My first instinct is that they are trying to make the raise retroactively apply to the previous pay period, but in case the next paycheck has a similar overpayment, wh... | 2016/09/29 | [
"https://workplace.stackexchange.com/questions/76896",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/22926/"
] | They will want the money back and if it is a lot they will try to make repayment easier. This is because taking a employee to court is not a good idea. Think of the working atmosphere. Think of the cost. It is easier for all if you pay a bit back each month out of your pay instead.
If you think you are getting overpai... | >
> I got my paycheck today and it seems to indicate that my raise is
> double what they told me it would be. My first instinct is that they
> are trying to make the raise retroactively apply to the previous pay
> period, but in case the next paycheck has a similar overpayment, what
> should I do?
>
>
>
You sh... |
41,956,616 | I have created an input box and it gets validated by tab key. But it needs to be validated when the enter button is to be pressed.
```js
function checktxt(h, v, w, c) {
var th = $("#" + h).val();
var tv = $("#" + v).val();
if (th.toLowerCase() == tv.toLowerCase()) {
$("." + c).show();
$("." + w).hid... | 2017/01/31 | [
"https://Stackoverflow.com/questions/41956616",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6790135/"
] | You can perform the validation when you detect the enter key is pressed.
```
$(document).keypress(function(e) {
if(e.which == 13) {
// enter pressed now validate
checktxt(h,v,w,c)
}
});
``` | Advisable to use saperate function for *enter* keypress and tab.
```
<input type="text" onkeypress="return runScript(event)" onblur="javascript:checktxt('texthidden1','textvisible1','wrong1','correct1');" />
```
javascript
```
function runScript(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13... |
41,956,616 | I have created an input box and it gets validated by tab key. But it needs to be validated when the enter button is to be pressed.
```js
function checktxt(h, v, w, c) {
var th = $("#" + h).val();
var tv = $("#" + v).val();
if (th.toLowerCase() == tv.toLowerCase()) {
$("." + c).show();
$("." + w).hid... | 2017/01/31 | [
"https://Stackoverflow.com/questions/41956616",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6790135/"
] | Enter inside input type
```
$("#textvisible1").on('keyup', function (e) {
if (e.keyCode == 13) {
// your code here
}
});
``` | Advisable to use saperate function for *enter* keypress and tab.
```
<input type="text" onkeypress="return runScript(event)" onblur="javascript:checktxt('texthidden1','textvisible1','wrong1','correct1');" />
```
javascript
```
function runScript(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13... |
32,121,115 | Given the following code
```
class A:
def __init__(self ):
self.b = B()
def __repr__(self):
#return "<A with {} inside>".format( self.b )
#return "<A with " + repr(self.b) + " inside>"
return "<A with " + self.b + " inside>" # TypeError: Can't convert 'B' object to str implicitly
class B:
def ... | 2015/08/20 | [
"https://Stackoverflow.com/questions/32121115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1619432/"
] | Concatenation doesn't cause `self.b` to be evaluated as a string. You need to explicitly tell Python to coerce it into a string.
You could do:
```
return "<A with " + repr(self.b) + " inside>"
```
But using `str.format` would be better.
```
return "<A with {} inside>".format(self.b)
```
However as jonrsharpe po... | You can use repr()
```
class A:
def __init__(self):
self.b = repr(B())
def __repr__(self):
return "<A with " + self.b + " inside>"
class B:
def __repr__(self):
return "<B>"
a = A()
print(repr(a))
```
its works for me |
16,509,174 | I'm trying to post data to a payment gateway website with the following jsp code:
```
System.setProperty("javax.net.ssl.trustStore ","C:\\Program Files\\Java\\jdk1.7.0_17\\jre\\lib\\security\\cacerts");\
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
URL server = new URL("https://...");
HttpURLCo... | 2013/05/12 | [
"https://Stackoverflow.com/questions/16509174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377715/"
] | Django command utility makemessages internally calls [xgettext](https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/xgettext-Invocation.html) program like this:
```
cmd = (
'xgettext -d %s -L Python %s %s --keyword=gettext_noop '
'--keyword=gettext_lazy --keyword=ngettext_lazy:1,2 '
'--keyw... | These notes about [multi-language support for Django project](http://devdoodles.wordpress.com/2009/02/14/multi-language-support-in-a-django-project/) may let you identify what is wrong. Most probably renaming is not the root cause for failure.
Some warnings in these notes:
* Each template for your web site must load... |
16,509,174 | I'm trying to post data to a payment gateway website with the following jsp code:
```
System.setProperty("javax.net.ssl.trustStore ","C:\\Program Files\\Java\\jdk1.7.0_17\\jre\\lib\\security\\cacerts");\
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
URL server = new URL("https://...");
HttpURLCo... | 2013/05/12 | [
"https://Stackoverflow.com/questions/16509174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377715/"
] | Unexpected ugettext aliases can be handled by overriding the `makemessages` command, such as in:
```
from django.core.management.commands import makemessages
class Command(makemessages.Command):
"""
Extends the makemessages command to look for additional aliases.
"""
xgettext_options = makemessages.Co... | These notes about [multi-language support for Django project](http://devdoodles.wordpress.com/2009/02/14/multi-language-support-in-a-django-project/) may let you identify what is wrong. Most probably renaming is not the root cause for failure.
Some warnings in these notes:
* Each template for your web site must load... |
16,509,174 | I'm trying to post data to a payment gateway website with the following jsp code:
```
System.setProperty("javax.net.ssl.trustStore ","C:\\Program Files\\Java\\jdk1.7.0_17\\jre\\lib\\security\\cacerts");\
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
URL server = new URL("https://...");
HttpURLCo... | 2013/05/12 | [
"https://Stackoverflow.com/questions/16509174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377715/"
] | Django command utility makemessages internally calls [xgettext](https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/xgettext-Invocation.html) program like this:
```
cmd = (
'xgettext -d %s -L Python %s %s --keyword=gettext_noop '
'--keyword=gettext_lazy --keyword=ngettext_lazy:1,2 '
'--keyw... | Unexpected ugettext aliases can be handled by overriding the `makemessages` command, such as in:
```
from django.core.management.commands import makemessages
class Command(makemessages.Command):
"""
Extends the makemessages command to look for additional aliases.
"""
xgettext_options = makemessages.Co... |
16,509,174 | I'm trying to post data to a payment gateway website with the following jsp code:
```
System.setProperty("javax.net.ssl.trustStore ","C:\\Program Files\\Java\\jdk1.7.0_17\\jre\\lib\\security\\cacerts");\
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
URL server = new URL("https://...");
HttpURLCo... | 2013/05/12 | [
"https://Stackoverflow.com/questions/16509174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377715/"
] | Django command utility makemessages internally calls [xgettext](https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/xgettext-Invocation.html) program like this:
```
cmd = (
'xgettext -d %s -L Python %s %s --keyword=gettext_noop '
'--keyword=gettext_lazy --keyword=ngettext_lazy:1,2 '
'--keyw... | Another way for resolving no .po files generation are the development server.
During my development server is running I executed the command **makemessage**. Command output was right, but my .po files were updated :
```
(venv_crypto_bot) macbook-pro:django_project dauzon$ python manage.py makemessages -a
processing ... |
16,509,174 | I'm trying to post data to a payment gateway website with the following jsp code:
```
System.setProperty("javax.net.ssl.trustStore ","C:\\Program Files\\Java\\jdk1.7.0_17\\jre\\lib\\security\\cacerts");\
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
URL server = new URL("https://...");
HttpURLCo... | 2013/05/12 | [
"https://Stackoverflow.com/questions/16509174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377715/"
] | Django command utility makemessages internally calls [xgettext](https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/xgettext-Invocation.html) program like this:
```
cmd = (
'xgettext -d %s -L Python %s %s --keyword=gettext_noop '
'--keyword=gettext_lazy --keyword=ngettext_lazy:1,2 '
'--keyw... | You can create your own `compilemessages` command, to call the original `compilemessages` command with extra arguments.
For example, to support `from django.utils.translation import pgettext_lazy as _p`:
```py
# Created by BaiJiFeiLong@gmail.com at 2022/4/20
from django.core.management import call_command
from django... |
16,509,174 | I'm trying to post data to a payment gateway website with the following jsp code:
```
System.setProperty("javax.net.ssl.trustStore ","C:\\Program Files\\Java\\jdk1.7.0_17\\jre\\lib\\security\\cacerts");\
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
URL server = new URL("https://...");
HttpURLCo... | 2013/05/12 | [
"https://Stackoverflow.com/questions/16509174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377715/"
] | Unexpected ugettext aliases can be handled by overriding the `makemessages` command, such as in:
```
from django.core.management.commands import makemessages
class Command(makemessages.Command):
"""
Extends the makemessages command to look for additional aliases.
"""
xgettext_options = makemessages.Co... | Another way for resolving no .po files generation are the development server.
During my development server is running I executed the command **makemessage**. Command output was right, but my .po files were updated :
```
(venv_crypto_bot) macbook-pro:django_project dauzon$ python manage.py makemessages -a
processing ... |
16,509,174 | I'm trying to post data to a payment gateway website with the following jsp code:
```
System.setProperty("javax.net.ssl.trustStore ","C:\\Program Files\\Java\\jdk1.7.0_17\\jre\\lib\\security\\cacerts");\
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
URL server = new URL("https://...");
HttpURLCo... | 2013/05/12 | [
"https://Stackoverflow.com/questions/16509174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377715/"
] | Unexpected ugettext aliases can be handled by overriding the `makemessages` command, such as in:
```
from django.core.management.commands import makemessages
class Command(makemessages.Command):
"""
Extends the makemessages command to look for additional aliases.
"""
xgettext_options = makemessages.Co... | You can create your own `compilemessages` command, to call the original `compilemessages` command with extra arguments.
For example, to support `from django.utils.translation import pgettext_lazy as _p`:
```py
# Created by BaiJiFeiLong@gmail.com at 2022/4/20
from django.core.management import call_command
from django... |
61,841,764 | This is raw data to create the two tables:
```
Create table Customers (Id int, Name varchar(255));
Create table Orders (Id int, CustomerId int);
insert into Customers (id,name) values
('1', 'Joe'),
('2', 'Henry'),
('3', 'Sam'),
('4', 'Max');
insert into Orders (Id, CustomerId) values
('1', '3'), ('2', '1');
```
A... | 2020/05/16 | [
"https://Stackoverflow.com/questions/61841764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13111157/"
] | You cannot and don't need to add an alias in this case. The subquery is local to the `NOT IN` operation and cannot be referenced anywhere else anyway.
Apart from that, what you could do is to use `NOT EXISTS` instead of `NOT IN`. `NOT EXISTS` can perform better especially when `orders` is large but there's an index on... | As "sticky bit" mentions, there's no need to add an alias to your subquery after `not in` because it cannot be referenced in other places.
Here is a different, but potentially simpler approach for returning customers who never order anything. By using a left join, all rows from the `Customers` table are returned. And... |
69,760,676 | I'm writing an app for a client who doesn't have an official API but wants the app to extract video links from his website so I wrote a logic using jsoup. Everything seems to work fine except some of the links don't start with https so I'm trying to add it before the URL.
Here's my code:
```
new Thread(() -... | 2021/10/28 | [
"https://Stackoverflow.com/questions/69760676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11262996/"
] | You need to iterate over your final array to apply your function to **all** links.
```
String[] links_array = linksStr.split("\n");
for(int i = 0; i < length; i++)
if(!links_array[i].startsWith("https://"))
links_array[i] = "https:" + links_array[i];
``` | If this code working just for first missing link:
```
if (!linksStr.startsWith("https://")) {
linksStr = "https:" + linksStr;
}
```
I believe you can use loop for control every link. |
39,835,286 | Sorry I know there's a lot of posts about that but I can't find a solution in those.
Here's my form :
```
<form id="form1" action="upload.php" method="post" enctype="multipart/form-data">
<table>
<tr>
<td>Name : </td>
<td><input type="text" id="name" name="name"/></td>
</tr>
<tr>
... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39835286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5524298/"
] | The way to do this would be to override the `LinkProvider` with a custom one. When it see's an item based on the template you are using to create the "virtual" items, you can then use the data on that item to workout what the link to create should be. If the item is not of that template, then you can just pass it throu... | I resolved my problem in quite an easier way.
I added a new field called Url with type of General Link to the template that I had created in Sitecore for these temporary virtual items.
I used it in my virtual item creation like this:
```
Sitecore.Data.Fields.LinkField link = item.Fields["Url"];
link.Url = hubSpotRes... |
38,506,333 | I am trying to check internet connectivity in a fragment which implements ConnectivityReceiver.ConnectivityReceiverListener. The Code is as follows
ConnectivityReceiver.java
```
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityMana... | 2016/07/21 | [
"https://Stackoverflow.com/questions/38506333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5815636/"
] | First check if the getInstance method returns null and if so check the Android Manifest.
Your manifest should contain something like that:
```
<application
android:name=".yourpackage.MyApplication"
android:label="@string/app_name"
more code here.
``` | It must be your Application not declared at manifest,add it.
and two advices:
First, connectivityReceiverListener is static,you register it, remember to unRegister it,or it will be leak the memory.
Second,your get Application instance is complicated and inefficient,there is no need use a synchronized method! just use ... |
57,814,399 | I want to duplicate my dataset on different flight altitude levels. I can do it manually creating dataframes with differing levels of altitude and then rbind them together. But, i want to make it faster by involving a for loop?
this is the example dataset:
```
structure(list(heading = c(0L, 71L, 132L, 143L, 78L, 125L... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57814399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7783195/"
] | This can be done purely through a `cbind` as the rows of the original data will repeat:
```
cbind(dat, alt=rep(seq(100,5100,100), each=nrow(dat)))
```
This should be much faster than looping over values. | Create a sequence, use `lapply` to loop over it `transform` to add new column and `rbind`
```
do.call(rbind, lapply(seq(100, 5100, 100), function(x) transform(df, alt = x)))
# heading thermal WS trackId alt
#1 0 1.258233 17.159002 mwb1501 100
#2 71 1.297272 7.606632 mwb1501 100
#3 132 1.6... |
57,814,399 | I want to duplicate my dataset on different flight altitude levels. I can do it manually creating dataframes with differing levels of altitude and then rbind them together. But, i want to make it faster by involving a for loop?
this is the example dataset:
```
structure(list(heading = c(0L, 71L, 132L, 143L, 78L, 125L... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57814399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7783195/"
] | Consider a cross join `merge`:
```
expanded_df <- merge(df, data.frame(alt=seq(100, 5100, 100)), by = NULL)
``` | Create a sequence, use `lapply` to loop over it `transform` to add new column and `rbind`
```
do.call(rbind, lapply(seq(100, 5100, 100), function(x) transform(df, alt = x)))
# heading thermal WS trackId alt
#1 0 1.258233 17.159002 mwb1501 100
#2 71 1.297272 7.606632 mwb1501 100
#3 132 1.6... |
57,814,399 | I want to duplicate my dataset on different flight altitude levels. I can do it manually creating dataframes with differing levels of altitude and then rbind them together. But, i want to make it faster by involving a for loop?
this is the example dataset:
```
structure(list(heading = c(0L, 71L, 132L, 143L, 78L, 125L... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57814399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7783195/"
] | This can be done purely through a `cbind` as the rows of the original data will repeat:
```
cbind(dat, alt=rep(seq(100,5100,100), each=nrow(dat)))
```
This should be much faster than looping over values. | We can use `crossing` from the `tidyr` package.
```
library(dplyr)
library(tidyr)
df2 <- crossing(df, tibble(alt = seq(100, 5100, 100)))
```
If the order is important, create an ID column, arrage it, and then delete it.
```
df3 <- df %>%
mutate(ID = 1:n()) %>%
crossing(tibble(alt = seq(100, 5100, 100))) %>%
... |
57,814,399 | I want to duplicate my dataset on different flight altitude levels. I can do it manually creating dataframes with differing levels of altitude and then rbind them together. But, i want to make it faster by involving a for loop?
this is the example dataset:
```
structure(list(heading = c(0L, 71L, 132L, 143L, 78L, 125L... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57814399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7783195/"
] | Consider a cross join `merge`:
```
expanded_df <- merge(df, data.frame(alt=seq(100, 5100, 100)), by = NULL)
``` | We can use `crossing` from the `tidyr` package.
```
library(dplyr)
library(tidyr)
df2 <- crossing(df, tibble(alt = seq(100, 5100, 100)))
```
If the order is important, create an ID column, arrage it, and then delete it.
```
df3 <- df %>%
mutate(ID = 1:n()) %>%
crossing(tibble(alt = seq(100, 5100, 100))) %>%
... |
57,814,399 | I want to duplicate my dataset on different flight altitude levels. I can do it manually creating dataframes with differing levels of altitude and then rbind them together. But, i want to make it faster by involving a for loop?
this is the example dataset:
```
structure(list(heading = c(0L, 71L, 132L, 143L, 78L, 125L... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57814399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7783195/"
] | This can be done purely through a `cbind` as the rows of the original data will repeat:
```
cbind(dat, alt=rep(seq(100,5100,100), each=nrow(dat)))
```
This should be much faster than looping over values. | Another (fast) `data.table`-based alternative would be to do
```
library(data.table)
setDT(df)[, .(alt = seq(100, 5100, 100)), by = names(df)]
# heading thermal WS trackId alt
# 1: 0 1.258233 17.159002 mwb1501 100
# 2: 0 1.258233 17.159002 mwb1501 200
# 3: 0 1.258233 17.159002 mwb1501 ... |
57,814,399 | I want to duplicate my dataset on different flight altitude levels. I can do it manually creating dataframes with differing levels of altitude and then rbind them together. But, i want to make it faster by involving a for loop?
this is the example dataset:
```
structure(list(heading = c(0L, 71L, 132L, 143L, 78L, 125L... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57814399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7783195/"
] | Consider a cross join `merge`:
```
expanded_df <- merge(df, data.frame(alt=seq(100, 5100, 100)), by = NULL)
``` | Another (fast) `data.table`-based alternative would be to do
```
library(data.table)
setDT(df)[, .(alt = seq(100, 5100, 100)), by = names(df)]
# heading thermal WS trackId alt
# 1: 0 1.258233 17.159002 mwb1501 100
# 2: 0 1.258233 17.159002 mwb1501 200
# 3: 0 1.258233 17.159002 mwb1501 ... |
54,281,849 | I have:
```
array = [1, 4, -1, 3, 2]
```
I want a new array that follows the following logic:
* First element is located at index 0, so it is 1.
* Second element is located at index 1 (because value for index 0 was 1).
* Third element is located at index 4, so it is 2.
* And so on until the loop meets value -1, whi... | 2019/01/20 | [
"https://Stackoverflow.com/questions/54281849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10443890/"
] | As others say, you need to change the index in your loop. Also, if you want `-1` in the result, you should exit at bottom. And `with_index` will give you indices in order, which is not what you want here. This will do what you want:
```
def task(a)
i = 0
array = []
begin
i = a[i]
array << i
end until i... | ```
until a[i] == -1
array << a[result]
end
```
This code is looping eternally - there is nothing to change `i` . |
54,281,849 | I have:
```
array = [1, 4, -1, 3, 2]
```
I want a new array that follows the following logic:
* First element is located at index 0, so it is 1.
* Second element is located at index 1 (because value for index 0 was 1).
* Third element is located at index 4, so it is 2.
* And so on until the loop meets value -1, whi... | 2019/01/20 | [
"https://Stackoverflow.com/questions/54281849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10443890/"
] | ```
until a[i] == -1
array << a[result]
end
```
This code is looping eternally - there is nothing to change `i` . | As discussed in the comments, you are looping through the array which is not what you require.
You could use a recursive method to handle jumping from one element to another based on previous value. Consider the following:
```
arr = [1, 4, -1, 3, 2]
def task(arr, n=0, result=[])
if arr[n] == -1
return result +... |
54,281,849 | I have:
```
array = [1, 4, -1, 3, 2]
```
I want a new array that follows the following logic:
* First element is located at index 0, so it is 1.
* Second element is located at index 1 (because value for index 0 was 1).
* Third element is located at index 4, so it is 2.
* And so on until the loop meets value -1, whi... | 2019/01/20 | [
"https://Stackoverflow.com/questions/54281849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10443890/"
] | ```
until a[i] == -1
array << a[result]
end
```
This code is looping eternally - there is nothing to change `i` . | ```
input_array = [1, 4, -1, 3, 2]
last_valid_index = input_array.find_index { |entry| entry < 0 }
first_element = input_array.first
last_element = input_array[last_valid_index]
middle_elements = (1..last_valid_index).map { |i| input_array[input_array[i-1]]}
output_array = [first_element] + middle_elements + [last_ele... |
54,281,849 | I have:
```
array = [1, 4, -1, 3, 2]
```
I want a new array that follows the following logic:
* First element is located at index 0, so it is 1.
* Second element is located at index 1 (because value for index 0 was 1).
* Third element is located at index 4, so it is 2.
* And so on until the loop meets value -1, whi... | 2019/01/20 | [
"https://Stackoverflow.com/questions/54281849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10443890/"
] | ```
until a[i] == -1
array << a[result]
end
```
This code is looping eternally - there is nothing to change `i` . | I'd suggest this option, just to avoid infinite loops or index out range:
```
i, ary = 0, [array[0]]
array.size.times do
break if array[i] == -1 or array[i] > array.size - 1
i = array[i]
ary << array[i]
end
ary #=> [1, 4, 2, -1]
```
An infinite loop happens for example when `array = [1, 4, -1, 0, 3]`.
Index o... |
54,281,849 | I have:
```
array = [1, 4, -1, 3, 2]
```
I want a new array that follows the following logic:
* First element is located at index 0, so it is 1.
* Second element is located at index 1 (because value for index 0 was 1).
* Third element is located at index 4, so it is 2.
* And so on until the loop meets value -1, whi... | 2019/01/20 | [
"https://Stackoverflow.com/questions/54281849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10443890/"
] | As others say, you need to change the index in your loop. Also, if you want `-1` in the result, you should exit at bottom. And `with_index` will give you indices in order, which is not what you want here. This will do what you want:
```
def task(a)
i = 0
array = []
begin
i = a[i]
array << i
end until i... | As discussed in the comments, you are looping through the array which is not what you require.
You could use a recursive method to handle jumping from one element to another based on previous value. Consider the following:
```
arr = [1, 4, -1, 3, 2]
def task(arr, n=0, result=[])
if arr[n] == -1
return result +... |
54,281,849 | I have:
```
array = [1, 4, -1, 3, 2]
```
I want a new array that follows the following logic:
* First element is located at index 0, so it is 1.
* Second element is located at index 1 (because value for index 0 was 1).
* Third element is located at index 4, so it is 2.
* And so on until the loop meets value -1, whi... | 2019/01/20 | [
"https://Stackoverflow.com/questions/54281849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10443890/"
] | As others say, you need to change the index in your loop. Also, if you want `-1` in the result, you should exit at bottom. And `with_index` will give you indices in order, which is not what you want here. This will do what you want:
```
def task(a)
i = 0
array = []
begin
i = a[i]
array << i
end until i... | ```
input_array = [1, 4, -1, 3, 2]
last_valid_index = input_array.find_index { |entry| entry < 0 }
first_element = input_array.first
last_element = input_array[last_valid_index]
middle_elements = (1..last_valid_index).map { |i| input_array[input_array[i-1]]}
output_array = [first_element] + middle_elements + [last_ele... |
54,281,849 | I have:
```
array = [1, 4, -1, 3, 2]
```
I want a new array that follows the following logic:
* First element is located at index 0, so it is 1.
* Second element is located at index 1 (because value for index 0 was 1).
* Third element is located at index 4, so it is 2.
* And so on until the loop meets value -1, whi... | 2019/01/20 | [
"https://Stackoverflow.com/questions/54281849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10443890/"
] | As others say, you need to change the index in your loop. Also, if you want `-1` in the result, you should exit at bottom. And `with_index` will give you indices in order, which is not what you want here. This will do what you want:
```
def task(a)
i = 0
array = []
begin
i = a[i]
array << i
end until i... | I'd suggest this option, just to avoid infinite loops or index out range:
```
i, ary = 0, [array[0]]
array.size.times do
break if array[i] == -1 or array[i] > array.size - 1
i = array[i]
ary << array[i]
end
ary #=> [1, 4, 2, -1]
```
An infinite loop happens for example when `array = [1, 4, -1, 0, 3]`.
Index o... |
54,281,849 | I have:
```
array = [1, 4, -1, 3, 2]
```
I want a new array that follows the following logic:
* First element is located at index 0, so it is 1.
* Second element is located at index 1 (because value for index 0 was 1).
* Third element is located at index 4, so it is 2.
* And so on until the loop meets value -1, whi... | 2019/01/20 | [
"https://Stackoverflow.com/questions/54281849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10443890/"
] | As discussed in the comments, you are looping through the array which is not what you require.
You could use a recursive method to handle jumping from one element to another based on previous value. Consider the following:
```
arr = [1, 4, -1, 3, 2]
def task(arr, n=0, result=[])
if arr[n] == -1
return result +... | ```
input_array = [1, 4, -1, 3, 2]
last_valid_index = input_array.find_index { |entry| entry < 0 }
first_element = input_array.first
last_element = input_array[last_valid_index]
middle_elements = (1..last_valid_index).map { |i| input_array[input_array[i-1]]}
output_array = [first_element] + middle_elements + [last_ele... |
54,281,849 | I have:
```
array = [1, 4, -1, 3, 2]
```
I want a new array that follows the following logic:
* First element is located at index 0, so it is 1.
* Second element is located at index 1 (because value for index 0 was 1).
* Third element is located at index 4, so it is 2.
* And so on until the loop meets value -1, whi... | 2019/01/20 | [
"https://Stackoverflow.com/questions/54281849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10443890/"
] | As discussed in the comments, you are looping through the array which is not what you require.
You could use a recursive method to handle jumping from one element to another based on previous value. Consider the following:
```
arr = [1, 4, -1, 3, 2]
def task(arr, n=0, result=[])
if arr[n] == -1
return result +... | I'd suggest this option, just to avoid infinite loops or index out range:
```
i, ary = 0, [array[0]]
array.size.times do
break if array[i] == -1 or array[i] > array.size - 1
i = array[i]
ary << array[i]
end
ary #=> [1, 4, 2, -1]
```
An infinite loop happens for example when `array = [1, 4, -1, 0, 3]`.
Index o... |
55,005 | Is it bad practice to launch a webpage in Safari from your iOS app? It seems to have its pro's and con's.
**Pros**
* The transition to Safari looks better than to an in-app browser
* Users are more comfortable using Safari because they use it more often
* The overall layout/look of Safari looks better than in-app bro... | 2014/04/01 | [
"https://ux.stackexchange.com/questions/55005",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/46045/"
] | Apps that people use a lot (e.g. Facebook, Twitter, etc.) from my experience all seem to have a built in browser, with the option to open in safari.
I'd say that's the best experience for a user; some users will want to open it in safari, and you're then providing that option for them. Others, however, will just expec... | I don't know what kind of app this is for, but often times users find too much navigation frustrating. Some people may not be aware that clicking this link will bring them to Safari, so offer a pop-up after clicking the link that confirms they would like to move to the page on Safari. The other issue you have is that y... |
42,449 | Подхалим — он же лизоблюд, он же блюдолиз, он же льстец и т. д. Собственно, значение слова ни у кого вопросов не вызывает. А вот о его происхождении хотелось бы узнать.
Например, тут явно видна приставка **под-**, но кто такой, извиняюсь, "халим"?
В общем, было бы очень интересно узнать происхождение корня слова ... | 2014/11/19 | [
"https://rus.stackexchange.com/questions/42449",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/3/"
] | Скорее всего от слова ХОЛИТЬ. | подхалим
Искон. Суф.-преф. производное от той же основы, что нахал, холуй. Ср. аналогичное по структуре побратим.
подхалим — Но мнению Долобко (Сб. Соболевскому 230), от \*хoliti (см. холить), первонач. избалованный человек . Далее сюда же нахал, болг. охален распущенный ; см. также Желтов, ФЗ, 1876, вып. 1, стр. 23; Г... |
42,449 | Подхалим — он же лизоблюд, он же блюдолиз, он же льстец и т. д. Собственно, значение слова ни у кого вопросов не вызывает. А вот о его происхождении хотелось бы узнать.
Например, тут явно видна приставка **под-**, но кто такой, извиняюсь, "халим"?
В общем, было бы очень интересно узнать происхождение корня слова ... | 2014/11/19 | [
"https://rus.stackexchange.com/questions/42449",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/3/"
] | Скорее всего от слова ХОЛИТЬ. | Слово "халим" у арабов, татар и крымских татар является именем. Переводится как мягкий, добрый, в чём то женственный, мягкотелый, подкаблучник (человек, не имеющий своей воли и не принимающий решения самостоятельно). Приставка "под" и "халим". |
42,449 | Подхалим — он же лизоблюд, он же блюдолиз, он же льстец и т. д. Собственно, значение слова ни у кого вопросов не вызывает. А вот о его происхождении хотелось бы узнать.
Например, тут явно видна приставка **под-**, но кто такой, извиняюсь, "халим"?
В общем, было бы очень интересно узнать происхождение корня слова ... | 2014/11/19 | [
"https://rus.stackexchange.com/questions/42449",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/3/"
] | Скорее всего от слова ХОЛИТЬ. | Анализ слова "подхалим"
Подхалим > pod-xalim > pod-xvalnj - подхвальный (слав.)(пропуск v) от сущ. хвала; подхваливать, т.е. льстить.
Есть аналог в чувашском языке "мухтав"
мухтав – слава, хвала (чув.) > muxtab > batxum > pod-xalim - подхалим (слав.)(пропуск l)
есть интересный баннер на дороге Чувашии:
мухтав мухтав... |
42,449 | Подхалим — он же лизоблюд, он же блюдолиз, он же льстец и т. д. Собственно, значение слова ни у кого вопросов не вызывает. А вот о его происхождении хотелось бы узнать.
Например, тут явно видна приставка **под-**, но кто такой, извиняюсь, "халим"?
В общем, было бы очень интересно узнать происхождение корня слова ... | 2014/11/19 | [
"https://rus.stackexchange.com/questions/42449",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/3/"
] | Скорее от «обхаживать», «ухаживать». Ведь «холить» происходит от «холка». Не так давно люди вместо автомобилей держали лошадей, а расчёсывая гриву, растущую на **холке** у своих питомцев, они совершали действие, которое и породило такое слово как **холить**. Правда, вышеупомянутые слова обхаживать и ухаживать подходят ... | подхалим
Искон. Суф.-преф. производное от той же основы, что нахал, холуй. Ср. аналогичное по структуре побратим.
подхалим — Но мнению Долобко (Сб. Соболевскому 230), от \*хoliti (см. холить), первонач. избалованный человек . Далее сюда же нахал, болг. охален распущенный ; см. также Желтов, ФЗ, 1876, вып. 1, стр. 23; Г... |
42,449 | Подхалим — он же лизоблюд, он же блюдолиз, он же льстец и т. д. Собственно, значение слова ни у кого вопросов не вызывает. А вот о его происхождении хотелось бы узнать.
Например, тут явно видна приставка **под-**, но кто такой, извиняюсь, "халим"?
В общем, было бы очень интересно узнать происхождение корня слова ... | 2014/11/19 | [
"https://rus.stackexchange.com/questions/42449",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/3/"
] | Скорее от «обхаживать», «ухаживать». Ведь «холить» происходит от «холка». Не так давно люди вместо автомобилей держали лошадей, а расчёсывая гриву, растущую на **холке** у своих питомцев, они совершали действие, которое и породило такое слово как **холить**. Правда, вышеупомянутые слова обхаживать и ухаживать подходят ... | Слово "халим" у арабов, татар и крымских татар является именем. Переводится как мягкий, добрый, в чём то женственный, мягкотелый, подкаблучник (человек, не имеющий своей воли и не принимающий решения самостоятельно). Приставка "под" и "халим". |
42,449 | Подхалим — он же лизоблюд, он же блюдолиз, он же льстец и т. д. Собственно, значение слова ни у кого вопросов не вызывает. А вот о его происхождении хотелось бы узнать.
Например, тут явно видна приставка **под-**, но кто такой, извиняюсь, "халим"?
В общем, было бы очень интересно узнать происхождение корня слова ... | 2014/11/19 | [
"https://rus.stackexchange.com/questions/42449",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/3/"
] | Скорее от «обхаживать», «ухаживать». Ведь «холить» происходит от «холка». Не так давно люди вместо автомобилей держали лошадей, а расчёсывая гриву, растущую на **холке** у своих питомцев, они совершали действие, которое и породило такое слово как **холить**. Правда, вышеупомянутые слова обхаживать и ухаживать подходят ... | Анализ слова "подхалим"
Подхалим > pod-xalim > pod-xvalnj - подхвальный (слав.)(пропуск v) от сущ. хвала; подхваливать, т.е. льстить.
Есть аналог в чувашском языке "мухтав"
мухтав – слава, хвала (чув.) > muxtab > batxum > pod-xalim - подхалим (слав.)(пропуск l)
есть интересный баннер на дороге Чувашии:
мухтав мухтав... |
42,449 | Подхалим — он же лизоблюд, он же блюдолиз, он же льстец и т. д. Собственно, значение слова ни у кого вопросов не вызывает. А вот о его происхождении хотелось бы узнать.
Например, тут явно видна приставка **под-**, но кто такой, извиняюсь, "халим"?
В общем, было бы очень интересно узнать происхождение корня слова ... | 2014/11/19 | [
"https://rus.stackexchange.com/questions/42449",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/3/"
] | подхалим
Искон. Суф.-преф. производное от той же основы, что нахал, холуй. Ср. аналогичное по структуре побратим.
подхалим — Но мнению Долобко (Сб. Соболевскому 230), от \*хoliti (см. холить), первонач. избалованный человек . Далее сюда же нахал, болг. охален распущенный ; см. также Желтов, ФЗ, 1876, вып. 1, стр. 23; Г... | Слово "халим" у арабов, татар и крымских татар является именем. Переводится как мягкий, добрый, в чём то женственный, мягкотелый, подкаблучник (человек, не имеющий своей воли и не принимающий решения самостоятельно). Приставка "под" и "халим". |
42,449 | Подхалим — он же лизоблюд, он же блюдолиз, он же льстец и т. д. Собственно, значение слова ни у кого вопросов не вызывает. А вот о его происхождении хотелось бы узнать.
Например, тут явно видна приставка **под-**, но кто такой, извиняюсь, "халим"?
В общем, было бы очень интересно узнать происхождение корня слова ... | 2014/11/19 | [
"https://rus.stackexchange.com/questions/42449",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/3/"
] | подхалим
Искон. Суф.-преф. производное от той же основы, что нахал, холуй. Ср. аналогичное по структуре побратим.
подхалим — Но мнению Долобко (Сб. Соболевскому 230), от \*хoliti (см. холить), первонач. избалованный человек . Далее сюда же нахал, болг. охален распущенный ; см. также Желтов, ФЗ, 1876, вып. 1, стр. 23; Г... | Анализ слова "подхалим"
Подхалим > pod-xalim > pod-xvalnj - подхвальный (слав.)(пропуск v) от сущ. хвала; подхваливать, т.е. льстить.
Есть аналог в чувашском языке "мухтав"
мухтав – слава, хвала (чув.) > muxtab > batxum > pod-xalim - подхалим (слав.)(пропуск l)
есть интересный баннер на дороге Чувашии:
мухтав мухтав... |
42,449 | Подхалим — он же лизоблюд, он же блюдолиз, он же льстец и т. д. Собственно, значение слова ни у кого вопросов не вызывает. А вот о его происхождении хотелось бы узнать.
Например, тут явно видна приставка **под-**, но кто такой, извиняюсь, "халим"?
В общем, было бы очень интересно узнать происхождение корня слова ... | 2014/11/19 | [
"https://rus.stackexchange.com/questions/42449",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/3/"
] | Слово "халим" у арабов, татар и крымских татар является именем. Переводится как мягкий, добрый, в чём то женственный, мягкотелый, подкаблучник (человек, не имеющий своей воли и не принимающий решения самостоятельно). Приставка "под" и "халим". | Анализ слова "подхалим"
Подхалим > pod-xalim > pod-xvalnj - подхвальный (слав.)(пропуск v) от сущ. хвала; подхваливать, т.е. льстить.
Есть аналог в чувашском языке "мухтав"
мухтав – слава, хвала (чув.) > muxtab > batxum > pod-xalim - подхалим (слав.)(пропуск l)
есть интересный баннер на дороге Чувашии:
мухтав мухтав... |
13,713,066 | I am updating an existing Android app to use the new Google Maps Android API v2. I have about 2500 markers that I want to add to the map. With the older version of the API I found the responsiveness of the maps to be horrendous when there are 2500 markers, so I had to work around it by only adding markers that are in t... | 2012/12/04 | [
"https://Stackoverflow.com/questions/13713066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103584/"
] | Alright, after trying a couple more things I figured out how to determine if a given point is in the visible region, and it's pretty simple:
```
//Note: this.mMap is an instance of GoogleMap
LatLngBounds bounds = this.mMap.getProjection().getVisibleRegion().latLngBounds;
LatLng markerPoint = new LatLng(item.getLatit... | For a clustering solution on Android you may want to try Android Maps Extensions:
<https://github.com/mg6maciej/android-maps-extensions> |
31,976,527 | When launching an Aurora instance I have the option of "Multi-AZ Deployment", which it describes as "Specifies if the DB Instance should have a standby deployed in another Availability Zone."
However the Aurora documentation states that Aurora already automatically spreads the database across different availability zo... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31976527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/964634/"
] | Aurora replicates your *data* across three availability zones, at the storage layer... but the database server instance, itself, is still a virtual machine running on a single physical machine that is located in a single availability zone.
The Aurora storage layer is outside that instance, and is able to let access c... | Storage in Aurora is replicated across three availability zones. The database head node is a single instance. So, while your data is spread across multiple targets, the head node is not.
When you enable a multi-AZ deployment, we create an Aurora read replica that is available as a failover target. Any Aurora read rep... |
31,976,527 | When launching an Aurora instance I have the option of "Multi-AZ Deployment", which it describes as "Specifies if the DB Instance should have a standby deployed in another Availability Zone."
However the Aurora documentation states that Aurora already automatically spreads the database across different availability zo... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31976527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/964634/"
] | Aurora replicates your *data* across three availability zones, at the storage layer... but the database server instance, itself, is still a virtual machine running on a single physical machine that is located in a single availability zone.
The Aurora storage layer is outside that instance, and is able to let access c... | AWS Management console.
The answer to this is straightforward.
You can create Multi-AZ in the management console or ignore it. Irrespective, the **shared storage** for Amazon Aurora is across three AZ (Multi-AZs) as it's the feature of Amazon Aurora however if we choose the Mult-AZ option then we will also have your... |
31,976,527 | When launching an Aurora instance I have the option of "Multi-AZ Deployment", which it describes as "Specifies if the DB Instance should have a standby deployed in another Availability Zone."
However the Aurora documentation states that Aurora already automatically spreads the database across different availability zo... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31976527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/964634/"
] | Storage in Aurora is replicated across three availability zones. The database head node is a single instance. So, while your data is spread across multiple targets, the head node is not.
When you enable a multi-AZ deployment, we create an Aurora read replica that is available as a failover target. Any Aurora read rep... | AWS Management console.
The answer to this is straightforward.
You can create Multi-AZ in the management console or ignore it. Irrespective, the **shared storage** for Amazon Aurora is across three AZ (Multi-AZs) as it's the feature of Amazon Aurora however if we choose the Mult-AZ option then we will also have your... |
54,515,302 | I need to name columns and rows of a matrix with those the columns names embeded in the matrix:
Example:
```
M = ['A:1' 'B:0' 'C:0', 'A:0' 'B:1' 'C:0', 'A:0' 'B:0' 'C:1']
```
to:
```
M = ['1' 'A' 'B' 'C','2' '1' '0' '0','3' '0' '1' '0', '4' '0' '0' '1']
```
Much like Excel format where the columns are labeled b... | 2019/02/04 | [
"https://Stackoverflow.com/questions/54515302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11012137/"
] | The [pandas](https://pandas.pydata.org/) library extends numpy arrays to give you a data representation (a [`DataFrame`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html#pandas.DataFrame)) that is closer to Excel.
```
import pandas as pd
df = pd.DataFrame({'A': [1, 0, 0],
... | Use Pandas DataFrame-
```
df = pd.DataFrame(index=row_names_list, columns=cols_names_list)
```
E.g.
```
df = pd.DataFrame(index=['a', 'b', 'c'], columns=['aa', 'bb', 'cc', 'dd'])
```
Output:
```
aa bb cc dd
a NaN NaN NaN NaN
b NaN NaN NaN NaN
c NaN NaN NaN NaN
``` |
1,621,815 | >
> $$\int \frac{8}{x^{-1}+2}\,dx$$
>
>
>
[Source.](https://i.stack.imgur.com/LMrQz.png)
The answer is
$$4x-2\ln|2x+1|+C.$$
[Source.](https://i.stack.imgur.com/Tm7Ur.png)
But how do you reach that answer without integration by parts? | 2016/01/22 | [
"https://math.stackexchange.com/questions/1621815",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/208101/"
] | We multiply the numerator and denominator by $x$, and then we have the following:
$$\int \frac{8}{x^{-1}+2}dx=\int \frac{8x}{1+2x}dx=\int \frac{-4+4+8x}{1+2x}dx \\ =\int \frac{-4}{1+2x}dx+\int \frac{4+8x}{1+2x}dx \\ =-2\ln |1+2x|+4\int \frac{1+2x}{1+2x}dx \\ =-2\ln |1+2x|+4\int dx \\ =-2\ln |1+2x|+4x+C$$ | $$\frac{8}{x^{-1}+2}=\frac{8x}{1+2x}\stackrel{long \: division}{=}4-\frac{4}{1+2x}$$
$$\Downarrow$$
$$\int \frac{8}{x^{-1}+2}dx=\int \bigg(4-\frac{4}{1+2x}\bigg)dx=4x-2\ln|2x+1|+C$$
where we used
$$\bbox[5px,border:2px solid #F0A]{\begin{equation}
\int \frac{1}{ax+b}dx = \frac{1}{a} \ln |ax + b|
\end{equation}}$$ |
8,880,774 | I am developing a gis application using Google maps API. Currently I am using Postgis db.
I am considering switching to mongodb and I have following questions about this,
1. Is mongodb a viable choice for storing GIS data. ( Is any other NoSQL engine viable?)
2. Does django-nonrel has modified django.contrib.gis modu... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8880774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1151929/"
] | As stated by Sergio Tulentsev, MongoDB has spatial indexes. But, not all geometry types can be stored. As far as I know, currently only points can be stored. You can, however, query using a polygon.
Since MongoDB is very flexible, you could store geometry as a text, but also as a JSON object. For example, you could st... | I've been working with MongoDb storing points of interest in the DB, then doing point in poly queries, along with radius queries and Mongo has been FAR superior to PostGres. I've had much faster response times with hundreds of thousands of items.
I would say however depending on the complexity of your queries (ie if ... |
8,880,774 | I am developing a gis application using Google maps API. Currently I am using Postgis db.
I am considering switching to mongodb and I have following questions about this,
1. Is mongodb a viable choice for storing GIS data. ( Is any other NoSQL engine viable?)
2. Does django-nonrel has modified django.contrib.gis modu... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8880774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1151929/"
] | Django MongoDB Engine developer here.
We haven't got any sort of real support for MongoDB's GIS features. It's possible to do geospatial queries by "working around Django" though (see <http://django-mongodb.org/topics/lowerlevel.html> - the first example is actually about Geo indexes).
It should be possible, however,... | I've been working with MongoDb storing points of interest in the DB, then doing point in poly queries, along with radius queries and Mongo has been FAR superior to PostGres. I've had much faster response times with hundreds of thousands of items.
I would say however depending on the complexity of your queries (ie if ... |
12,172,170 | I want to show a placeholder text in `TextBox` when user hasn't typed anything and `TextBox` is idle.
In Andriod it can be done using `android:hint="some Text"`
In iPhone it can be done as `textFild.placeholder = "some text";`
How can I do it in windows 8 metro apps?
Thanks | 2012/08/29 | [
"https://Stackoverflow.com/questions/12172170",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468724/"
] | Edit for [windows-8.1](/questions/tagged/windows-8.1 "show questions tagged 'windows-8.1'") they have introduced a new property
```
<TextBox x:Name="UserName" PlaceholderText="User Name"/>
```
Please see [Sergey Aldoukhov's answer](https://stackoverflow.com/a/21927164/468724)
---
For me this is the working soluti... | In case you are using WPF, you are looking for a watermark, check out the following stackoverflow [answer](https://stackoverflow.com/questions/833943/watermark-textbox-in-wpf) |
12,172,170 | I want to show a placeholder text in `TextBox` when user hasn't typed anything and `TextBox` is idle.
In Andriod it can be done using `android:hint="some Text"`
In iPhone it can be done as `textFild.placeholder = "some text";`
How can I do it in windows 8 metro apps?
Thanks | 2012/08/29 | [
"https://Stackoverflow.com/questions/12172170",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468724/"
] | The WinRT Xaml Toolkit has a WatermarkTextbox Control:
<http://winrtxamltoolkit.codeplex.com/>
You can get it via NuGet as well, it comes with several other usefull Controls.
you can use it by referncing the toolkit in your Page´s property´s:
```
xmlns:xtk="using:WinRTXamlToolkit.Controls"
```
And the just acce... | In case you are using WPF, you are looking for a watermark, check out the following stackoverflow [answer](https://stackoverflow.com/questions/833943/watermark-textbox-in-wpf) |
12,172,170 | I want to show a placeholder text in `TextBox` when user hasn't typed anything and `TextBox` is idle.
In Andriod it can be done using `android:hint="some Text"`
In iPhone it can be done as `textFild.placeholder = "some text";`
How can I do it in windows 8 metro apps?
Thanks | 2012/08/29 | [
"https://Stackoverflow.com/questions/12172170",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468724/"
] | In Windows 8.1, TextBox has a PlaceholderText property:
```
<TextBox
x:Name="UserName"
PlaceholderText="User Name"
/>
``` | In case you are using WPF, you are looking for a watermark, check out the following stackoverflow [answer](https://stackoverflow.com/questions/833943/watermark-textbox-in-wpf) |
12,172,170 | I want to show a placeholder text in `TextBox` when user hasn't typed anything and `TextBox` is idle.
In Andriod it can be done using `android:hint="some Text"`
In iPhone it can be done as `textFild.placeholder = "some text";`
How can I do it in windows 8 metro apps?
Thanks | 2012/08/29 | [
"https://Stackoverflow.com/questions/12172170",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468724/"
] | Edit for [windows-8.1](/questions/tagged/windows-8.1 "show questions tagged 'windows-8.1'") they have introduced a new property
```
<TextBox x:Name="UserName" PlaceholderText="User Name"/>
```
Please see [Sergey Aldoukhov's answer](https://stackoverflow.com/a/21927164/468724)
---
For me this is the working soluti... | What you can do is you can set a default text and clear it using tapped event of textbox or you can use the watermark text box see [here](http://our.componentone.com/2012/08/15/windows-8-xaml-controls-are-here/) |
12,172,170 | I want to show a placeholder text in `TextBox` when user hasn't typed anything and `TextBox` is idle.
In Andriod it can be done using `android:hint="some Text"`
In iPhone it can be done as `textFild.placeholder = "some text";`
How can I do it in windows 8 metro apps?
Thanks | 2012/08/29 | [
"https://Stackoverflow.com/questions/12172170",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468724/"
] | The WinRT Xaml Toolkit has a WatermarkTextbox Control:
<http://winrtxamltoolkit.codeplex.com/>
You can get it via NuGet as well, it comes with several other usefull Controls.
you can use it by referncing the toolkit in your Page´s property´s:
```
xmlns:xtk="using:WinRTXamlToolkit.Controls"
```
And the just acce... | What you can do is you can set a default text and clear it using tapped event of textbox or you can use the watermark text box see [here](http://our.componentone.com/2012/08/15/windows-8-xaml-controls-are-here/) |
12,172,170 | I want to show a placeholder text in `TextBox` when user hasn't typed anything and `TextBox` is idle.
In Andriod it can be done using `android:hint="some Text"`
In iPhone it can be done as `textFild.placeholder = "some text";`
How can I do it in windows 8 metro apps?
Thanks | 2012/08/29 | [
"https://Stackoverflow.com/questions/12172170",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468724/"
] | In Windows 8.1, TextBox has a PlaceholderText property:
```
<TextBox
x:Name="UserName"
PlaceholderText="User Name"
/>
``` | What you can do is you can set a default text and clear it using tapped event of textbox or you can use the watermark text box see [here](http://our.componentone.com/2012/08/15/windows-8-xaml-controls-are-here/) |
12,172,170 | I want to show a placeholder text in `TextBox` when user hasn't typed anything and `TextBox` is idle.
In Andriod it can be done using `android:hint="some Text"`
In iPhone it can be done as `textFild.placeholder = "some text";`
How can I do it in windows 8 metro apps?
Thanks | 2012/08/29 | [
"https://Stackoverflow.com/questions/12172170",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468724/"
] | Edit for [windows-8.1](/questions/tagged/windows-8.1 "show questions tagged 'windows-8.1'") they have introduced a new property
```
<TextBox x:Name="UserName" PlaceholderText="User Name"/>
```
Please see [Sergey Aldoukhov's answer](https://stackoverflow.com/a/21927164/468724)
---
For me this is the working soluti... | The WinRT Xaml Toolkit has a WatermarkTextbox Control:
<http://winrtxamltoolkit.codeplex.com/>
You can get it via NuGet as well, it comes with several other usefull Controls.
you can use it by referncing the toolkit in your Page´s property´s:
```
xmlns:xtk="using:WinRTXamlToolkit.Controls"
```
And the just acce... |
12,172,170 | I want to show a placeholder text in `TextBox` when user hasn't typed anything and `TextBox` is idle.
In Andriod it can be done using `android:hint="some Text"`
In iPhone it can be done as `textFild.placeholder = "some text";`
How can I do it in windows 8 metro apps?
Thanks | 2012/08/29 | [
"https://Stackoverflow.com/questions/12172170",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468724/"
] | Edit for [windows-8.1](/questions/tagged/windows-8.1 "show questions tagged 'windows-8.1'") they have introduced a new property
```
<TextBox x:Name="UserName" PlaceholderText="User Name"/>
```
Please see [Sergey Aldoukhov's answer](https://stackoverflow.com/a/21927164/468724)
---
For me this is the working soluti... | In Windows 8.1, TextBox has a PlaceholderText property:
```
<TextBox
x:Name="UserName"
PlaceholderText="User Name"
/>
``` |
29,072,603 | I am trying to implement Indoor Navigatiion using Estimote iBeacons Technology. Any help in how to proceed. Looks like there is no direct way in the Indoor Location SDK. | 2015/03/16 | [
"https://Stackoverflow.com/questions/29072603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1540002/"
] | `-` is a magic character in Lua patterns. You need to escape it.
Change
```
value_1 = "DEFAULT-VLAN"
```
to:
```
value_1 = "DEFAULT%-VLAN"
``` | This is because `string.gsub` takes a pattern similar to Regex—it does not do a "literal" replacement; this means you need to prefix any characters that have a special meaning with `%` to escape them.
A list of special characters that need escaping for the pattern are: `(`, `)`, `.`, `+`, `-`, `*`, `?`, `[`, `]`, `^`,... |
50,297,452 | ```
#include <stdio.h>
struct bilhete{
int horarioEntrada;
int horarioSaida;
int preco;
int minEntrada;
int minSaida;
int horaSaida;
int horaEntrada;
};
void extrairHoraMin(struct bilhete *a){ ///////////HERE
a.minEntrada = a.horarioEntrada%100;
a.horaEntrada = a.horarioEntrada/1... | 2018/05/11 | [
"https://Stackoverflow.com/questions/50297452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9707326/"
] | Using `width:calc(100% - 40px);` for button element - does it give expected effect?
Example:
```css
body {
-moz-osx-font-smoothing: grayscale;
font-family:Verdana;
font-weight:normal;
font-size:12px;
}
#BorderContainer2085 {
position:absolute;
top:30px;
left:37px;
width:240px;
height:160px;
di... | ```css
body {
-moz-osx-font-smoothing: grayscale;
font-family: Verdana;
font-size: 12px;
font-weight: normal;
}
#BorderContainer2085 {
border-color: #696969;
border-radius: 0px;
border-style: solid;
border-width: 1px;
display: inline-block;
height: 160px;
left: 37px;
/* Add this ... |
106,337 | Was doing a little interview prep. Given an undirected graph G, such that each node is colored red or blue and |E|≥|V|, find a path in O(|E|) time such that starting and ending at 2 blue nodes, s and t, that you pass through as few red nodes as possible.
Initial Impressions: Since |E|≥|V|, O(|E|) time would include O(... | 2019/04/01 | [
"https://cs.stackexchange.com/questions/106337",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/100921/"
] | To solve this, you need to use $BFS$. But first, manipulate $G$ so that the path will always favor blue vertices.
The solution has 2 parts:
1. Use $DFS$ on blue vertices only, to find all all-blue connected components. Let's denote each such component by $v'$. Now, each blue $v \in v'$ will be "compressed" to a singl... | Convert $G$ to a directed graph $G'$ where we have two edges $(u,v)$ and $(v,u)$ in $G'$ for every edge $\{u,v\}$ in $G$. Let the length of $(u,v)$ be 1 if $v$ is a red node and 0 otherwise. Now run Dijkstra's algorithm on $G'$ from the starting node $s$ to the ending node $t$.
It is clear that the shortest path thus ... |
61,682,548 | I am using puppeteer. I have a situation where I need to get content between two tags which are not in a parent-child relationship.
```html
<h1>neverchangeA<h1>
<span>abc<span>
<span>abc2<span>
<h1>neverchangeB<h1>
```
Expected elements
```
<span>abc<span>
<span>abc2<span>
```
In simple, I need something like a r... | 2020/05/08 | [
"https://Stackoverflow.com/questions/61682548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11317290/"
] | [Getting the sibling of an elementHandle in Puppeteer](https://stackoverflow.com/questions/48861261/getting-the-sibling-of-an-elementhandle-in-puppeteer) explains how to get the previous sibling of an element with puppeteer. There is a similar function to get the next sibling of an element. You can apply this to your s... | You should use **regex**. This: `<h1>.*<h1>` will select the h1 tag and whatever there is between the tag. One way is to remove the result of this from the text, and you will have the result you need. |
61,682,548 | I am using puppeteer. I have a situation where I need to get content between two tags which are not in a parent-child relationship.
```html
<h1>neverchangeA<h1>
<span>abc<span>
<span>abc2<span>
<h1>neverchangeB<h1>
```
Expected elements
```
<span>abc<span>
<span>abc2<span>
```
In simple, I need something like a r... | 2020/05/08 | [
"https://Stackoverflow.com/questions/61682548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11317290/"
] | You could do this with JS and the evaluate method.
<https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#pageevaluatepagefunction-args>
This example returns the HTML of the desired elements as a string.
```
const result = await page.evaluate(() => {
const h1s = [...document.querySelectorAll('h1')]
con... | You should use **regex**. This: `<h1>.*<h1>` will select the h1 tag and whatever there is between the tag. One way is to remove the result of this from the text, and you will have the result you need. |
61,682,548 | I am using puppeteer. I have a situation where I need to get content between two tags which are not in a parent-child relationship.
```html
<h1>neverchangeA<h1>
<span>abc<span>
<span>abc2<span>
<h1>neverchangeB<h1>
```
Expected elements
```
<span>abc<span>
<span>abc2<span>
```
In simple, I need something like a r... | 2020/05/08 | [
"https://Stackoverflow.com/questions/61682548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11317290/"
] | ### Solution using XPath
This is a good use case for [XPath](https://developer.mozilla.org/en-US/docs/Web/XPath/Introduction_to_using_XPath_in_JavaScript). The following query looks for `span` elements that have an `h1` tag with content `neverchangeA` before them and an `h1` tag with the content `neverchangeB` after t... | You should use **regex**. This: `<h1>.*<h1>` will select the h1 tag and whatever there is between the tag. One way is to remove the result of this from the text, and you will have the result you need. |
61,682,548 | I am using puppeteer. I have a situation where I need to get content between two tags which are not in a parent-child relationship.
```html
<h1>neverchangeA<h1>
<span>abc<span>
<span>abc2<span>
<h1>neverchangeB<h1>
```
Expected elements
```
<span>abc<span>
<span>abc2<span>
```
In simple, I need something like a r... | 2020/05/08 | [
"https://Stackoverflow.com/questions/61682548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11317290/"
] | You could do this with JS and the evaluate method.
<https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#pageevaluatepagefunction-args>
This example returns the HTML of the desired elements as a string.
```
const result = await page.evaluate(() => {
const h1s = [...document.querySelectorAll('h1')]
con... | [Getting the sibling of an elementHandle in Puppeteer](https://stackoverflow.com/questions/48861261/getting-the-sibling-of-an-elementhandle-in-puppeteer) explains how to get the previous sibling of an element with puppeteer. There is a similar function to get the next sibling of an element. You can apply this to your s... |
61,682,548 | I am using puppeteer. I have a situation where I need to get content between two tags which are not in a parent-child relationship.
```html
<h1>neverchangeA<h1>
<span>abc<span>
<span>abc2<span>
<h1>neverchangeB<h1>
```
Expected elements
```
<span>abc<span>
<span>abc2<span>
```
In simple, I need something like a r... | 2020/05/08 | [
"https://Stackoverflow.com/questions/61682548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11317290/"
] | [Getting the sibling of an elementHandle in Puppeteer](https://stackoverflow.com/questions/48861261/getting-the-sibling-of-an-elementhandle-in-puppeteer) explains how to get the previous sibling of an element with puppeteer. There is a similar function to get the next sibling of an element. You can apply this to your s... | ### Solution using XPath
This is a good use case for [XPath](https://developer.mozilla.org/en-US/docs/Web/XPath/Introduction_to_using_XPath_in_JavaScript). The following query looks for `span` elements that have an `h1` tag with content `neverchangeA` before them and an `h1` tag with the content `neverchangeB` after t... |
61,682,548 | I am using puppeteer. I have a situation where I need to get content between two tags which are not in a parent-child relationship.
```html
<h1>neverchangeA<h1>
<span>abc<span>
<span>abc2<span>
<h1>neverchangeB<h1>
```
Expected elements
```
<span>abc<span>
<span>abc2<span>
```
In simple, I need something like a r... | 2020/05/08 | [
"https://Stackoverflow.com/questions/61682548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11317290/"
] | You could do this with JS and the evaluate method.
<https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#pageevaluatepagefunction-args>
This example returns the HTML of the desired elements as a string.
```
const result = await page.evaluate(() => {
const h1s = [...document.querySelectorAll('h1')]
con... | ### Solution using XPath
This is a good use case for [XPath](https://developer.mozilla.org/en-US/docs/Web/XPath/Introduction_to_using_XPath_in_JavaScript). The following query looks for `span` elements that have an `h1` tag with content `neverchangeA` before them and an `h1` tag with the content `neverchangeB` after t... |
22,292 | As a hobbyist composer who composes in "almost" traditional music styles (baroque-like, classical-like etc.), I am at a stage where I would like to compose *authentic* music in a specific style.
I have studied harmony and voice leading from both Aldwell & Schachter's and Walter Piston's books, and counterpoint from Fu... | 2014/07/22 | [
"https://music.stackexchange.com/questions/22292",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/12707/"
] | Have I got a treat for you. Learn this stuff the way the actual composers did @
<http://faculty-web.at.northwestern.edu/music/gjerdingen/partimenti/index.htm>
The other references given in this thread, while excellent, are counterpoint manuals, and unless you really want to write fugues and inventions, go for this "h... | Try using "Tonal counterpoint in the style of 18th Century - Ernst Krenek (1953)" along with your surgical explorations of the Italian masters and write variations on their themes |
126,676 | My company is developing an ERP software for small businesses and we're encountering a recurrent problem.
In the "Invoices" part of the app, there's a "View/Print" button that exports the invoice to a PDF file. The problem is that more often than we'd like, users will change a setting in the invoice, or add a product... | 2019/07/05 | [
"https://ux.stackexchange.com/questions/126676",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/128389/"
] | What if you compare it to a download button on any website that downloads the pdf. You cant access the file server but have to click the download button in order to get your file and will always download the latest version.
In your situation, the only way to acces the pdf directory could be though the 'view/print' but... | In my opinion, the solution is simple, and I think it can be implemented. You need to write a code detecting any small change on the Invoice after the last time you exported the PDF and the moment the change happens try to show a gentle message on top of the screen in red, warning or notifying the user that there are c... |
126,676 | My company is developing an ERP software for small businesses and we're encountering a recurrent problem.
In the "Invoices" part of the app, there's a "View/Print" button that exports the invoice to a PDF file. The problem is that more often than we'd like, users will change a setting in the invoice, or add a product... | 2019/07/05 | [
"https://ux.stackexchange.com/questions/126676",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/128389/"
] | Since your UI does not work, and your users does not understand the generation - you need to automate the process. If there is an existing invoice, the pdf-file needs to be deleted from the folder as soon as something is changed on the order, then recreated as soon as the users prints it again.
Usually you don't send ... | If there is a separate UI/app to get to the folder of pdfs, you could tell the user on navigation that (there are unexported/unsaved changes and pdf is outdated)That way they can go back and do it.
If that is somehow not possible(like ftp folder or file system) you could give a visible message on the UI screen where u... |
126,676 | My company is developing an ERP software for small businesses and we're encountering a recurrent problem.
In the "Invoices" part of the app, there's a "View/Print" button that exports the invoice to a PDF file. The problem is that more often than we'd like, users will change a setting in the invoice, or add a product... | 2019/07/05 | [
"https://ux.stackexchange.com/questions/126676",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/128389/"
] | Since your UI does not work, and your users does not understand the generation - you need to automate the process. If there is an existing invoice, the pdf-file needs to be deleted from the folder as soon as something is changed on the order, then recreated as soon as the users prints it again.
Usually you don't send ... | A simple way that might work depending on your situation, is to automatically delete PDFs when they go out of date.
So instead of generating a PDF when they make a change, delete the PDF that matches that invoice number.
This will prevent them from being able to get out-of-date PDFs, and will probably also teach them... |
126,676 | My company is developing an ERP software for small businesses and we're encountering a recurrent problem.
In the "Invoices" part of the app, there's a "View/Print" button that exports the invoice to a PDF file. The problem is that more often than we'd like, users will change a setting in the invoice, or add a product... | 2019/07/05 | [
"https://ux.stackexchange.com/questions/126676",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/128389/"
] | I guess you want a quicker solution than building a new invoicing system. The real pain point seems to be this:
>
> We can't prevent the user from accessing the PDF files folder because they may want to copy the PDF file to a USB key, …
>
>
>
The solution is to prevent them from access that folder and only allow ... | If there is a separate UI/app to get to the folder of pdfs, you could tell the user on navigation that (there are unexported/unsaved changes and pdf is outdated)That way they can go back and do it.
If that is somehow not possible(like ftp folder or file system) you could give a visible message on the UI screen where u... |
126,676 | My company is developing an ERP software for small businesses and we're encountering a recurrent problem.
In the "Invoices" part of the app, there's a "View/Print" button that exports the invoice to a PDF file. The problem is that more often than we'd like, users will change a setting in the invoice, or add a product... | 2019/07/05 | [
"https://ux.stackexchange.com/questions/126676",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/128389/"
] | Since your UI does not work, and your users does not understand the generation - you need to automate the process. If there is an existing invoice, the pdf-file needs to be deleted from the folder as soon as something is changed on the order, then recreated as soon as the users prints it again.
Usually you don't send ... | I guess you want a quicker solution than building a new invoicing system. The real pain point seems to be this:
>
> We can't prevent the user from accessing the PDF files folder because they may want to copy the PDF file to a USB key, …
>
>
>
The solution is to prevent them from access that folder and only allow ... |
126,676 | My company is developing an ERP software for small businesses and we're encountering a recurrent problem.
In the "Invoices" part of the app, there's a "View/Print" button that exports the invoice to a PDF file. The problem is that more often than we'd like, users will change a setting in the invoice, or add a product... | 2019/07/05 | [
"https://ux.stackexchange.com/questions/126676",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/128389/"
] | In my opinion, the solution is simple, and I think it can be implemented. You need to write a code detecting any small change on the Invoice after the last time you exported the PDF and the moment the change happens try to show a gentle message on top of the screen in red, warning or notifying the user that there are c... | A repository of invalid / outdated invoices
===========================================
In complement to [Benny Skogberg](https://ux.stackexchange.com/a/126678/80663) answer, save a link with a hash on every PDF generated and the same hash on your central server. When you detect a change that invalidates a previous ge... |
126,676 | My company is developing an ERP software for small businesses and we're encountering a recurrent problem.
In the "Invoices" part of the app, there's a "View/Print" button that exports the invoice to a PDF file. The problem is that more often than we'd like, users will change a setting in the invoice, or add a product... | 2019/07/05 | [
"https://ux.stackexchange.com/questions/126676",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/128389/"
] | It sounds like you've got a decision to make: Are you maintaining a folder of PDFs for the users to directly access, or are you not?
If you are not, and this is an example of users discovering an unintended shortcut around your planned workflow, then I'd suggest making it impossible for users to do this. Use a differe... | If there is a separate UI/app to get to the folder of pdfs, you could tell the user on navigation that (there are unexported/unsaved changes and pdf is outdated)That way they can go back and do it.
If that is somehow not possible(like ftp folder or file system) you could give a visible message on the UI screen where u... |
126,676 | My company is developing an ERP software for small businesses and we're encountering a recurrent problem.
In the "Invoices" part of the app, there's a "View/Print" button that exports the invoice to a PDF file. The problem is that more often than we'd like, users will change a setting in the invoice, or add a product... | 2019/07/05 | [
"https://ux.stackexchange.com/questions/126676",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/128389/"
] | Since your UI does not work, and your users does not understand the generation - you need to automate the process. If there is an existing invoice, the pdf-file needs to be deleted from the folder as soon as something is changed on the order, then recreated as soon as the users prints it again.
Usually you don't send ... | My answer is to suggest working within the current bounds of what you have tried.
I would do this by adding a user/system setting for the account which allows them to either create the PDF each time they make a change, as you stated for them to have to do it manually each time.
It's not great, but it puts control bac... |
126,676 | My company is developing an ERP software for small businesses and we're encountering a recurrent problem.
In the "Invoices" part of the app, there's a "View/Print" button that exports the invoice to a PDF file. The problem is that more often than we'd like, users will change a setting in the invoice, or add a product... | 2019/07/05 | [
"https://ux.stackexchange.com/questions/126676",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/128389/"
] | It sounds like you've got a decision to make: Are you maintaining a folder of PDFs for the users to directly access, or are you not?
If you are not, and this is an example of users discovering an unintended shortcut around your planned workflow, then I'd suggest making it impossible for users to do this. Use a differe... | I guess you want a quicker solution than building a new invoicing system. The real pain point seems to be this:
>
> We can't prevent the user from accessing the PDF files folder because they may want to copy the PDF file to a USB key, …
>
>
>
The solution is to prevent them from access that folder and only allow ... |
126,676 | My company is developing an ERP software for small businesses and we're encountering a recurrent problem.
In the "Invoices" part of the app, there's a "View/Print" button that exports the invoice to a PDF file. The problem is that more often than we'd like, users will change a setting in the invoice, or add a product... | 2019/07/05 | [
"https://ux.stackexchange.com/questions/126676",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/128389/"
] | In my opinion, the solution is simple, and I think it can be implemented. You need to write a code detecting any small change on the Invoice after the last time you exported the PDF and the moment the change happens try to show a gentle message on top of the screen in red, warning or notifying the user that there are c... | If there is a separate UI/app to get to the folder of pdfs, you could tell the user on navigation that (there are unexported/unsaved changes and pdf is outdated)That way they can go back and do it.
If that is somehow not possible(like ftp folder or file system) you could give a visible message on the UI screen where u... |
7,870,183 | Have a flash video player that mimics the functionality of the youtube player regarding video input. I believe this is called "progressive download". I'm using Amazon Cloudfront to server up the video, and it asks me if the distribution is "download" or "streaming". Which one should I choose for this kind of player?
n... | 2011/10/23 | [
"https://Stackoverflow.com/questions/7870183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/697190/"
] | When the distribution is **download** requests will be served via normal HTTP (video players call this progressive download).
CloudFront also runs Adobe Flash Media Server -- these servers are the **streaming** distribution option. You can read more RTMP support in the [developer guide](http://docs.amazonwebservices.c... | This would be streaming as someone would play the video. Download is downloading the .flv file and then playing it on a person's computer rather than in his web browser. |
39,492,385 | I have an arrays with dynamic name. My array could be more than 3, depends and array variable should be unique
```
$loopThrice = 3;
$getSum = 0;
$total = array();
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
for($a=0; $a < $loopThrice; $a++){ // loo... | 2016/09/14 | [
"https://Stackoverflow.com/questions/39492385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6739485/"
] | Well the multi array is the way to go, but you can still do it this way:
```
$loopThrice = 3;
$getSum = 0;
$total = array();
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
// find which arrray has the most values
for($a=0; $a < $loopThrice; $a+... | This should work for you:
```
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
$var_prefix = 'array';
$arr_count = 0;
$max_fields = 0;
while(isset(${$var_prefix.$arr_count})) {
$data[] = ${$var_prefix.$arr_count};
if(count(${$var_prefix.$arr_cou... |
39,492,385 | I have an arrays with dynamic name. My array could be more than 3, depends and array variable should be unique
```
$loopThrice = 3;
$getSum = 0;
$total = array();
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
for($a=0; $a < $loopThrice; $a++){ // loo... | 2016/09/14 | [
"https://Stackoverflow.com/questions/39492385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6739485/"
] | Why aren't you using a multidimensional array?
```
$array = array(); // hungarian notation
$array[] = array(5, 10, 15, 20, 25, 30);
$array[] = array(1, 2, 3, 4, 5, 6);
$array[] = array(2, 6, 8, 10, 12, 14);
```
In this case you will have an array of arrays:
```
Array
(
[0] => Array
(
[0] => 5
[1... | This should work for you:
```
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
$var_prefix = 'array';
$arr_count = 0;
$max_fields = 0;
while(isset(${$var_prefix.$arr_count})) {
$data[] = ${$var_prefix.$arr_count};
if(count(${$var_prefix.$arr_cou... |
39,492,385 | I have an arrays with dynamic name. My array could be more than 3, depends and array variable should be unique
```
$loopThrice = 3;
$getSum = 0;
$total = array();
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
for($a=0; $a < $loopThrice; $a++){ // loo... | 2016/09/14 | [
"https://Stackoverflow.com/questions/39492385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6739485/"
] | This should work for you:
```
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
$var_prefix = 'array';
$arr_count = 0;
$max_fields = 0;
while(isset(${$var_prefix.$arr_count})) {
$data[] = ${$var_prefix.$arr_count};
if(count(${$var_prefix.$arr_cou... | I don't know why you have individual array variables, but the process remains the same as if you declare a single array containing those arrays as rows in a multi-dimensional array.
Once you have a multi-dimensional array, the spread operator (`...`) will feed columns of data into `array_map()`'s custom function body ... |
39,492,385 | I have an arrays with dynamic name. My array could be more than 3, depends and array variable should be unique
```
$loopThrice = 3;
$getSum = 0;
$total = array();
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
for($a=0; $a < $loopThrice; $a++){ // loo... | 2016/09/14 | [
"https://Stackoverflow.com/questions/39492385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6739485/"
] | Why aren't you using a multidimensional array?
```
$array = array(); // hungarian notation
$array[] = array(5, 10, 15, 20, 25, 30);
$array[] = array(1, 2, 3, 4, 5, 6);
$array[] = array(2, 6, 8, 10, 12, 14);
```
In this case you will have an array of arrays:
```
Array
(
[0] => Array
(
[0] => 5
[1... | Well the multi array is the way to go, but you can still do it this way:
```
$loopThrice = 3;
$getSum = 0;
$total = array();
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
// find which arrray has the most values
for($a=0; $a < $loopThrice; $a+... |
39,492,385 | I have an arrays with dynamic name. My array could be more than 3, depends and array variable should be unique
```
$loopThrice = 3;
$getSum = 0;
$total = array();
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
for($a=0; $a < $loopThrice; $a++){ // loo... | 2016/09/14 | [
"https://Stackoverflow.com/questions/39492385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6739485/"
] | Well the multi array is the way to go, but you can still do it this way:
```
$loopThrice = 3;
$getSum = 0;
$total = array();
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
// find which arrray has the most values
for($a=0; $a < $loopThrice; $a+... | I don't know why you have individual array variables, but the process remains the same as if you declare a single array containing those arrays as rows in a multi-dimensional array.
Once you have a multi-dimensional array, the spread operator (`...`) will feed columns of data into `array_map()`'s custom function body ... |
39,492,385 | I have an arrays with dynamic name. My array could be more than 3, depends and array variable should be unique
```
$loopThrice = 3;
$getSum = 0;
$total = array();
$array0 = array(5, 10, 15, 20, 25, 30);
$array1 = array(1, 2, 3, 4, 5, 6);
$array2 = array(2, 6, 8, 10, 12, 14);
for($a=0; $a < $loopThrice; $a++){ // loo... | 2016/09/14 | [
"https://Stackoverflow.com/questions/39492385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6739485/"
] | Why aren't you using a multidimensional array?
```
$array = array(); // hungarian notation
$array[] = array(5, 10, 15, 20, 25, 30);
$array[] = array(1, 2, 3, 4, 5, 6);
$array[] = array(2, 6, 8, 10, 12, 14);
```
In this case you will have an array of arrays:
```
Array
(
[0] => Array
(
[0] => 5
[1... | I don't know why you have individual array variables, but the process remains the same as if you declare a single array containing those arrays as rows in a multi-dimensional array.
Once you have a multi-dimensional array, the spread operator (`...`) will feed columns of data into `array_map()`'s custom function body ... |
16,900,860 | I am using the following to get the current date:-
```
var dateObj = new Date();
var month = dateObj.getUTCMonth() + 1;
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
var newdate = day + "/" + month + "/" + year;
```
If I `alert(newdate);` it shows:-
>
> 3/06/2013
>
>
>
Is there any way I... | 2013/06/03 | [
"https://Stackoverflow.com/questions/16900860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1128694/"
] | If you want to avoid using a library, and don't mind an extra line in your JavaScript:
```
var day = dateObj.getUTCDate(),
dd = parseInt(day, 10) < 10 ? '0' + day : day;
``` | With plain Javascript, only manually
```
if (day < 10) day = "0" + day;
if (month < 10) month = "0" + month;
``` |
16,900,860 | I am using the following to get the current date:-
```
var dateObj = new Date();
var month = dateObj.getUTCMonth() + 1;
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
var newdate = day + "/" + month + "/" + year;
```
If I `alert(newdate);` it shows:-
>
> 3/06/2013
>
>
>
Is there any way I... | 2013/06/03 | [
"https://Stackoverflow.com/questions/16900860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1128694/"
] | With plain Javascript, only manually
```
if (day < 10) day = "0" + day;
if (month < 10) month = "0" + month;
``` | Please use the following:
```
var dateObj = new Date();
var month = ('0' + (dateObj.getUTCMonth() + 1) ).slice( -2 );;
var day = ('0' + (dateObj.getUTCDate() + 1) ).slice( -2 );
var year = dateObj.getUTCFullYear();
var newdate = day + "/" + month + "/" + year;
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.