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 |
|---|---|---|---|---|---|
101,216 | I have a dependent variable that is continuous
and
I have two independent variables: one continuous and one categorical (with 2 categories)
The interaction between the independent variables is significant.
Which statistical analysis should I use (in R) to proceed with the analysis and document the interaction?
(Sho... | 2014/06/05 | [
"https://stats.stackexchange.com/questions/101216",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/46744/"
] | In the scenario you describe least squares regression will allow you to tell a very straightforward story:
First of all, imagine that you have no dichotomous independent variable. So:
(1) $y\_{i} = \beta\_{0} + \beta\_{1}x\_{1i} + \varepsilon\_{i}$
Your regression describes the relationship between your dependent va... | @Alexis seems to cover the equations pretty well. Here's some example code in [r](/questions/tagged/r "show questions tagged 'r'"):
```
set.seed(8);d8a=data.frame(x=rnorm(99),z=rbinom(99,1,.5)) #Data sim'd to fit the scenario
d8a$y=(d8a$x+rnorm(99,0,3))*(2*d8a$z-1) #Guarantees an interaction
su... |
71,495,344 | I have a array in python as:
```
newarray=['Title',
'Salary USD',
'Equity %',
'Equity USD',
'Work location',
'Years of Experience',
'Years at Startup',
'Stage',
'Size',
'Staff electrical engineer',
'$226,000',
'0.002%',
'$650,000',
'San Francisco',
'8.0',
'3.0',
'Series H',
'1001-5000 employees',
'Sa... | 2022/03/16 | [
"https://Stackoverflow.com/questions/71495344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13958510/"
] | IIUC, you want a single 2D array? Then [`reshape`](https://numpy.org/doc/stable/reference/generated/numpy.reshape.html):
```
out = arr.reshape((-1,9))
```
*NB. be careful, `reshape` requires that you have a multiple of the dimensions, here you need n\*9 items in the initial array.*
output:
```
array([['Title', 'Sa... | ```
res = [newarray[x:x+9] for x in range(0, len(newarray), 9)]
``` |
71,495,344 | I have a array in python as:
```
newarray=['Title',
'Salary USD',
'Equity %',
'Equity USD',
'Work location',
'Years of Experience',
'Years at Startup',
'Stage',
'Size',
'Staff electrical engineer',
'$226,000',
'0.002%',
'$650,000',
'San Francisco',
'8.0',
'3.0',
'Series H',
'1001-5000 employees',
'Sa... | 2022/03/16 | [
"https://Stackoverflow.com/questions/71495344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13958510/"
] | IIUC, you want a single 2D array? Then [`reshape`](https://numpy.org/doc/stable/reference/generated/numpy.reshape.html):
```
out = arr.reshape((-1,9))
```
*NB. be careful, `reshape` requires that you have a multiple of the dimensions, here you need n\*9 items in the initial array.*
output:
```
array([['Title', 'Sa... | Here is a way to do it:
```
n = len(newarray)//9
print([newarray[i::n] for i in range(n)])
``` |
31,275,460 | In my current application we use I18n. I have to add a :base error key which should be common for all models.
For ex: I would add `:common_error` in one place in `en.yml` file and use as follows,
```
@user.errors.add(:base, :common_error)
@post.errors.add(:base, :common_error)
..and so on
```
I'm really worried that... | 2015/07/07 | [
"https://Stackoverflow.com/questions/31275460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5076451/"
] | Simply don't use a relative translation key -
```
@user.errors.add(:base, t(:common_error) )
```
If you pass a symbol to errors.add the translation uses the scope of the model. | Instead of adding errors through specific `models`, you can define additional error messages in the same way Rails handles its internal errors by using the `messages` key .
```
en:
errors:
messages:
common_error: 'is common'
```
This will apply to both Active Record and Active Model models. If you only w... |
12,469,645 | Although I have never tried this, it is apparently possible to remotely edit a file in vim as described [here](http://vim.wikia.com/wiki/Editing_remote_files_via_scp_in_vim). In my particular case the server I need access to can only be accessed from on campus, hence I have to log into my university account like so:
`... | 2012/09/18 | [
"https://Stackoverflow.com/questions/12469645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/654789/"
] | OK after a little working around I figured it out. First you have to edit (or create) your `.ssh/config` file as described [here](https://superuser.com/questions/174160/scp-over-a-proxy-with-one-command-from-local-machine). For our purposes, we will add a line like this, which essentially adds a proxy.
```
Host secure... | Once you SSHed in the machine you can run any command(also vim) in remote host on your shell. After logging run vim as you are running in your machine. |
12,469,645 | Although I have never tried this, it is apparently possible to remotely edit a file in vim as described [here](http://vim.wikia.com/wiki/Editing_remote_files_via_scp_in_vim). In my particular case the server I need access to can only be accessed from on campus, hence I have to log into my university account like so:
`... | 2012/09/18 | [
"https://Stackoverflow.com/questions/12469645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/654789/"
] | OK after a little working around I figured it out. First you have to edit (or create) your `.ssh/config` file as described [here](https://superuser.com/questions/174160/scp-over-a-proxy-with-one-command-from-local-machine). For our purposes, we will add a line like this, which essentially adds a proxy.
```
Host secure... | Since you are using ssh, you basically have access to the server via the CLI, as if you were sitting in front of the machine itself. With that said, you can use any program on that machine, just like you would use it on your own machine. Assuming that the `secure.university.com/user/foo.txt` means that there is a text ... |
3,126,681 | >
> For a standard Brownian motion $\{W\_t, t\geq 0\}$, find $\mathbb{P}(\max\_{ t \in [0,1]}|W\_t| <x)$.
>
>
>
Page 79-80 of *Billingsley, P.*, Convergence of probability measures, New York-London-Sydney-Toronto: John Wiley and Sons, Inc. XII, 253 p. (1968). [ZBL0172.21201](https://zbmath.org/?q=an:0172.21201). s... | 2019/02/25 | [
"https://math.stackexchange.com/questions/3126681",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/272910/"
] | The formula should be
$$P(\max\_{t\in [0,1]} |w\_t| < x)=\frac{4}{π} \sum\_{n=0}^\infty \frac{(-1)^n}{2n+1} \exp\left\{-\frac{π^2(2n+1)^2}{8x^2}\right\}$$
Here is a plot of the resulting function:
[](https://i.stack.imgur.com/wa8t3.png) | Feller obtains in his book *An Introduction to Probability Theory. Vol II* (p.342) the following result (... unfortunately he does not give a detailed proof):
>
> Let $(B\_t^x)\_{t \geq 0}$ be a Brownian motion started at $x \in \mathbb{R}^d$ (i.e. $B\_t^x = x+B\_t$ where $(B\_t)\_{t \geq 0}$ is a standard Brownian m... |
6,096,670 | For explaning my issue, I have created this simple project with two tables : item and order1 (with item having orderId as Foreign Key).
Now when I try to delete a row from order table, i get error saying that particular order id is linked with few items in 'item' table.
So, what i do is i iterate over all the item ob... | 2011/05/23 | [
"https://Stackoverflow.com/questions/6096670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/765925/"
] | `SELECT MAX(time_stamp), user_id FROM table GROUP BY user_id;` | The following query should be what you want...
```
select user_id,max(time_stamp) from yourtable group by user_id order by user_id, time_stamp desc
``` |
208,298 | Is there any word or some idiomatic expression that would mean "half believe, half doubt"?
For example,
>
> Having listened to that weird story, children **half believed it, half doubted**.
>
>
>
Meaning that none of the children fully believed the story. | 2019/04/27 | [
"https://ell.stackexchange.com/questions/208298",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/650/"
] | The children were dubious, uncertain, unsure or suspicious about the truthfulness or accuracy of the story.
Of course, one cannot half believe, half doubt something.
If you are not certain whether it is true, you simply doubt it.
<https://www.thesaurus.com/browse/dubious> | I would say:
>
> The children were **skeptical** about the story.
>
>
>
<https://www.macmillandictionary.com/dictionary/american/skeptical> |
208,298 | Is there any word or some idiomatic expression that would mean "half believe, half doubt"?
For example,
>
> Having listened to that weird story, children **half believed it, half doubted**.
>
>
>
Meaning that none of the children fully believed the story. | 2019/04/27 | [
"https://ell.stackexchange.com/questions/208298",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/650/"
] | As far as *idioms* are concerned, it's quite possible to express "half belief, half doubt" about something.
>
> Do you think it will work out?
>
>
> I'm **on the fence** about it.
>
> I"m **of two minds** about it.
>
>
>
From Merriam-Webster:
>
> [*on the fence*](https://www.merriam-webster.com/dictionary... | I would say:
>
> The children were **skeptical** about the story.
>
>
>
<https://www.macmillandictionary.com/dictionary/american/skeptical> |
208,298 | Is there any word or some idiomatic expression that would mean "half believe, half doubt"?
For example,
>
> Having listened to that weird story, children **half believed it, half doubted**.
>
>
>
Meaning that none of the children fully believed the story. | 2019/04/27 | [
"https://ell.stackexchange.com/questions/208298",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/650/"
] | As far as *idioms* are concerned, it's quite possible to express "half belief, half doubt" about something.
>
> Do you think it will work out?
>
>
> I'm **on the fence** about it.
>
> I"m **of two minds** about it.
>
>
>
From Merriam-Webster:
>
> [*on the fence*](https://www.merriam-webster.com/dictionary... | The children were dubious, uncertain, unsure or suspicious about the truthfulness or accuracy of the story.
Of course, one cannot half believe, half doubt something.
If you are not certain whether it is true, you simply doubt it.
<https://www.thesaurus.com/browse/dubious> |
52,267,009 | I'm writing an HTML email which functions perfectly well in the browser. But I've just been sending it by copying what's in the browser window and pasting it into the mail app on my computer and sending it that way. This doesn't do a lot of the things I want it to like resizing with the window and staying centered in t... | 2018/09/11 | [
"https://Stackoverflow.com/questions/52267009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10092774/"
] | Accumulate with a [`defaultdict`](https://docs.python.org/3/library/collections.html#collections.defaultdict):
```
>>> from collections import defaultdict
>>> data = defaultdict(int)
>>> L = [[0.5, 2], [0.5, 5], [2, 3], [2, 6], [2, 0.6], [7, 1]]
>>> for k, v in L:
... data[k] += v
...
>>> [[k,v] for (k,v) in ... | Using Pandas, you can retain the original 'order' of the data:
```
pairs = [[0.5, 2], [0.5, 5], [2, 3], [2, 6], [2, 0.6], [7, 1]]
df = pd.DataFrame(pairs)
>>> [tup[0] for tup in zip(df.groupby(0, sort=False, as_index=False).sum().values.tolist())]
[[0.5, 7.0], [2.0, 9.6], [7.0, 1.0]]
``` |
52,267,009 | I'm writing an HTML email which functions perfectly well in the browser. But I've just been sending it by copying what's in the browser window and pasting it into the mail app on my computer and sending it that way. This doesn't do a lot of the things I want it to like resizing with the window and staying centered in t... | 2018/09/11 | [
"https://Stackoverflow.com/questions/52267009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10092774/"
] | Accumulate with a [`defaultdict`](https://docs.python.org/3/library/collections.html#collections.defaultdict):
```
>>> from collections import defaultdict
>>> data = defaultdict(int)
>>> L = [[0.5, 2], [0.5, 5], [2, 3], [2, 6], [2, 0.6], [7, 1]]
>>> for k, v in L:
... data[k] += v
...
>>> [[k,v] for (k,v) in ... | You can get away with sorting and [`itertools.groupby`](https://docs.python.org/3/library/itertools.html#itertools.groupby):
```
from operator import itemgetter
from itertools import groupby
data = [[0.5, 2], [0.5, 5], [2, 3], [2, 6], [2, 0.6], [7, 1]]
key = itemgetter(0)
data.sort(key=key) # Use data = sorted(data... |
52,267,009 | I'm writing an HTML email which functions perfectly well in the browser. But I've just been sending it by copying what's in the browser window and pasting it into the mail app on my computer and sending it that way. This doesn't do a lot of the things I want it to like resizing with the window and staying centered in t... | 2018/09/11 | [
"https://Stackoverflow.com/questions/52267009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10092774/"
] | Accumulate with a [`defaultdict`](https://docs.python.org/3/library/collections.html#collections.defaultdict):
```
>>> from collections import defaultdict
>>> data = defaultdict(int)
>>> L = [[0.5, 2], [0.5, 5], [2, 3], [2, 6], [2, 0.6], [7, 1]]
>>> for k, v in L:
... data[k] += v
...
>>> [[k,v] for (k,v) in ... | Will this work?
```
L = [[0.5, 2], [0.5, 5], [2, 3], [2, 6], [2, 0.6], [7, 1]]
nums = []
d = {}
for lst in L:
if lst[0] not in d:
d[lst[0]] = []
nums.append(lst[0])
d[lst[0]].append(lst[1])
for key in nums:
print [key, sum(d[key])]
```
Output:
```
[0.5, 7]
[2, 9.6]
[7, 1]
``` |
13,005,304 | I followed steps [in this SO link](https://stackoverflow.com/questions/10860352/getting-started-with-opencv-2-4-and-mingw-on-windows-7/10860353#comment17523493_10860353) to compile a sample program using OpenCV2.4.0 in windows. I made a setup both in DEVC++ and NetBeans with Mingw. My sample Program is getting Compiled... | 2012/10/22 | [
"https://Stackoverflow.com/questions/13005304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1317084/"
] | **Using the libs in "...\opencv\build\x86\mingw\bin" and "...\opencv\build\x86\mingw\lib**
You can not use the libraries that come with OpenCV-2.4.x.exe.
As some developers in forums and I find out. On some systems, the precompiled libs of "opencv 2.4.x" can not be used.
To compile your own programs, works, but **... | I guess this is an error related to memory management. Maybe because your'e releasing the window before the image. But anyhow you should use the OpenCV C++ interface, as this does a lot of stuff automagically. With the C++ Interface your code would look like this:
```
#include <opencv.hpp>
int main( int argc,... |
13,005,304 | I followed steps [in this SO link](https://stackoverflow.com/questions/10860352/getting-started-with-opencv-2-4-and-mingw-on-windows-7/10860353#comment17523493_10860353) to compile a sample program using OpenCV2.4.0 in windows. I made a setup both in DEVC++ and NetBeans with Mingw. My sample Program is getting Compiled... | 2012/10/22 | [
"https://Stackoverflow.com/questions/13005304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1317084/"
] | As already pointed out you can't rely on precompiled binaries. I also had a lot of problems and finally ended up with compiling my own binaries. My setup was for Windows7, Eclipse CDT (Juno) and MinGW. You can check my post on Stackoverflow [here](https://stackoverflow.com/questions/17393311/openvc-2-4-5-eclipse-cdt-ju... | I guess this is an error related to memory management. Maybe because your'e releasing the window before the image. But anyhow you should use the OpenCV C++ interface, as this does a lot of stuff automagically. With the C++ Interface your code would look like this:
```
#include <opencv.hpp>
int main( int argc,... |
13,005,304 | I followed steps [in this SO link](https://stackoverflow.com/questions/10860352/getting-started-with-opencv-2-4-and-mingw-on-windows-7/10860353#comment17523493_10860353) to compile a sample program using OpenCV2.4.0 in windows. I made a setup both in DEVC++ and NetBeans with Mingw. My sample Program is getting Compiled... | 2012/10/22 | [
"https://Stackoverflow.com/questions/13005304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1317084/"
] | **Using the libs in "...\opencv\build\x86\mingw\bin" and "...\opencv\build\x86\mingw\lib**
You can not use the libraries that come with OpenCV-2.4.x.exe.
As some developers in forums and I find out. On some systems, the precompiled libs of "opencv 2.4.x" can not be used.
To compile your own programs, works, but **... | As already pointed out you can't rely on precompiled binaries. I also had a lot of problems and finally ended up with compiling my own binaries. My setup was for Windows7, Eclipse CDT (Juno) and MinGW. You can check my post on Stackoverflow [here](https://stackoverflow.com/questions/17393311/openvc-2-4-5-eclipse-cdt-ju... |
45,899,713 | I'm writing a shiny function that takes a dataset and generates UI components based upon the presence of design variables (factors) and response variables (numeric).
I would like to have a checkbox input to hide/show all of the variables in the app (the `design` UI element) and also be able to filter out particular r... | 2017/08/26 | [
"https://Stackoverflow.com/questions/45899713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1412833/"
] | It looks like `example.function` returns a function, which you are then invoking and passing in `req` and `res`.
It's like doing this:
```
let func = example.function('optionA', function (err, user) {
if (err) return res.send(err);
return res.send(user);
});
func(req, res);
``` | This is an example of an Immediately-invoked function expression. You're creating a function and invoking it immediately. More details: <https://en.wikipedia.org/wiki/Immediately-invoked_function_expression> |
70,458,627 | I'm working on a project dealing with loading data from firebase into recyclerview. recyclerview seems working just fine but when i try to scroll it until the end of the posts it always make the app crash. it's so strange to me if i don't scroll to the end post it won't crash. in logcat it show only an error "fail to a... | 2021/12/23 | [
"https://Stackoverflow.com/questions/70458627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15806370/"
] | If you add a [Post](https://jmeter.apache.org/usermanual/component_reference.html#postprocessors)/Pre processor it'll be executed after/before each request:
```
Pre/Post Processor Script
Request1
Request2
Request3
```
>
> Post-Processors are applied after samplers. Note that they are applied to all the samplers in ... | Depending on what you're trying to achieve:
1. [Beanshell PreProcessor](https://jmeter.apache.org/usermanual/component_reference.html#BeanShell_PreProcessor) will be executed **before** request
2. Other Beanshell Test Elements (Post-Processor, Assertion, Listener) will be executed **after** the request
All the aforem... |
2,531 | I'll start by saying that I probably should've asked this question earlier, and that due to that I did not most likely handle the situation very well.
There's an edit war going on [here](https://gamedev.stackexchange.com/posts/134838/revisions). The OP is reverting an [edit](https://gamedev.stackexchange.com/revisions... | 2017/10/20 | [
"https://gamedev.meta.stackexchange.com/questions/2531",
"https://gamedev.meta.stackexchange.com",
"https://gamedev.meta.stackexchange.com/users/-1/"
] | In general, getting into a fight isn't productive.
If you see an edit war going on, the right thing to do is generally to disengage. Flag a moderator or raise the issue on meta if you think that the challenged edits are important enough. If the lack of the edits makes, in your eyes, the question worthy of a down vote ... | Coming from the [worldbuilding stack](https://worldbuilding.stackexchange.com/), I've been judge to these things over there too - from both perspectives.
To give a simple answer:
Edits are meant to improve a question. This most often means formatting the text or fixing orthographic & grammatical mistakes. Thus genera... |
35,863,305 | In python 2.7, I want to create a static variable which stores the result of running a static method of the enclosing class.
I tried the following:
```
class A:
@staticmethod
def foo():
return 1
v = A.foo() # a static variable
print A.v
```
which returns the error:
```
NameError: name 'A' i... | 2016/03/08 | [
"https://Stackoverflow.com/questions/35863305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147537/"
] | Use `@classmethod`, and cache the value on the class object.
```
class S(object):
@classmethod
def f(klass):
if not hasattr(klass, '_f'):
print "Calculating value"
klass._f = 5
return klass._f
```
When called twice from different instances:
```
>>> s = S()
>>> s2 = S... | Apart from wondering why you're doing this: at the time you assign `v` (in the line `v = A.foo()`, `A` has not been defined yet. (The definition of `A` is the *entire* `class` block, so `A` isn't defined until after that block.)
In your second example, `B` is already defined when you say `v = B.foo()`.
EDIT: What puz... |
35,863,305 | In python 2.7, I want to create a static variable which stores the result of running a static method of the enclosing class.
I tried the following:
```
class A:
@staticmethod
def foo():
return 1
v = A.foo() # a static variable
print A.v
```
which returns the error:
```
NameError: name 'A' i... | 2016/03/08 | [
"https://Stackoverflow.com/questions/35863305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1147537/"
] | Use `@classmethod`, and cache the value on the class object.
```
class S(object):
@classmethod
def f(klass):
if not hasattr(klass, '_f'):
print "Calculating value"
klass._f = 5
return klass._f
```
When called twice from different instances:
```
>>> s = S()
>>> s2 = S... | You cannot call a (static) method from class A until the class is fully defined (end of block `class`). But you can define a static variable as soon as the class is defined:
```
class A:
@staticmethod
def foo():
print "running foo"
return 1
A.v = A.foo()
```
You can then use anywhere
```
pri... |
47,836,199 | I'm trying to extract match patterns like:
AA/**8G+8G+8G+8G**/WITHOUT \*
AA/**8\*G+8\*G+8\*G+8\*G**/WITH \*
AA/**8G+8\*G+8\*G+8\*G**/MIXED, THIS IS NOT SUPPORTED YET
using the following regular expression:
<https://regex101.com/r/zemJ8H/1>
but it matches only 8G+8G+8G+
because the pattern is identified as 8G\*\... | 2017/12/15 | [
"https://Stackoverflow.com/questions/47836199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4802043/"
] | Use query parameter to pass object after converting to json string.
```
<a [routerLink]="['/transmissionHistory']"
[queryParams]="{record:selectedRecord | json }">
{{selectedRecord.Name}}
</a>
```
In your component you can do something like this to read params:
```
@Component({
selector: 'app-transmission... | Please take a look at [router parameters](https://angular-2-training-book.rangle.io/handout/routing/routeparams.html). You can pass you param like this:
`<a [routerLink]="['/transmissionHistory', selectedRecord]">{{selectedRecord.Name}}</a>`
Than in you component you can retrive it like this:
```js
@Component({
se... |
47,836,199 | I'm trying to extract match patterns like:
AA/**8G+8G+8G+8G**/WITHOUT \*
AA/**8\*G+8\*G+8\*G+8\*G**/WITH \*
AA/**8G+8\*G+8\*G+8\*G**/MIXED, THIS IS NOT SUPPORTED YET
using the following regular expression:
<https://regex101.com/r/zemJ8H/1>
but it matches only 8G+8G+8G+
because the pattern is identified as 8G\*\... | 2017/12/15 | [
"https://Stackoverflow.com/questions/47836199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4802043/"
] | Please take a look at [router parameters](https://angular-2-training-book.rangle.io/handout/routing/routeparams.html). You can pass you param like this:
`<a [routerLink]="['/transmissionHistory', selectedRecord]">{{selectedRecord.Name}}</a>`
Than in you component you can retrive it like this:
```js
@Component({
se... | **[How to pass data between routed components in Angular](https://medium.com/ableneo/how-to-pass-data-between-routed-components-in-angular-2306308d8255)** |
47,836,199 | I'm trying to extract match patterns like:
AA/**8G+8G+8G+8G**/WITHOUT \*
AA/**8\*G+8\*G+8\*G+8\*G**/WITH \*
AA/**8G+8\*G+8\*G+8\*G**/MIXED, THIS IS NOT SUPPORTED YET
using the following regular expression:
<https://regex101.com/r/zemJ8H/1>
but it matches only 8G+8G+8G+
because the pattern is identified as 8G\*\... | 2017/12/15 | [
"https://Stackoverflow.com/questions/47836199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4802043/"
] | Please take a look at [router parameters](https://angular-2-training-book.rangle.io/handout/routing/routeparams.html). You can pass you param like this:
`<a [routerLink]="['/transmissionHistory', selectedRecord]">{{selectedRecord.Name}}</a>`
Than in you component you can retrive it like this:
```js
@Component({
se... | In Angular 8 (and above) you have to call to queryParams.
```
constructor(
private route: ActivatedRoute,
) {}
ngOnInit() {
this.route.queryParams.subscribe((params) => {
const userId = params['userId'];
console.log(userId);
});
}
``` |
47,836,199 | I'm trying to extract match patterns like:
AA/**8G+8G+8G+8G**/WITHOUT \*
AA/**8\*G+8\*G+8\*G+8\*G**/WITH \*
AA/**8G+8\*G+8\*G+8\*G**/MIXED, THIS IS NOT SUPPORTED YET
using the following regular expression:
<https://regex101.com/r/zemJ8H/1>
but it matches only 8G+8G+8G+
because the pattern is identified as 8G\*\... | 2017/12/15 | [
"https://Stackoverflow.com/questions/47836199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4802043/"
] | Please take a look at [router parameters](https://angular-2-training-book.rangle.io/handout/routing/routeparams.html). You can pass you param like this:
`<a [routerLink]="['/transmissionHistory', selectedRecord]">{{selectedRecord.Name}}</a>`
Than in you component you can retrive it like this:
```js
@Component({
se... | Using Angular 13, I've found there's a much easier approach.
Hope this helps everyone!
~Jedi
```js
import { Component, Input } from '@angular/core';
@Component({
selector: 'custom-component',
templateUrl: './custom-component.component.html',
styleUrls: ['./custom-component.component.scss'],
})
export cla... |
47,836,199 | I'm trying to extract match patterns like:
AA/**8G+8G+8G+8G**/WITHOUT \*
AA/**8\*G+8\*G+8\*G+8\*G**/WITH \*
AA/**8G+8\*G+8\*G+8\*G**/MIXED, THIS IS NOT SUPPORTED YET
using the following regular expression:
<https://regex101.com/r/zemJ8H/1>
but it matches only 8G+8G+8G+
because the pattern is identified as 8G\*\... | 2017/12/15 | [
"https://Stackoverflow.com/questions/47836199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4802043/"
] | Use query parameter to pass object after converting to json string.
```
<a [routerLink]="['/transmissionHistory']"
[queryParams]="{record:selectedRecord | json }">
{{selectedRecord.Name}}
</a>
```
In your component you can do something like this to read params:
```
@Component({
selector: 'app-transmission... | **[How to pass data between routed components in Angular](https://medium.com/ableneo/how-to-pass-data-between-routed-components-in-angular-2306308d8255)** |
47,836,199 | I'm trying to extract match patterns like:
AA/**8G+8G+8G+8G**/WITHOUT \*
AA/**8\*G+8\*G+8\*G+8\*G**/WITH \*
AA/**8G+8\*G+8\*G+8\*G**/MIXED, THIS IS NOT SUPPORTED YET
using the following regular expression:
<https://regex101.com/r/zemJ8H/1>
but it matches only 8G+8G+8G+
because the pattern is identified as 8G\*\... | 2017/12/15 | [
"https://Stackoverflow.com/questions/47836199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4802043/"
] | Use query parameter to pass object after converting to json string.
```
<a [routerLink]="['/transmissionHistory']"
[queryParams]="{record:selectedRecord | json }">
{{selectedRecord.Name}}
</a>
```
In your component you can do something like this to read params:
```
@Component({
selector: 'app-transmission... | In Angular 8 (and above) you have to call to queryParams.
```
constructor(
private route: ActivatedRoute,
) {}
ngOnInit() {
this.route.queryParams.subscribe((params) => {
const userId = params['userId'];
console.log(userId);
});
}
``` |
47,836,199 | I'm trying to extract match patterns like:
AA/**8G+8G+8G+8G**/WITHOUT \*
AA/**8\*G+8\*G+8\*G+8\*G**/WITH \*
AA/**8G+8\*G+8\*G+8\*G**/MIXED, THIS IS NOT SUPPORTED YET
using the following regular expression:
<https://regex101.com/r/zemJ8H/1>
but it matches only 8G+8G+8G+
because the pattern is identified as 8G\*\... | 2017/12/15 | [
"https://Stackoverflow.com/questions/47836199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4802043/"
] | Use query parameter to pass object after converting to json string.
```
<a [routerLink]="['/transmissionHistory']"
[queryParams]="{record:selectedRecord | json }">
{{selectedRecord.Name}}
</a>
```
In your component you can do something like this to read params:
```
@Component({
selector: 'app-transmission... | Using Angular 13, I've found there's a much easier approach.
Hope this helps everyone!
~Jedi
```js
import { Component, Input } from '@angular/core';
@Component({
selector: 'custom-component',
templateUrl: './custom-component.component.html',
styleUrls: ['./custom-component.component.scss'],
})
export cla... |
47,836,199 | I'm trying to extract match patterns like:
AA/**8G+8G+8G+8G**/WITHOUT \*
AA/**8\*G+8\*G+8\*G+8\*G**/WITH \*
AA/**8G+8\*G+8\*G+8\*G**/MIXED, THIS IS NOT SUPPORTED YET
using the following regular expression:
<https://regex101.com/r/zemJ8H/1>
but it matches only 8G+8G+8G+
because the pattern is identified as 8G\*\... | 2017/12/15 | [
"https://Stackoverflow.com/questions/47836199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4802043/"
] | In Angular 8 (and above) you have to call to queryParams.
```
constructor(
private route: ActivatedRoute,
) {}
ngOnInit() {
this.route.queryParams.subscribe((params) => {
const userId = params['userId'];
console.log(userId);
});
}
``` | **[How to pass data between routed components in Angular](https://medium.com/ableneo/how-to-pass-data-between-routed-components-in-angular-2306308d8255)** |
47,836,199 | I'm trying to extract match patterns like:
AA/**8G+8G+8G+8G**/WITHOUT \*
AA/**8\*G+8\*G+8\*G+8\*G**/WITH \*
AA/**8G+8\*G+8\*G+8\*G**/MIXED, THIS IS NOT SUPPORTED YET
using the following regular expression:
<https://regex101.com/r/zemJ8H/1>
but it matches only 8G+8G+8G+
because the pattern is identified as 8G\*\... | 2017/12/15 | [
"https://Stackoverflow.com/questions/47836199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4802043/"
] | Using Angular 13, I've found there's a much easier approach.
Hope this helps everyone!
~Jedi
```js
import { Component, Input } from '@angular/core';
@Component({
selector: 'custom-component',
templateUrl: './custom-component.component.html',
styleUrls: ['./custom-component.component.scss'],
})
export cla... | **[How to pass data between routed components in Angular](https://medium.com/ableneo/how-to-pass-data-between-routed-components-in-angular-2306308d8255)** |
63,115,004 | I have a weird thing happening when my css modules are exported with the `* as styles` becomes inaccessible when I bundle my code and use it in other repo's.
The response from styles when bundled:
```
{default: {... my class names} }
```
When I change my code to `import styles from '...'` it works when bundled beca... | 2020/07/27 | [
"https://Stackoverflow.com/questions/63115004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10612355/"
] | The problem was that when I was using Pythonanywhere, I wasn't using `python manage.py runserver` command because my server was being hosted by pythonanywhere. I didn't know that with `DEBUG=TRUE`, the `runserver` command actually serves static files. What I ended up doing was setting my `static_root`, `static_url`, an... | If the Django admin page is rendered without style, you probably set `DEBUG=False` in your settings.py.
With `DEBUG=False` Django won't handle static files anymore. Check Serving the files box. [here](https://docs.djangoproject.com/en/3.0/howto/static-files/#managing-static-files-e-g-images-javascript-css)
Use debug=... |
307,500 | A long running query was being run on a SQL Server 2005 database which referenced tables on a SQL Server 2000 database. Both instances of SQL Server are running on the same machine. It was only a select query, it did not alter any records. It had run for about 2 hours before it was killed. The process has been in a "KI... | 2011/09/02 | [
"https://serverfault.com/questions/307500",
"https://serverfault.com",
"https://serverfault.com/users/93506/"
] | Gitolite 2.x
------------
If *git* is not in the default PATH, then you can set `$GIT_PATH` in your gitolite user’s `~/.gitolite.rc`.
The default `.gitolite.rc` comes with this line:
```
$GIT_PATH="";
```
If your Git installation is under `/usr/local` (so that you have `/usr/local/bin/git`), then replace the above... | `.bashrc` is only invoked for interactive shells. Try adding `export PATH=/usr/local/bin:$PATH` to `~/.bash_profile`. |
10,114,638 | I am working on a project where I need to be able to get GMT time using Jquery and post it into a MYSQL DB through PHP. Then I need to get the local time factor of the user and save it into the db. After that using JS/JQuery convert GMT to the users local time. I was hoping someone could give me a code example if possi... | 2012/04/11 | [
"https://Stackoverflow.com/questions/10114638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/969920/"
] | Without having the user manualy select their timezone, one approach is to use the javascript date object to collect infomration about the users local time, and use it in a subsequent request
```
var timestamp = new Date();
document.getElementById('timestamp_target').value = timestamp.getTimezoneOffset();
```
I'm in ... | Use this as a starting point:
[Compare user's time zone with the website's office location time zone](https://stackoverflow.com/questions/6178951/compare-users-time-zone-with-the-websites-office-location-time-zone)
Followed by the use of AJAX to post the data to a php script, which inserts it into the database. A qui... |
440,159 | I'm currently working as Fullstack developer, our frontend is being built in React.
Our current process involves:
1. The client / product owner describes a feature to the UI / UX designer.
2. The designer creates a nice template in Figma, or any other UI tool like-so
3. The design is given to us the developers to imp... | 2022/08/01 | [
"https://softwareengineering.stackexchange.com/questions/440159",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/418586/"
] | What you describe doesn't feel like waterfall - it is waterfall. One of the twelve principles of Agile Software Development is that "business people and developers must work together daily throughout the project". Today, the phrase "business people" is interpreted to mean project and product managers, which often inclu... | Agile would say do an iteration with the quick off the shelf component and add more stories, each estimated for where it falls short of the desired goal.
The problem is this relies on the customer, internal or external, buying into the core idea of any Agile methodology. That half a solution has value.
If your custom... |
14,226 | Anybody can explain me the reason why:
-we don't say 每个年 but 每年? and, on the contrary,
we must say 每个月 and not 每月?
-Is there somethig to do with the fact that sometimes we must use 全 (全身)instead of 整个 while we must say 整个身体 and don't 全身体?
Thanks (Húli)
PS/Afterwards I have introduced some changes on my previous post in... | 2015/07/11 | [
"https://chinese.stackexchange.com/questions/14226",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/11287/"
] | The reason is that 天, 日, 周, 年 are themselves counter words / classifiers (so they don't need an extra one), while 星期, 礼拜, 月 are not classifiers and therefore require a classifier, which happen to be 个 for the all of them.
Note that although 月 is listed with the ones that require a classifier, it's quite frequent to he... | The rule is: 天, 日, 年 do not take 个 as counter word.
---
* 一天,三天,每天, 每日
* 一个星期,一个礼拜, BUT: 一周 goes with no counter word. All of these mean 'one week'.
* 一个月,五个月, BUT: 一月 is January, not 'one month'.
* 一年,每年 |
14,226 | Anybody can explain me the reason why:
-we don't say 每个年 but 每年? and, on the contrary,
we must say 每个月 and not 每月?
-Is there somethig to do with the fact that sometimes we must use 全 (全身)instead of 整个 while we must say 整个身体 and don't 全身体?
Thanks (Húli)
PS/Afterwards I have introduced some changes on my previous post in... | 2015/07/11 | [
"https://chinese.stackexchange.com/questions/14226",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/11287/"
] | The rule is: 天, 日, 年 do not take 个 as counter word.
---
* 一天,三天,每天, 每日
* 一个星期,一个礼拜, BUT: 一周 goes with no counter word. All of these mean 'one week'.
* 一个月,五个月, BUT: 一月 is January, not 'one month'.
* 一年,每年 | I'm Chinese, I never say 每个年, but i do say 每月 sometimes (for abbrev).
and I never say '整个身' or ‘全身体', I do say 全身(describe physical) or 整个身子(describe physical) or 整个人(describe mental more)
for example:
全身湿透了(wet through),整个身子都受伤了(injured everywhere),整个人都不好了(not feeling well).
correct:一天(one day, whole day, depends... |
14,226 | Anybody can explain me the reason why:
-we don't say 每个年 but 每年? and, on the contrary,
we must say 每个月 and not 每月?
-Is there somethig to do with the fact that sometimes we must use 全 (全身)instead of 整个 while we must say 整个身体 and don't 全身体?
Thanks (Húli)
PS/Afterwards I have introduced some changes on my previous post in... | 2015/07/11 | [
"https://chinese.stackexchange.com/questions/14226",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/11287/"
] | The reason is that 天, 日, 周, 年 are themselves counter words / classifiers (so they don't need an extra one), while 星期, 礼拜, 月 are not classifiers and therefore require a classifier, which happen to be 个 for the all of them.
Note that although 月 is listed with the ones that require a classifier, it's quite frequent to he... | I'm Chinese, I never say 每个年, but i do say 每月 sometimes (for abbrev).
and I never say '整个身' or ‘全身体', I do say 全身(describe physical) or 整个身子(describe physical) or 整个人(describe mental more)
for example:
全身湿透了(wet through),整个身子都受伤了(injured everywhere),整个人都不好了(not feeling well).
correct:一天(one day, whole day, depends... |
46,598,940 | I have a screen where user can see an english word and type equivalent translation in any language.
My database creation query:
```
CREATE DATABASE IF NOT EXISTS lang_db
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
```
My table creation query:
```
CREATE TABLE lang_map (
WORD VARCHAR(2048) ... | 2017/10/06 | [
"https://Stackoverflow.com/questions/46598940",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4046836/"
] | **Preferred Answer**
```
df.assign(b=df.b.str.replace('(.+)-', r'-\1').astype(int))
a b
0 s1 10
1 s2 -12
2 s3 13
3 s4 -1
4 s5 11
```
---
**Attempt at a Fast Answer**
Using list comprehension
```
df.loc[:, 'b'] = pd.to_numeric(
[x[-1] + x[:-1] if x.endswith('-') else x for x in df.b.va... | Try `str.replace`:
```
b = df.b.str.replace(r'(\d+)-', r'-\1')
print(b)
0 10
1 -12
2 13
3 -1
4 11
Name: b, dtype: object
```
You'd assign the result back, as so:
```
df['b'] = b.astype(int) # or .astype(float)
```
---
As [piRSquared suggested](https://stackoverflow.com/questions/46598939/how-t... |
6,729,389 | I don't understand the problem, why BitmapFactory.decodeFile works fine on emulator but fails on HTC desire. The following code:
```
File f = new File("/sdcard/DCIM/100MEDIA/");
File files[] = f.listFiles();
Bitmap b1 = null, b2 = null;
b1 = BitmapFactory.decodeFile(files[0].getPath());
b2 = BitmapFactory.decodeFile... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6729389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/848604/"
] | The recommended way of using external path is [getExternalStorageDirectory](http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory%28%29)
Change your code to something like this.
```
File f = new File(Environment.getExternalStorageDirectory() + "/DCIM/100MEDIA/");
``` | Use a [BitmapFactory.Options](http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html) object while decoding the file. Set inSampleSize to something like 2 or 4 depending on your screen resolution to get an optimum preview. What it does is that it downsamples the image so that it does not tak... |
34,419 | According to [the Duden](http://www.duden.de/rechtschreibung/zwangsversteigern) and [dict.cc](http://www.dict.cc/?s=zwangsversteigern), the use of the verb *zwangsversteigern* in the simple past tense is uncommon:
>
> zwangsversteigern | **-**, zwangsversteigert [nur als Infinitiv und
> Partizip Perfekt gebräuchlich... | 2017/01/20 | [
"https://german.stackexchange.com/questions/34419",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/15271/"
] | The answer to the first question is simply: they are not special, they are common. Most verbs in German do not occur in preterite outside of written (i.e. newspapers or literature) texts. In the case of *zwangsversteigern,* the most common usage is passive because you are more interested in the thing that is being auct... | The thing about words such as *zwangsversteigern* or *voreinstellen* is not that they are uncommon in the preterite, but that they are uncommon in any finite forms. Preterite forms such as \**ich zwangsversteigerte* or \**ich stellte vorein* are equally uncommon as present tense forms such as \**ich zwangsversteiger... |
180,015 | ```
ListPlot[list, Joined -> True, PlotRange -> Full]
```
[](https://i.stack.imgur.com/Y3lO6.jpg)
I would like a simple method to get the positions within the list where the values deviate a lot from their previous values. If I just use a threshold,... | 2018/08/14 | [
"https://mathematica.stackexchange.com/questions/180015",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/44178/"
] | Using `FindPeaks` is [a fine solution](https://mathematica.stackexchange.com/a/180018/34008). This answer responds to the following OP statements/questions.
>
> I would like a simple method to get the positions within the list where the values deviate a lot from their previous values. If I just use a threshold, I mig... | I think that you are likely looking for some combination of the parameters of the `FindPeak` function, for example:
```
list = Import["https://pastebin.com/raw/ncJDt0L4", "List"];
peaks = FindPeaks[list, Automatic, Automatic, 500];
ListLinePlot[
list,
PlotRange -> Full,
Epilog -> {Red, PointSize[Large], Point[peak... |
180,015 | ```
ListPlot[list, Joined -> True, PlotRange -> Full]
```
[](https://i.stack.imgur.com/Y3lO6.jpg)
I would like a simple method to get the positions within the list where the values deviate a lot from their previous values. If I just use a threshold,... | 2018/08/14 | [
"https://mathematica.stackexchange.com/questions/180015",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/44178/"
] | `FindPeaks` is [the perfect solution](https://mathematica.stackexchange.com/a/180018/2036) as it has all the options to fine tune the condition you require for a peak:
```
list = Import["https://pastebin.com/raw/ncJDt0L4", "List"];
peaks = FindPeaks[list, 3, 12];
ListLogPlot[{list, peaks}, PlotRange -> Full, Joined ... | I think that you are likely looking for some combination of the parameters of the `FindPeak` function, for example:
```
list = Import["https://pastebin.com/raw/ncJDt0L4", "List"];
peaks = FindPeaks[list, Automatic, Automatic, 500];
ListLinePlot[
list,
PlotRange -> Full,
Epilog -> {Red, PointSize[Large], Point[peak... |
180,015 | ```
ListPlot[list, Joined -> True, PlotRange -> Full]
```
[](https://i.stack.imgur.com/Y3lO6.jpg)
I would like a simple method to get the positions within the list where the values deviate a lot from their previous values. If I just use a threshold,... | 2018/08/14 | [
"https://mathematica.stackexchange.com/questions/180015",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/44178/"
] | `FindPeaks` is [the perfect solution](https://mathematica.stackexchange.com/a/180018/2036) as it has all the options to fine tune the condition you require for a peak:
```
list = Import["https://pastebin.com/raw/ncJDt0L4", "List"];
peaks = FindPeaks[list, 3, 12];
ListLogPlot[{list, peaks}, PlotRange -> Full, Joined ... | Using `FindPeaks` is [a fine solution](https://mathematica.stackexchange.com/a/180018/34008). This answer responds to the following OP statements/questions.
>
> I would like a simple method to get the positions within the list where the values deviate a lot from their previous values. If I just use a threshold, I mig... |
1,166,495 | I know this doesn't work:
$('#section').html($(data), function()
{
$('#section').fadeIn();
});
How would I go on writing it? It should be simply, but I've been away from jQuery for too long.
Thanks! | 2009/07/22 | [
"https://Stackoverflow.com/questions/1166495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Do you want to call fadeIn after the html method is completed? You can simply do this,
```
$('#section')
.html($(data))
.fadeIn();
```
Above works because unlike the 'animate' methods, html method is synchronous. fadeIn method will be called only after html method has finished executing. | If you want the `section` to fade in after you set its `innerHTML`, this is what you need:
```
$('#section').html($(data)).fadeIn();
``` |
1,166,495 | I know this doesn't work:
$('#section').html($(data), function()
{
$('#section').fadeIn();
});
How would I go on writing it? It should be simply, but I've been away from jQuery for too long.
Thanks! | 2009/07/22 | [
"https://Stackoverflow.com/questions/1166495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Do you want to call fadeIn after the html method is completed? You can simply do this,
```
$('#section')
.html($(data))
.fadeIn();
```
Above works because unlike the 'animate' methods, html method is synchronous. fadeIn method will be called only after html method has finished executing. | Are you talking about using the document ready function to fade something once it's ready?
Anything you would need to know is right in their [Documentation](http://docs.jquery.com/Main_Page). Since you didn't really ask a specific question, and you said you're familiar with it, it won't take much to figure out what yo... |
1,166,495 | I know this doesn't work:
$('#section').html($(data), function()
{
$('#section').fadeIn();
});
How would I go on writing it? It should be simply, but I've been away from jQuery for too long.
Thanks! | 2009/07/22 | [
"https://Stackoverflow.com/questions/1166495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you want the `section` to fade in after you set its `innerHTML`, this is what you need:
```
$('#section').html($(data)).fadeIn();
``` | Are you talking about using the document ready function to fade something once it's ready?
Anything you would need to know is right in their [Documentation](http://docs.jquery.com/Main_Page). Since you didn't really ask a specific question, and you said you're familiar with it, it won't take much to figure out what yo... |
329,758 | I recently acquired an older iMac 5,1 with 3 GB RAM, currently running Mac OS X 10.6.8, and from what I can gather online it is able to run "Mac OS X 10.7.5 Lion". I found that [it is available for purchase on Apple's website for $20](https://www.apple.com/shop/product/D6106Z/A/os-x-lion), but I do not consider $20 wor... | 2018/07/10 | [
"https://apple.stackexchange.com/questions/329758",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/196352/"
] | In the past you could buy USB physical media for Lion but the item you linked to is a redemption code delivered by email. You then have the ability to associate that purchase with one Apple ID of your choosing so you can download and install.
Apple offers pre-sales support if you need more questions about this (or any... | Thanks to everyone for posting their answers. I went ahead and purchased it. This is my experience.
I purchased Mac OS X 10.7.5 Lion and received and E-mail that I would be receiving the item in future E-mails. A few days later I was delivered two E-mails, a password-protected PDF file in one, and a password in the ot... |
329,758 | I recently acquired an older iMac 5,1 with 3 GB RAM, currently running Mac OS X 10.6.8, and from what I can gather online it is able to run "Mac OS X 10.7.5 Lion". I found that [it is available for purchase on Apple's website for $20](https://www.apple.com/shop/product/D6106Z/A/os-x-lion), but I do not consider $20 wor... | 2018/07/10 | [
"https://apple.stackexchange.com/questions/329758",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/196352/"
] | From the Apple Store page you linked for 10.7:
>
> What you receive: An email with a content code for the Mac App Store.
>
>
>
You should be able to link the code to the Mac App Store, and, subsequently, your Apple ID. | Thanks to everyone for posting their answers. I went ahead and purchased it. This is my experience.
I purchased Mac OS X 10.7.5 Lion and received and E-mail that I would be receiving the item in future E-mails. A few days later I was delivered two E-mails, a password-protected PDF file in one, and a password in the ot... |
5,726 | I'd like this code to only run inside the admin area as it is resorting the items on the public side admin bar too.
```
/* Reorder Admin Menu to put "Pages" at the top */
function menu_order_filter($menu) {
$content_menu = array('edit.php?post_type=page');
array_splice($menu, 2, 0, $content_menu);
return arr... | 2010/12/21 | [
"https://wordpress.stackexchange.com/questions/5726",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1925/"
] | There is very little overhead to assigning couple of filters on hooks that simply won't fire on front end.
In general it would be something like this:
```
add_action('init', 'admin_only');
function admin_only() {
if( !is_admin() )
return;
// filter assignemnts and such go here
}
```
Also `create_... | use the Hook admin\_init and later hooks, the init-Hook comes realy ealier as only the admin. But it is important, when you use li18n-functions or AJAX, than it is better you use init. |
5,726 | I'd like this code to only run inside the admin area as it is resorting the items on the public side admin bar too.
```
/* Reorder Admin Menu to put "Pages" at the top */
function menu_order_filter($menu) {
$content_menu = array('edit.php?post_type=page');
array_splice($menu, 2, 0, $content_menu);
return arr... | 2010/12/21 | [
"https://wordpress.stackexchange.com/questions/5726",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1925/"
] | There is very little overhead to assigning couple of filters on hooks that simply won't fire on front end.
In general it would be something like this:
```
add_action('init', 'admin_only');
function admin_only() {
if( !is_admin() )
return;
// filter assignemnts and such go here
}
```
Also `create_... | <https://developer.wordpress.org/reference/functions/is_admin/>
```
if ( ! is_admin() ) {
echo "You are viewing the theme";
} else {
echo "You are viewing the WordPress Administration Panels";
}
``` |
5,726 | I'd like this code to only run inside the admin area as it is resorting the items on the public side admin bar too.
```
/* Reorder Admin Menu to put "Pages" at the top */
function menu_order_filter($menu) {
$content_menu = array('edit.php?post_type=page');
array_splice($menu, 2, 0, $content_menu);
return arr... | 2010/12/21 | [
"https://wordpress.stackexchange.com/questions/5726",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1925/"
] | There is very little overhead to assigning couple of filters on hooks that simply won't fire on front end.
In general it would be something like this:
```
add_action('init', 'admin_only');
function admin_only() {
if( !is_admin() )
return;
// filter assignemnts and such go here
}
```
Also `create_... | **Update in 2020**, Working answer, I went to different answers none of them works now in new WordPress.
```
function hide_categories_for_specific_user( $exclusions, $args ){
if ( ((defined( 'REST_REQUEST' ) && REST_REQUEST) or $GLOBALS['pagenow'] === 'edit.php' ) && !current_user_can( 'manage_options' ) ) {
// I... |
5,726 | I'd like this code to only run inside the admin area as it is resorting the items on the public side admin bar too.
```
/* Reorder Admin Menu to put "Pages" at the top */
function menu_order_filter($menu) {
$content_menu = array('edit.php?post_type=page');
array_splice($menu, 2, 0, $content_menu);
return arr... | 2010/12/21 | [
"https://wordpress.stackexchange.com/questions/5726",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1925/"
] | <https://developer.wordpress.org/reference/functions/is_admin/>
```
if ( ! is_admin() ) {
echo "You are viewing the theme";
} else {
echo "You are viewing the WordPress Administration Panels";
}
``` | use the Hook admin\_init and later hooks, the init-Hook comes realy ealier as only the admin. But it is important, when you use li18n-functions or AJAX, than it is better you use init. |
5,726 | I'd like this code to only run inside the admin area as it is resorting the items on the public side admin bar too.
```
/* Reorder Admin Menu to put "Pages" at the top */
function menu_order_filter($menu) {
$content_menu = array('edit.php?post_type=page');
array_splice($menu, 2, 0, $content_menu);
return arr... | 2010/12/21 | [
"https://wordpress.stackexchange.com/questions/5726",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1925/"
] | use the Hook admin\_init and later hooks, the init-Hook comes realy ealier as only the admin. But it is important, when you use li18n-functions or AJAX, than it is better you use init. | **Update in 2020**, Working answer, I went to different answers none of them works now in new WordPress.
```
function hide_categories_for_specific_user( $exclusions, $args ){
if ( ((defined( 'REST_REQUEST' ) && REST_REQUEST) or $GLOBALS['pagenow'] === 'edit.php' ) && !current_user_can( 'manage_options' ) ) {
// I... |
5,726 | I'd like this code to only run inside the admin area as it is resorting the items on the public side admin bar too.
```
/* Reorder Admin Menu to put "Pages" at the top */
function menu_order_filter($menu) {
$content_menu = array('edit.php?post_type=page');
array_splice($menu, 2, 0, $content_menu);
return arr... | 2010/12/21 | [
"https://wordpress.stackexchange.com/questions/5726",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1925/"
] | <https://developer.wordpress.org/reference/functions/is_admin/>
```
if ( ! is_admin() ) {
echo "You are viewing the theme";
} else {
echo "You are viewing the WordPress Administration Panels";
}
``` | **Update in 2020**, Working answer, I went to different answers none of them works now in new WordPress.
```
function hide_categories_for_specific_user( $exclusions, $args ){
if ( ((defined( 'REST_REQUEST' ) && REST_REQUEST) or $GLOBALS['pagenow'] === 'edit.php' ) && !current_user_can( 'manage_options' ) ) {
// I... |
11,190 | Знакомый старшеклассник задал мне вопрос, на который я не смог ответить. Прошу коллег о помощи. На одном из солидных сайтов по подготовке к ЕГЭ в вопросе А-14 нужно указать строку, на которой все слова на одно правило - правописание безударных проверяемых гласных в корне. Из 4-х предложенных вариантов 1-я и 2-я строки ... | 2012/10/23 | [
"https://rus.stackexchange.com/questions/11190",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/895/"
] | Не ошибаетесь. Очередная плюха в ЕГЭ. Хорошо хоть в "материалах к".
Не знаю, как Виктор проверял (что ж не написали-то?), но проверочное есть: стрАдный, прилагательное к "страда". Страда и страдать - однокоренные.
ЗЫ А парень - молодец. Утер нос дядям из министерства.
~~~~~~~
[[@Ларf](/users/498/%D0%BB%D0%B0%D1%... | 1.Сож…леть-жалость;
соб…лезновать - боль;
состр…дать - непроверяемая гласная. Или Вы как-то проверили?
Ответ-2. |
11,190 | Знакомый старшеклассник задал мне вопрос, на который я не смог ответить. Прошу коллег о помощи. На одном из солидных сайтов по подготовке к ЕГЭ в вопросе А-14 нужно указать строку, на которой все слова на одно правило - правописание безударных проверяемых гласных в корне. Из 4-х предложенных вариантов 1-я и 2-я строки ... | 2012/10/23 | [
"https://rus.stackexchange.com/questions/11190",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/895/"
] | 1.Сож…леть-жалость;
соб…лезновать - боль;
состр…дать - непроверяемая гласная. Или Вы как-то проверили?
Ответ-2. | [[@Ларf](/users/498/%D0%BB%D0%B0%D1%80f)](/users/498/%D0%BB%D0%B0%D1%80f), "дОлбит" Яндекс выдаёт как правильный, но вопрос поставлен так: "Где ошибка?" Так что нет претензий к этому слову. Вопрос в другом: вот в том же самом первом вопросе есть слово "принятА", и оно является правильным (то бишь без ошибки). В Викисло... |
11,190 | Знакомый старшеклассник задал мне вопрос, на который я не смог ответить. Прошу коллег о помощи. На одном из солидных сайтов по подготовке к ЕГЭ в вопросе А-14 нужно указать строку, на которой все слова на одно правило - правописание безударных проверяемых гласных в корне. Из 4-х предложенных вариантов 1-я и 2-я строки ... | 2012/10/23 | [
"https://rus.stackexchange.com/questions/11190",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/895/"
] | Не ошибаетесь. Очередная плюха в ЕГЭ. Хорошо хоть в "материалах к".
Не знаю, как Виктор проверял (что ж не написали-то?), но проверочное есть: стрАдный, прилагательное к "страда". Страда и страдать - однокоренные.
ЗЫ А парень - молодец. Утер нос дядям из министерства.
~~~~~~~
[[@Ларf](/users/498/%D0%BB%D0%B0%D1%... | [[@Ларf](/users/498/%D0%BB%D0%B0%D1%80f)](/users/498/%D0%BB%D0%B0%D1%80f), "дОлбит" Яндекс выдаёт как правильный, но вопрос поставлен так: "Где ошибка?" Так что нет претензий к этому слову. Вопрос в другом: вот в том же самом первом вопросе есть слово "принятА", и оно является правильным (то бишь без ошибки). В Викисло... |
23,904,306 | I'm trying to hide and element inside a form but it's not working.
here's my code:
```
<style>
.hide {
visibility: hidden;
display: none;
}
</style>
</head>
<body>
<form>
<input type="submit" id="show" value="Show" />
<input type="submit" value="Hide" id="hide" />
</form>
<script type=... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23904306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3217982/"
] | You will need to import HTTPS certificate of repository into java keystore or you can trust all certificates.
Have a look at this [How to tell Maven to disregard SSL errors (and trusting all certs)?](https://stackoverflow.com/questions/21252800/maven-trusting-all-certs-unlimited-java-policy) | I would suggest to add and specify java key store to get rid of these issues.
Full solution can be found [here](https://stackoverflow.com/a/37108820/1802348)
simply download ssl certificate and use keytool to get jks file and specify that jks in MAVEN\_OPTS environment variable.
But do not forget to put your jks fil... |
23,904,306 | I'm trying to hide and element inside a form but it's not working.
here's my code:
```
<style>
.hide {
visibility: hidden;
display: none;
}
</style>
</head>
<body>
<form>
<input type="submit" id="show" value="Show" />
<input type="submit" value="Hide" id="hide" />
</form>
<script type=... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23904306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3217982/"
] | You will need to import HTTPS certificate of repository into java keystore or you can trust all certificates.
Have a look at this [How to tell Maven to disregard SSL errors (and trusting all certs)?](https://stackoverflow.com/questions/21252800/maven-trusting-all-certs-unlimited-java-policy) | If you feel the source is secure and it's just something with your network, firewalls or antivirus and you can't solve it with nothing else:
You can ignore the SSL certificate error on Maven.
Just add **-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.da... |
66,682,896 | Using Swift5.3.2, iOS14.4.1, Xcode 12.4,
I am successfully running a VideoPlayer in SwiftUI.
I am calling the Player view with this code: `VideoPlayer(player: AVPlayer(url: url))`.
The problem is that the video stops playing whenever a parent-View of the VideoPlayer updates (i.e. re-renders).
Since in SwiftUI I don... | 2021/03/17 | [
"https://Stackoverflow.com/questions/66682896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3826232/"
] | This is in response to our comment thread on the other answer:
```
class PlayerViewModel: ObservableObject {
@Published var avPlayer: AVPlayer?
func loadFromUrl(url: URL) {
avPlayer = AVPlayer(url: url)
}
}
struct CustomPlayerView: View {
var url : URL
@StateObject private var playerVie... | I have found a solution.
Call the following :
```
CustomPlayerView(url: url)
```
...instead of :
```
VideoPlayer(player: AVPlayer(url: url))
```
Not sure why this works, tough.
Maybe somebody can explain further ?
Here is the CustomVideoPlayer code:
```
struct CustomPlayerView: View {
private let url: UR... |
66,682,896 | Using Swift5.3.2, iOS14.4.1, Xcode 12.4,
I am successfully running a VideoPlayer in SwiftUI.
I am calling the Player view with this code: `VideoPlayer(player: AVPlayer(url: url))`.
The problem is that the video stops playing whenever a parent-View of the VideoPlayer updates (i.e. re-renders).
Since in SwiftUI I don... | 2021/03/17 | [
"https://Stackoverflow.com/questions/66682896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3826232/"
] | With the solution from @jnpdx, everything works now.
Here is the final solution (full credit to @jnpdx):
```
import SwiftUI
import AVKit
class PlayerViewModel: ObservableObject {
@Published var avPlayer: AVPlayer?
func loadFromUrl(url: URL) {
avPlayer = AVPlayer(url: url)
}
}
struct CustomPlay... | I have found a solution.
Call the following :
```
CustomPlayerView(url: url)
```
...instead of :
```
VideoPlayer(player: AVPlayer(url: url))
```
Not sure why this works, tough.
Maybe somebody can explain further ?
Here is the CustomVideoPlayer code:
```
struct CustomPlayerView: View {
private let url: UR... |
66,682,896 | Using Swift5.3.2, iOS14.4.1, Xcode 12.4,
I am successfully running a VideoPlayer in SwiftUI.
I am calling the Player view with this code: `VideoPlayer(player: AVPlayer(url: url))`.
The problem is that the video stops playing whenever a parent-View of the VideoPlayer updates (i.e. re-renders).
Since in SwiftUI I don... | 2021/03/17 | [
"https://Stackoverflow.com/questions/66682896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3826232/"
] | This is in response to our comment thread on the other answer:
```
class PlayerViewModel: ObservableObject {
@Published var avPlayer: AVPlayer?
func loadFromUrl(url: URL) {
avPlayer = AVPlayer(url: url)
}
}
struct CustomPlayerView: View {
var url : URL
@StateObject private var playerVie... | With the solution from @jnpdx, everything works now.
Here is the final solution (full credit to @jnpdx):
```
import SwiftUI
import AVKit
class PlayerViewModel: ObservableObject {
@Published var avPlayer: AVPlayer?
func loadFromUrl(url: URL) {
avPlayer = AVPlayer(url: url)
}
}
struct CustomPlay... |
1,558,825 | I have a project divided into several sub-modules (each of them are `jar` libraries):
```
myapp
myapp-commons
myapp-client
myapp-server
```
I've configured my `pom.xml` in order to create 3 assemblies (`client.zip`, `oracle.tar.gz` and `server.tar.gz`) that are finally stored in the `myapp/target` direct... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1558825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26457/"
] | If I understand correctly, you need to put some javascript code that calls jquery in the middle of your page. But your jquery include is at the bottom of the body. You can do this by calling the jquery at the window.load event. This event fires after all async scripts have loaded and executed. e.g.:
```
<body>
<sc... | Have you tried "@section script"? It will automatic add the codes at the end of the page, thus you can have page specific jQuery scripts.
```
@section scripts {
<script>
jQuery(document).ready(function () {
//put your jQuery codes here
});
</script>
}
``` |
1,558,825 | I have a project divided into several sub-modules (each of them are `jar` libraries):
```
myapp
myapp-commons
myapp-client
myapp-server
```
I've configured my `pom.xml` in order to create 3 assemblies (`client.zip`, `oracle.tar.gz` and `server.tar.gz`) that are finally stored in the `myapp/target` direct... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1558825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26457/"
] | I'm not 100% sure what you're asking, but if it's what I think it is, the answer is that you can't have your cake and eat it too.
It seems that you've moved jQuery to the button of the page but have some elements of the page that you want to use JavaScript on, but don't want to wait for document.ready for all of the?... | Just have a page-specific `$(document).ready()`. |
1,558,825 | I have a project divided into several sub-modules (each of them are `jar` libraries):
```
myapp
myapp-commons
myapp-client
myapp-server
```
I've configured my `pom.xml` in order to create 3 assemblies (`client.zip`, `oracle.tar.gz` and `server.tar.gz`) that are finally stored in the `myapp/target` direct... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1558825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26457/"
] | If I understand correctly, you need to put some javascript code that calls jquery in the middle of your page. But your jquery include is at the bottom of the body. You can do this by calling the jquery at the window.load event. This event fires after all async scripts have loaded and executed. e.g.:
```
<body>
<sc... | Just have a page-specific `$(document).ready()`. |
1,558,825 | I have a project divided into several sub-modules (each of them are `jar` libraries):
```
myapp
myapp-commons
myapp-client
myapp-server
```
I've configured my `pom.xml` in order to create 3 assemblies (`client.zip`, `oracle.tar.gz` and `server.tar.gz`) that are finally stored in the `myapp/target` direct... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1558825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26457/"
] | using `$(document).ready`, it doesn't matter where in the page it is, as it will only execute when the DOM has finished loading. The only code that should go inside `$(document).ready` is code that needs to be set up when the DOM has loaded, e.g. event handlers, any effects/animations that you want to run as soon as th... | Have you tried "@section script"? It will automatic add the codes at the end of the page, thus you can have page specific jQuery scripts.
```
@section scripts {
<script>
jQuery(document).ready(function () {
//put your jQuery codes here
});
</script>
}
``` |
1,558,825 | I have a project divided into several sub-modules (each of them are `jar` libraries):
```
myapp
myapp-commons
myapp-client
myapp-server
```
I've configured my `pom.xml` in order to create 3 assemblies (`client.zip`, `oracle.tar.gz` and `server.tar.gz`) that are finally stored in the `myapp/target` direct... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1558825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26457/"
] | I'm not 100% sure what you're asking, but if it's what I think it is, the answer is that you can't have your cake and eat it too.
It seems that you've moved jQuery to the button of the page but have some elements of the page that you want to use JavaScript on, but don't want to wait for document.ready for all of the?... | Have you tried "@section script"? It will automatic add the codes at the end of the page, thus you can have page specific jQuery scripts.
```
@section scripts {
<script>
jQuery(document).ready(function () {
//put your jQuery codes here
});
</script>
}
``` |
1,558,825 | I have a project divided into several sub-modules (each of them are `jar` libraries):
```
myapp
myapp-commons
myapp-client
myapp-server
```
I've configured my `pom.xml` in order to create 3 assemblies (`client.zip`, `oracle.tar.gz` and `server.tar.gz`) that are finally stored in the `myapp/target` direct... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1558825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26457/"
] | using `$(document).ready`, it doesn't matter where in the page it is, as it will only execute when the DOM has finished loading. The only code that should go inside `$(document).ready` is code that needs to be set up when the DOM has loaded, e.g. event handlers, any effects/animations that you want to run as soon as th... | Just have a page-specific `$(document).ready()`. |
1,558,825 | I have a project divided into several sub-modules (each of them are `jar` libraries):
```
myapp
myapp-commons
myapp-client
myapp-server
```
I've configured my `pom.xml` in order to create 3 assemblies (`client.zip`, `oracle.tar.gz` and `server.tar.gz`) that are finally stored in the `myapp/target` direct... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1558825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26457/"
] | I'm not 100% sure what you're asking, but if it's what I think it is, the answer is that you can't have your cake and eat it too.
It seems that you've moved jQuery to the button of the page but have some elements of the page that you want to use JavaScript on, but don't want to wait for document.ready for all of the?... | As I understand your issue:
1. jQuery is not available on the page before it loads.
2. You use templates and each has it's own js code to run when page loads
3. You want them to run with jQuery.
If I got you right, here is the solution:
1. In `<head>` define global task array:
```
...
<script>
const... |
1,558,825 | I have a project divided into several sub-modules (each of them are `jar` libraries):
```
myapp
myapp-commons
myapp-client
myapp-server
```
I've configured my `pom.xml` in order to create 3 assemblies (`client.zip`, `oracle.tar.gz` and `server.tar.gz`) that are finally stored in the `myapp/target` direct... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1558825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26457/"
] | This allows you to call jQuery plugin methods in the body and load jQuery plugin on to bottom of the page [headjs](http://headjs.com) | Just have a page-specific `$(document).ready()`. |
1,558,825 | I have a project divided into several sub-modules (each of them are `jar` libraries):
```
myapp
myapp-commons
myapp-client
myapp-server
```
I've configured my `pom.xml` in order to create 3 assemblies (`client.zip`, `oracle.tar.gz` and `server.tar.gz`) that are finally stored in the `myapp/target` direct... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1558825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26457/"
] | This allows you to call jQuery plugin methods in the body and load jQuery plugin on to bottom of the page [headjs](http://headjs.com) | As I understand your issue:
1. jQuery is not available on the page before it loads.
2. You use templates and each has it's own js code to run when page loads
3. You want them to run with jQuery.
If I got you right, here is the solution:
1. In `<head>` define global task array:
```
...
<script>
const... |
1,558,825 | I have a project divided into several sub-modules (each of them are `jar` libraries):
```
myapp
myapp-commons
myapp-client
myapp-server
```
I've configured my `pom.xml` in order to create 3 assemblies (`client.zip`, `oracle.tar.gz` and `server.tar.gz`) that are finally stored in the `myapp/target` direct... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1558825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26457/"
] | This allows you to call jQuery plugin methods in the body and load jQuery plugin on to bottom of the page [headjs](http://headjs.com) | Have you tried "@section script"? It will automatic add the codes at the end of the page, thus you can have page specific jQuery scripts.
```
@section scripts {
<script>
jQuery(document).ready(function () {
//put your jQuery codes here
});
</script>
}
``` |
17,614,949 | I have a list of class instances like so:
```
classes = [A(someval), B(someval), C(someval)]
```
I would like to sort this list using a "master" list.
```
master_list = [B, A]
```
This would sort the list with `B` and `A` first if they exist and always in the order specified in `master_list`. The classes are fiel... | 2013/07/12 | [
"https://Stackoverflow.com/questions/17614949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/150033/"
] | You can use the [`index`](http://docs.python.org/2/tutorial/datastructures.html) function of the list class. Here's a simple example:
```
class A: pass
class B: pass
class C: pass
classes = [A(), B(), C()]
master_list = [B, A]
def sorter(instance):
# get the type of the object
c = instance.__class__
# if... | ```
def class_order(master_list):
master_dict = { cls:i for (i, cls) in enumerate(master_list) }
return lambda i: master_dict.get(i.__class__, len(master_list))
# I renamed ‘classes’ to ‘instances’ because it makes more sense.
sorted(instances, key=class_order(master_list))
```
This assumes that only direct ... |
28,643,272 | I have a string in Javascript where I have to escape several characters:
```
<script>
function GenerateCode() {
alert(ctry);
var script = "<script async src=\"//somesite.com/feed/livetrend.js\"></script>";
}
</script>
```
I have tried the following to escape the characters:
```
var script = "<script async... | 2015/02/21 | [
"https://Stackoverflow.com/questions/28643272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4590412/"
] | The issue is that when the browser encounters the closing `</script>` tag inside a open `<script>` tag, regardless of the context in which it is used, it will terminate the script tag there. There are a couple of way to avoid this.
Option 1 - Escape the `/` in the closing `script` tag:
--------------------------------... | In addition to Alexander O'Mara's answer, and especially for cases when the string comes from user-generated content:
Option 4 - move the string to an HTML tag and retrieve it in your script
------------------------------------------------------------------------
```html
<input type=hidden id=escapedString
value=... |
28,643,272 | I have a string in Javascript where I have to escape several characters:
```
<script>
function GenerateCode() {
alert(ctry);
var script = "<script async src=\"//somesite.com/feed/livetrend.js\"></script>";
}
</script>
```
I have tried the following to escape the characters:
```
var script = "<script async... | 2015/02/21 | [
"https://Stackoverflow.com/questions/28643272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4590412/"
] | The issue is that when the browser encounters the closing `</script>` tag inside a open `<script>` tag, regardless of the context in which it is used, it will terminate the script tag there. There are a couple of way to avoid this.
Option 1 - Escape the `/` in the closing `script` tag:
--------------------------------... | I think, the easiest way is to use backtick(`) instead of quotation marks.
For example:
```
var script = `<script async src="//somesite.com/feed/livetrend.js"></script>`;
``` |
28,643,272 | I have a string in Javascript where I have to escape several characters:
```
<script>
function GenerateCode() {
alert(ctry);
var script = "<script async src=\"//somesite.com/feed/livetrend.js\"></script>";
}
</script>
```
I have tried the following to escape the characters:
```
var script = "<script async... | 2015/02/21 | [
"https://Stackoverflow.com/questions/28643272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4590412/"
] | The issue is that when the browser encounters the closing `</script>` tag inside a open `<script>` tag, regardless of the context in which it is used, it will terminate the script tag there. There are a couple of way to avoid this.
Option 1 - Escape the `/` in the closing `script` tag:
--------------------------------... | What happens?
The browser HTML parser will see the `</script>` within the string and it will interpret it as the end of the script element.
A commonly used technique is to use the concatenation operator:
```
const test = '<script>...... </scr'+'ipt>';
```
That fixed my issue. |
28,643,272 | I have a string in Javascript where I have to escape several characters:
```
<script>
function GenerateCode() {
alert(ctry);
var script = "<script async src=\"//somesite.com/feed/livetrend.js\"></script>";
}
</script>
```
I have tried the following to escape the characters:
```
var script = "<script async... | 2015/02/21 | [
"https://Stackoverflow.com/questions/28643272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4590412/"
] | I think, the easiest way is to use backtick(`) instead of quotation marks.
For example:
```
var script = `<script async src="//somesite.com/feed/livetrend.js"></script>`;
``` | In addition to Alexander O'Mara's answer, and especially for cases when the string comes from user-generated content:
Option 4 - move the string to an HTML tag and retrieve it in your script
------------------------------------------------------------------------
```html
<input type=hidden id=escapedString
value=... |
28,643,272 | I have a string in Javascript where I have to escape several characters:
```
<script>
function GenerateCode() {
alert(ctry);
var script = "<script async src=\"//somesite.com/feed/livetrend.js\"></script>";
}
</script>
```
I have tried the following to escape the characters:
```
var script = "<script async... | 2015/02/21 | [
"https://Stackoverflow.com/questions/28643272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4590412/"
] | I think, the easiest way is to use backtick(`) instead of quotation marks.
For example:
```
var script = `<script async src="//somesite.com/feed/livetrend.js"></script>`;
``` | What happens?
The browser HTML parser will see the `</script>` within the string and it will interpret it as the end of the script element.
A commonly used technique is to use the concatenation operator:
```
const test = '<script>...... </scr'+'ipt>';
```
That fixed my issue. |
49,215,157 | I can see numerous posts around this topic but none that specifically solves the problem I have.
I have a string that has text and numbers. I need to split the string into 2 columns when it first sees a number.
**Example**:
```
Ballyvic Boru5/6
First Drift2/1
Sizing Cusimanoin15/2
```
**Becomes:**
[)-1)
```
**Part 2**:
```
=MID(A1,MIN(FIND({1,2,3,4,5,6,7,8,9,0},A1&"1234567890")),99)
```
[:
```
Public Function splitNum1(str As String) As String
Dim p
For p = 1 To Len(str)
If Mid(str, p, 1) Like "#" Then Exit For
Next
splitNum1 = Left(str, p - 1)
End Funct... |
49,215,157 | I can see numerous posts around this topic but none that specifically solves the problem I have.
I have a string that has text and numbers. I need to split the string into 2 columns when it first sees a number.
**Example**:
```
Ballyvic Boru5/6
First Drift2/1
Sizing Cusimanoin15/2
```
**Becomes:**
[)-1)
```
**Part 2**:
```
=MID(A1,MIN(FIND({1,2,3,4,5,6,7,8,9,0},A1&"1234567890")),99)
```
[
>
>
>
```
Option Explicit
Sub splitCells()
Dim RegEx As New RegExp, i As Long, tempStr As String
With RegEx
.Global = True
.Ignore... |
398,844 | I wish to create a bat file to create some basic task. When i run this it closes the window. I'm guessing it errors. How can i stop the bat closing the window so i can view the error.
mybat.bat:
```
echo cd /d d:
echo sencha create jsb -a http://my.local/ext/cutter/app/index.html -p app.jsb3
echo sencha build app.js... | 2012/06/14 | [
"https://serverfault.com/questions/398844",
"https://serverfault.com",
"https://serverfault.com/users/41786/"
] | Batch scripts will close the window itself after running it is not an indication of an error, if you put the word pause at the end of the script the script will stop and wait for you to press a key before proceeding | Two options:
1. send output to a file (`command > c:\output.log`)
2. Set a delay. In [newer versions](http://technet.microsoft.com/en-us/library/cc754891.aspx), it can be done with `timeout \t xxx` where xxx is the amount of seconds. In older versions, you can produce an effective delay with things like
PING 127.0.0.... |
398,844 | I wish to create a bat file to create some basic task. When i run this it closes the window. I'm guessing it errors. How can i stop the bat closing the window so i can view the error.
mybat.bat:
```
echo cd /d d:
echo sencha create jsb -a http://my.local/ext/cutter/app/index.html -p app.jsb3
echo sencha build app.js... | 2012/06/14 | [
"https://serverfault.com/questions/398844",
"https://serverfault.com",
"https://serverfault.com/users/41786/"
] | Batch scripts will close the window itself after running it is not an indication of an error, if you put the word pause at the end of the script the script will stop and wait for you to press a key before proceeding | Run it from the commandline (cmd) and it will show you the output and not close when finished. The reason it is closing is because you are simply echoing (printing) stuff to the terminal. It isn't actually DOING anything. Take out all those echoes.
```
C:\>echo /?
Displays messages, or turns command-echoing on or off.... |
398,844 | I wish to create a bat file to create some basic task. When i run this it closes the window. I'm guessing it errors. How can i stop the bat closing the window so i can view the error.
mybat.bat:
```
echo cd /d d:
echo sencha create jsb -a http://my.local/ext/cutter/app/index.html -p app.jsb3
echo sencha build app.js... | 2012/06/14 | [
"https://serverfault.com/questions/398844",
"https://serverfault.com",
"https://serverfault.com/users/41786/"
] | Batch scripts will close the window itself after running it is not an indication of an error, if you put the word pause at the end of the script the script will stop and wait for you to press a key before proceeding | The answer by Chris is correct. However if it were *actually* an error, the pause would not stop the cmd shell from just exiting. Here's how I troubleshoot this simply without redirecting output (and having to keep opening the output log file):
Run cmd.exe. Then within the command window, run '`cmd<enter>`' a couple m... |
398,844 | I wish to create a bat file to create some basic task. When i run this it closes the window. I'm guessing it errors. How can i stop the bat closing the window so i can view the error.
mybat.bat:
```
echo cd /d d:
echo sencha create jsb -a http://my.local/ext/cutter/app/index.html -p app.jsb3
echo sencha build app.js... | 2012/06/14 | [
"https://serverfault.com/questions/398844",
"https://serverfault.com",
"https://serverfault.com/users/41786/"
] | Two options:
1. send output to a file (`command > c:\output.log`)
2. Set a delay. In [newer versions](http://technet.microsoft.com/en-us/library/cc754891.aspx), it can be done with `timeout \t xxx` where xxx is the amount of seconds. In older versions, you can produce an effective delay with things like
PING 127.0.0.... | Run it from the commandline (cmd) and it will show you the output and not close when finished. The reason it is closing is because you are simply echoing (printing) stuff to the terminal. It isn't actually DOING anything. Take out all those echoes.
```
C:\>echo /?
Displays messages, or turns command-echoing on or off.... |
398,844 | I wish to create a bat file to create some basic task. When i run this it closes the window. I'm guessing it errors. How can i stop the bat closing the window so i can view the error.
mybat.bat:
```
echo cd /d d:
echo sencha create jsb -a http://my.local/ext/cutter/app/index.html -p app.jsb3
echo sencha build app.js... | 2012/06/14 | [
"https://serverfault.com/questions/398844",
"https://serverfault.com",
"https://serverfault.com/users/41786/"
] | The answer by Chris is correct. However if it were *actually* an error, the pause would not stop the cmd shell from just exiting. Here's how I troubleshoot this simply without redirecting output (and having to keep opening the output log file):
Run cmd.exe. Then within the command window, run '`cmd<enter>`' a couple m... | Run it from the commandline (cmd) and it will show you the output and not close when finished. The reason it is closing is because you are simply echoing (printing) stuff to the terminal. It isn't actually DOING anything. Take out all those echoes.
```
C:\>echo /?
Displays messages, or turns command-echoing on or off.... |
39,568,963 | My array is the following:
```
let arr = [
{type: "Benzine", active: false},
{type: "Diesel", active: false},
{type: "Electricity", active: false}
]
```
And I have a function where I want to get value of the property `active` of that array:
```
function isChecked(filterName) {
return arr.filter(f =>... | 2016/09/19 | [
"https://Stackoverflow.com/questions/39568963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3895259/"
] | No, as long as you use `filter`, there's not.
The `[0]` is used to get the first result from that filter.
Since you're just returning the value of `active`, you could use [`Array.prototype.some`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/some), instead:
```js
let arr = [
... | Instead of using `filter`, you can use [`find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) to get the first matching element of an array.
```
function isChecked(filterName) {
var elem = arr.find(f => f.type === filterName);
return elem ? elem.active : false;
}
... |
214,576 | I read somewhere that a lot of the fuel used for Earth-to-Mars trips is burned up in the first few hours -- leaving Earth's gravity well.
Working on the premise that it takes a whole lot of fuel to get out of the gravity well, let's imagine how much fuel and time would be needed to launch from *in* Earth's gravity wel... | 2021/10/01 | [
"https://worldbuilding.stackexchange.com/questions/214576",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/90510/"
] | Traveling to the Moon to refuel (re-tank) is not a good way to get to Mars. At least not at the moment. The details depend on what propellants you plan to use, what infrastructure is in place on the Moon and where you are going to land on the Moon.
If you plan to re-tank with LOX and LH2 (and re-tanking with both thes... | >
> If we built spaceships on the Moon, would we have more fuel to burn for trip to Mars
>
>
>
Yes, you will have save fuel. Gravity is a [conservative field](https://en.wikipedia.org/wiki/Conservative_vector_field) - the energy one spends (or gains) moving between two points is the same no matter the trajectory.
... |
214,576 | I read somewhere that a lot of the fuel used for Earth-to-Mars trips is burned up in the first few hours -- leaving Earth's gravity well.
Working on the premise that it takes a whole lot of fuel to get out of the gravity well, let's imagine how much fuel and time would be needed to launch from *in* Earth's gravity wel... | 2021/10/01 | [
"https://worldbuilding.stackexchange.com/questions/214576",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/90510/"
] | >
> Fuel: I read somewhere that this would take an astronomical amount, which is why, as of how much bang for the buck we currently get, the best thing to do is accelerate of to some sort of cruising speed, coast for a while (many months), and decelerate.
>
>
>
If you insist on going 1G then you would need that as... | >
> If we built spaceships on the Moon, would we have more fuel to burn for trip to Mars
>
>
>
Yes, you will have save fuel. Gravity is a [conservative field](https://en.wikipedia.org/wiki/Conservative_vector_field) - the energy one spends (or gains) moving between two points is the same no matter the trajectory.
... |
214,576 | I read somewhere that a lot of the fuel used for Earth-to-Mars trips is burned up in the first few hours -- leaving Earth's gravity well.
Working on the premise that it takes a whole lot of fuel to get out of the gravity well, let's imagine how much fuel and time would be needed to launch from *in* Earth's gravity wel... | 2021/10/01 | [
"https://worldbuilding.stackexchange.com/questions/214576",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/90510/"
] | There are slightly too many unknowns here for a straightfoward answer, but it can be shown that a continuous thrust transit (also known as a *brachistochrone*) between Earth's orbit and Mars uses up *vastly* more fuel than lifting from Earth's surface would, so the savings as a proportion of the fuel used are low.
>
... | >
> If we built spaceships on the Moon, would we have more fuel to burn for trip to Mars
>
>
>
Yes, you will have save fuel. Gravity is a [conservative field](https://en.wikipedia.org/wiki/Conservative_vector_field) - the energy one spends (or gains) moving between two points is the same no matter the trajectory.
... |
214,576 | I read somewhere that a lot of the fuel used for Earth-to-Mars trips is burned up in the first few hours -- leaving Earth's gravity well.
Working on the premise that it takes a whole lot of fuel to get out of the gravity well, let's imagine how much fuel and time would be needed to launch from *in* Earth's gravity wel... | 2021/10/01 | [
"https://worldbuilding.stackexchange.com/questions/214576",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/90510/"
] | There are slightly too many unknowns here for a straightfoward answer, but it can be shown that a continuous thrust transit (also known as a *brachistochrone*) between Earth's orbit and Mars uses up *vastly* more fuel than lifting from Earth's surface would, so the savings as a proportion of the fuel used are low.
>
... | Traveling to the Moon to refuel (re-tank) is not a good way to get to Mars. At least not at the moment. The details depend on what propellants you plan to use, what infrastructure is in place on the Moon and where you are going to land on the Moon.
If you plan to re-tank with LOX and LH2 (and re-tanking with both thes... |
214,576 | I read somewhere that a lot of the fuel used for Earth-to-Mars trips is burned up in the first few hours -- leaving Earth's gravity well.
Working on the premise that it takes a whole lot of fuel to get out of the gravity well, let's imagine how much fuel and time would be needed to launch from *in* Earth's gravity wel... | 2021/10/01 | [
"https://worldbuilding.stackexchange.com/questions/214576",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/90510/"
] | Traveling to the Moon to refuel (re-tank) is not a good way to get to Mars. At least not at the moment. The details depend on what propellants you plan to use, what infrastructure is in place on the Moon and where you are going to land on the Moon.
If you plan to re-tank with LOX and LH2 (and re-tanking with both thes... | As others point out, such a continuous-thrust trajectory implies capabilities that make it pretty much irrelevant where you start from. You could pretty much just point your ship where you want to go, without any care put into trajectory design and minimal thought toward propellant budgets.
Real spacecraft do high-thr... |
214,576 | I read somewhere that a lot of the fuel used for Earth-to-Mars trips is burned up in the first few hours -- leaving Earth's gravity well.
Working on the premise that it takes a whole lot of fuel to get out of the gravity well, let's imagine how much fuel and time would be needed to launch from *in* Earth's gravity wel... | 2021/10/01 | [
"https://worldbuilding.stackexchange.com/questions/214576",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/90510/"
] | There are slightly too many unknowns here for a straightfoward answer, but it can be shown that a continuous thrust transit (also known as a *brachistochrone*) between Earth's orbit and Mars uses up *vastly* more fuel than lifting from Earth's surface would, so the savings as a proportion of the fuel used are low.
>
... | >
> Fuel: I read somewhere that this would take an astronomical amount, which is why, as of how much bang for the buck we currently get, the best thing to do is accelerate of to some sort of cruising speed, coast for a while (many months), and decelerate.
>
>
>
If you insist on going 1G then you would need that as... |
214,576 | I read somewhere that a lot of the fuel used for Earth-to-Mars trips is burned up in the first few hours -- leaving Earth's gravity well.
Working on the premise that it takes a whole lot of fuel to get out of the gravity well, let's imagine how much fuel and time would be needed to launch from *in* Earth's gravity wel... | 2021/10/01 | [
"https://worldbuilding.stackexchange.com/questions/214576",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/90510/"
] | >
> Fuel: I read somewhere that this would take an astronomical amount, which is why, as of how much bang for the buck we currently get, the best thing to do is accelerate of to some sort of cruising speed, coast for a while (many months), and decelerate.
>
>
>
If you insist on going 1G then you would need that as... | As others point out, such a continuous-thrust trajectory implies capabilities that make it pretty much irrelevant where you start from. You could pretty much just point your ship where you want to go, without any care put into trajectory design and minimal thought toward propellant budgets.
Real spacecraft do high-thr... |
214,576 | I read somewhere that a lot of the fuel used for Earth-to-Mars trips is burned up in the first few hours -- leaving Earth's gravity well.
Working on the premise that it takes a whole lot of fuel to get out of the gravity well, let's imagine how much fuel and time would be needed to launch from *in* Earth's gravity wel... | 2021/10/01 | [
"https://worldbuilding.stackexchange.com/questions/214576",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/90510/"
] | There are slightly too many unknowns here for a straightfoward answer, but it can be shown that a continuous thrust transit (also known as a *brachistochrone*) between Earth's orbit and Mars uses up *vastly* more fuel than lifting from Earth's surface would, so the savings as a proportion of the fuel used are low.
>
... | As others point out, such a continuous-thrust trajectory implies capabilities that make it pretty much irrelevant where you start from. You could pretty much just point your ship where you want to go, without any care put into trajectory design and minimal thought toward propellant budgets.
Real spacecraft do high-thr... |
9,579,990 | I'm trying to compile a python script. On executing the exe I got:-
```
C:\Python27\dist>visualn.exe
Traceback (most recent call last):
File "visualn.py", line 19, in <module>
File "MMTK\__init__.pyc", line 39, in <module>
File "Scientific\Geometry\__init__.pyc", line 30, in <module>
File "Scientific\Geometry\... | 2012/03/06 | [
"https://Stackoverflow.com/questions/9579990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1144004/"
] | Py2exe lets you specify additional Python modules (both .py and .pyd) via the `includes` option:
```
setup(
...
options={"py2exe": {"includes": ["Scientific.win32.Scientific_numerics_package_id"]}}
)
```
EDIT. The above should work if Python is able to
```
import Scientific.win32.Scientific_numerics_packag... | I encountered [similar probelm with py2exe](https://stackoverflow.com/questions/9313152/py2exe-importerror) and the only solution I can find ,is to use another tool to convert python to exe - pyinstaller
Its very easy tool to use and more important , it works!
**UPDATE**
As I understood from your comments below , ... |
9,579,990 | I'm trying to compile a python script. On executing the exe I got:-
```
C:\Python27\dist>visualn.exe
Traceback (most recent call last):
File "visualn.py", line 19, in <module>
File "MMTK\__init__.pyc", line 39, in <module>
File "Scientific\Geometry\__init__.pyc", line 30, in <module>
File "Scientific\Geometry\... | 2012/03/06 | [
"https://Stackoverflow.com/questions/9579990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1144004/"
] | The ImportError is rectified by using "Gil.I" and "Janne Karila" suggestion by setting pythonpath and by using include function. But before this I had to create `__init__.py` file in the win32 folder of both the modules.
BTW I still got another error for the above script - [link](https://stackoverflow.com/questions/964... | I encountered [similar probelm with py2exe](https://stackoverflow.com/questions/9313152/py2exe-importerror) and the only solution I can find ,is to use another tool to convert python to exe - pyinstaller
Its very easy tool to use and more important , it works!
**UPDATE**
As I understood from your comments below , ... |
9,579,990 | I'm trying to compile a python script. On executing the exe I got:-
```
C:\Python27\dist>visualn.exe
Traceback (most recent call last):
File "visualn.py", line 19, in <module>
File "MMTK\__init__.pyc", line 39, in <module>
File "Scientific\Geometry\__init__.pyc", line 30, in <module>
File "Scientific\Geometry\... | 2012/03/06 | [
"https://Stackoverflow.com/questions/9579990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1144004/"
] | Py2exe lets you specify additional Python modules (both .py and .pyd) via the `includes` option:
```
setup(
...
options={"py2exe": {"includes": ["Scientific.win32.Scientific_numerics_package_id"]}}
)
```
EDIT. The above should work if Python is able to
```
import Scientific.win32.Scientific_numerics_packag... | There is a way to work around this types of issues that I have used a number of times. In order to add extra files to the py2exe result you can extend the media collector in order to have a custom version of it. The following code is an example:
```
import glob
from py2exe.build_exe import py2exe as build_exe
def get... |
9,579,990 | I'm trying to compile a python script. On executing the exe I got:-
```
C:\Python27\dist>visualn.exe
Traceback (most recent call last):
File "visualn.py", line 19, in <module>
File "MMTK\__init__.pyc", line 39, in <module>
File "Scientific\Geometry\__init__.pyc", line 30, in <module>
File "Scientific\Geometry\... | 2012/03/06 | [
"https://Stackoverflow.com/questions/9579990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1144004/"
] | The ImportError is rectified by using "Gil.I" and "Janne Karila" suggestion by setting pythonpath and by using include function. But before this I had to create `__init__.py` file in the win32 folder of both the modules.
BTW I still got another error for the above script - [link](https://stackoverflow.com/questions/964... | There is a way to work around this types of issues that I have used a number of times. In order to add extra files to the py2exe result you can extend the media collector in order to have a custom version of it. The following code is an example:
```
import glob
from py2exe.build_exe import py2exe as build_exe
def get... |
57,066,709 | To investigate how C deals with UTF-8 / Unicode characters, I did this little experiment.
It's not that I'm trying to solve anything particular at the moment, but I know that Java deals with the whole encoding situation in a transparent way to the coder and I was wondering how C, that is a lot lower level, treats its... | 2019/07/16 | [
"https://Stackoverflow.com/questions/57066709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130758/"
] | The printing isn't a function of C, but of the display context, whatever that is. For a terminal there are UTF-8 decoding functions which map the raw character data into the character to be shown on screen using a particular font. A similar sort of display logic happens in graphical applications, though with even more ... | `printf("_%c_", str[i]);` prints the character associated with each `str[i]` - one at a time.
The value of `char str[i]` is converted to an `int` when passed ot a `...` function. The `int` value is then converted to `unsigned char` as directed by `"%c"` and "and the resulting character is written".
`char str[] = "Jo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.