qid int64 1 74.6M | question stringlengths 45 24.2k | date stringlengths 10 10 | metadata stringlengths 101 178 | response_j stringlengths 32 23.2k | response_k stringlengths 21 13.2k |
|---|---|---|---|---|---|
142 | >
> [**ΠΕΤΡΟΥ Α΄ 5:5 (SBLGNT)**](http://www.biblegateway.com/passage/?search=1%20peter%205:5&version=SBLGNT)
>
> ὁμοίως, νεώτεροι, ὑποτάγητε **πρεσβυτέροις**. πάντες δὲ ἀλλήλοις τὴν ταπεινοφροσύνην ἐγκομβώσασθε, ὅτι Ὁ θεὸς ὑπερηφάνοις ἀντιτάσσεται ταπεινοῖς δὲ δίδωσιν χάριν.
>
>
> [**1 Peter 5:5 (ESV)**](http:/... | 2011/10/06 | ['https://hermeneutics.stackexchange.com/questions/142', 'https://hermeneutics.stackexchange.com', 'https://hermeneutics.stackexchange.com/users/93/'] | They are the pillars of the early church, not only the *old ones* – although they are from the group of the old and experienced.1 According to verse 2a they shall *"be shepherds of God's flock"*.
The technical use of the word πρεσβύτεροι for the heads of a community was usual for OT-Jewish region and "understandable" ... | Semitic society (Jews, Arabs, etc.) is organized in tribes. One is not "elected" by a "committee". An elder from one family would not in any way rule over another man's family. Each family was represented in public life by the alpha male of their clan. The alpha male was by default the eldest male but if that's not an ... |
62,542,223 | Anyone has a better idea to tackle this problem.
I have this table
```
+------+------+
|Id |Value |
+------+------+
|1 |0 |
+------+------+
|1 |5 |
+------+------+
|2 |0 |
+------+------+
|2 |1 |
+------+------+
|3 |0 |
+------+------+
```
So my goal is to get the distinct... | 2020/06/23 | ['https://Stackoverflow.com/questions/62542223', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4099041/'] | If you are running MySQL 8.0, you can use `row_number()` - but you need an ordering column, otherwise the notion of "first" value is not defined. I assumed `ordering_id`:
```
select id, value
from (
select
t.*,
row_number() over(
partition by id
order by (value = 0), orderi... | This solution work for my need: [How can I select only the first distinct match from a field in MySQL?](https://stackoverflow.com/questions/15010763/how-can-i-select-only-the-first-distinct-match-from-a-field-in-mysql)
Instead of using MIN, I used MAX so it will get the biggest value (In my scenario this is ok since I... |
1,231,716 | I'm wondering if anyone has knowledge of any kind of modplayer library for iphone? I've searched, but couldn't find anything. | 2009/08/05 | ['https://Stackoverflow.com/questions/1231716', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/125386/'] | There's no reason we (the Roo team) cannot make the MavenPathResolver allow custom paths to be used, and one of the intentional reasons I created a PathResolver abstraction was to support customisation of common path locations not only to Maven non-default locations but also to other build systems like Ant+Ivy. all bas... | You can modify Maven to use a different set of conventions. The standard set are inherited from the [Maven super POM](http://maven.apache.org/guides/introduction/introduction-to-the-pom.html) and can be overridden by redefining the relevant property.
For example, to change the sources directory from src/main/java to s... |
1,231,716 | I'm wondering if anyone has knowledge of any kind of modplayer library for iphone? I've searched, but couldn't find anything. | 2009/08/05 | ['https://Stackoverflow.com/questions/1231716', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/125386/'] | You can modify Maven to use a different set of conventions. The standard set are inherited from the [Maven super POM](http://maven.apache.org/guides/introduction/introduction-to-the-pom.html) and can be overridden by redefining the relevant property.
For example, to change the sources directory from src/main/java to s... | As of Roo 1.2 it is not implemented. |
1,231,716 | I'm wondering if anyone has knowledge of any kind of modplayer library for iphone? I've searched, but couldn't find anything. | 2009/08/05 | ['https://Stackoverflow.com/questions/1231716', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/125386/'] | There's no reason we (the Roo team) cannot make the MavenPathResolver allow custom paths to be used, and one of the intentional reasons I created a PathResolver abstraction was to support customisation of common path locations not only to Maven non-default locations but also to other build systems like Ant+Ivy. all bas... | As of Roo 1.2 it is not implemented. |
8,252,731 | In my Java project I need to add versioning control to the files(Like SVN), maintain different versions to the same named files in same folder. Please help me how to do this in java programming.
Eg: in my project,i maintained a folder which have set of images which are uploaded by user.but user can upload same named im... | 2011/11/24 | ['https://Stackoverflow.com/questions/8252731', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/736260/'] | Source control code is not the way to do this. Rename the files to a uuid as they get uploaded and build a map of original filename->uuid filename with timestamps that you can then lookup or expire as needed. | I agree with awm. Version control is not for binary files. However, if you insist to do it like that, SVN has an API that you can use. You can access it directly from your code to commit code, update code, etc.
Here's a place to start: <http://svnkit.com/>
Go checkout out the SVNClientManager under "Subversion Client... |
1,167,669 | For odd integers $n$, can you prove that $10^n+1$ is **not** a perfect square? | 2015/02/27 | ['https://math.stackexchange.com/questions/1167669', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | Lead the equation $10^n = (a-1)(a+1)$ to a contradiction. For instance the prime factor $5$ can appear only in one of those $2$ factors, so we have $5^n \leq a+1$, hence $(a-1)(a+1) \geq 5^n(5^n-2) > 10^n$, contradiction! | >
> In general, let $a\in\mathbb{P}$ (prime numbers) and suppose $a^n+1$ is a perfect square for some $n\in\mathbb{N}\setminus\{1\}.$
>
>
>
Then there is $x\in\mathbb{N}$ such that $x^2=a^n+1$ and therefore $a^n=(x+1)(x-1).$ Then we can write $a^p=x+1$ and $a^q=x-1$ for some integers $p,q\in\mathbb{N}\cup\{0\}$ s... |
1,167,669 | For odd integers $n$, can you prove that $10^n+1$ is **not** a perfect square? | 2015/02/27 | ['https://math.stackexchange.com/questions/1167669', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | Since $10\equiv1\pmod3$, it suffices to note that $1^n+1=2$ is not a quadratic residue modulo $3$. (We don't even need the assumption that $n$ is odd.) | >
> In general, let $a\in\mathbb{P}$ (prime numbers) and suppose $a^n+1$ is a perfect square for some $n\in\mathbb{N}\setminus\{1\}.$
>
>
>
Then there is $x\in\mathbb{N}$ such that $x^2=a^n+1$ and therefore $a^n=(x+1)(x-1).$ Then we can write $a^p=x+1$ and $a^q=x-1$ for some integers $p,q\in\mathbb{N}\cup\{0\}$ s... |
13,853 | I've implemented a sprite batch class that uses a sampler array so that I can select a texture to use based on the gl\_PrimitiveID. The idea was to be able to draw sprites that use different textures in a single draw call. I've managed to get it to compile the shaders and run, but the sampler indexing part does not see... | 2011/06/18 | ['https://gamedev.stackexchange.com/questions/13853', 'https://gamedev.stackexchange.com', 'https://gamedev.stackexchange.com/users/2940/'] | You can use multitexturing to do this - because you can bind a different texture to each texture unit you can then use your uniforms to select which one. The limit is hardware dependent, but usually no less than 8 and very occasionally as small as 4.
<http://www.opengl.org/resources/code/samples/sig99/advanced99/notes... | The MSDN documentation for HLSL seems to think that you can only do this in Direct3D 10. Of course, OpenGL and Direct3D don't always exactly match their functionality, but it's usually pretty close, since the same cards target OpenGL and DirectX.
It could be that it is legal- just not for a target of the version that... |
13,853 | I've implemented a sprite batch class that uses a sampler array so that I can select a texture to use based on the gl\_PrimitiveID. The idea was to be able to draw sprites that use different textures in a single draw call. I've managed to get it to compile the shaders and run, but the sampler indexing part does not see... | 2011/06/18 | ['https://gamedev.stackexchange.com/questions/13853', 'https://gamedev.stackexchange.com', 'https://gamedev.stackexchange.com/users/2940/'] | >
> Am I doing something wrong or is building a texture atlas the only way to draw sprites that use different textures at once?
>
>
>
It is not necessarily the "only" way, but it is the *best* way. It is the way that works on anything, from the lowly Voodoo 1 all the way to the Radeon 6990. It doesn't require shad... | The MSDN documentation for HLSL seems to think that you can only do this in Direct3D 10. Of course, OpenGL and Direct3D don't always exactly match their functionality, but it's usually pretty close, since the same cards target OpenGL and DirectX.
It could be that it is legal- just not for a target of the version that... |
13,853 | I've implemented a sprite batch class that uses a sampler array so that I can select a texture to use based on the gl\_PrimitiveID. The idea was to be able to draw sprites that use different textures in a single draw call. I've managed to get it to compile the shaders and run, but the sampler indexing part does not see... | 2011/06/18 | ['https://gamedev.stackexchange.com/questions/13853', 'https://gamedev.stackexchange.com', 'https://gamedev.stackexchange.com/users/2940/'] | You can use multitexturing to do this - because you can bind a different texture to each texture unit you can then use your uniforms to select which one. The limit is hardware dependent, but usually no less than 8 and very occasionally as small as 4.
<http://www.opengl.org/resources/code/samples/sig99/advanced99/notes... | >
> Am I doing something wrong or is building a texture atlas the only way to draw sprites that use different textures at once?
>
>
>
It is not necessarily the "only" way, but it is the *best* way. It is the way that works on anything, from the lowly Voodoo 1 all the way to the Radeon 6990. It doesn't require shad... |
9,952,128 | First I am using the jQuery colorbox plugin that is working fine so far but then I want to close the colorbox using a button. Unfortunately I can't just trigger the click event on that button by selecting its ID using jQuery, instead of that the button must call a javascript function called closepan() (this behavior is... | 2012/03/31 | ['https://Stackoverflow.com/questions/9952128', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1207999/'] | No matter where you create a variable or function if you create it on `window` it will be available globally.
```
window.closepan = function() {
// hello there
}
``` | ```
function closepan() {
if($.colorbox) {
$.colorbox.close();
}
}
```
However, at the point where someone clicks your button all external scripts should have been loaded so that check shouldn't be necessary... |
9,952,128 | First I am using the jQuery colorbox plugin that is working fine so far but then I want to close the colorbox using a button. Unfortunately I can't just trigger the click event on that button by selecting its ID using jQuery, instead of that the button must call a javascript function called closepan() (this behavior is... | 2012/03/31 | ['https://Stackoverflow.com/questions/9952128', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1207999/'] | No matter where you create a variable or function if you create it on `window` it will be available globally.
```
window.closepan = function() {
// hello there
}
``` | Don't forget to put the keyword `function` in front of your declaration...
```
function closepan() {
$.colorbox.close();
}
```
Working [JSFiddle](http://jsfiddle.net/axZqY/8/) |
4,528,085 | Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button
```
<div id="newpost">
``` | 2010/12/24 | ['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/'] | Since toggling using `style` like:
```js
myElement.style.display = someBoolState ? "block" : "none"
```
is a really bad idea, here are some examples in JS, jQuery, HTML, CSS:
JavaScript [.classList.toggle()](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList)
======================================... | ```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#hideshow').click(function(){
$('#content').toggle('show');
});
});
</script>
```
And the html
```
<div id='content'>Hello World</div>
<input type='button' id='hideshow' value... |
4,528,085 | Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button
```
<div id="newpost">
``` | 2010/12/24 | ['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/'] | **Pure JavaScript:**
```
var button = document.getElementById('button'); // Assumes element with id='button'
button.onclick = function() {
var div = document.getElementById('newpost');
if (div.style.display !== 'none') {
div.style.display = 'none';
}
else {
div.style.display = 'block';... | Here's a plain Javascript way of doing toggle:
```
<script>
var toggle = function() {
var mydiv = document.getElementById('newpost');
if (mydiv.style.display === 'block' || mydiv.style.display === '')
mydiv.style.display = 'none';
else
mydiv.style.display = 'block'
}
</script>
<div id="newpost">asdf... |
4,528,085 | Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button
```
<div id="newpost">
``` | 2010/12/24 | ['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/'] | Try with opacity
```css
div { transition: all 0.4s ease }
.hide { opacity: 0; }
```
```html
<input onclick="newpost.classList.toggle('hide')" type="button" value="toggle">
<div id="newpost">Hello</div>
``` | ```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#hideshow').click(function(){
$('#content').toggle('show');
});
});
</script>
```
And the html
```
<div id='content'>Hello World</div>
<input type='button' id='hideshow' value... |
4,528,085 | Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button
```
<div id="newpost">
``` | 2010/12/24 | ['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/'] | Since toggling using `style` like:
```js
myElement.style.display = someBoolState ? "block" : "none"
```
is a really bad idea, here are some examples in JS, jQuery, HTML, CSS:
JavaScript [.classList.toggle()](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList)
======================================... | Here's a plain Javascript way of doing toggle:
```
<script>
var toggle = function() {
var mydiv = document.getElementById('newpost');
if (mydiv.style.display === 'block' || mydiv.style.display === '')
mydiv.style.display = 'none';
else
mydiv.style.display = 'block'
}
</script>
<div id="newpost">asdf... |
4,528,085 | Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button
```
<div id="newpost">
``` | 2010/12/24 | ['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/'] | Here's a plain Javascript way of doing toggle:
```
<script>
var toggle = function() {
var mydiv = document.getElementById('newpost');
if (mydiv.style.display === 'block' || mydiv.style.display === '')
mydiv.style.display = 'none';
else
mydiv.style.display = 'block'
}
</script>
<div id="newpost">asdf... | You could use the following:
`mydiv.style.display === 'block' = (mydiv.style.display === 'block' ? 'none' : 'block');` |
4,528,085 | Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button
```
<div id="newpost">
``` | 2010/12/24 | ['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/'] | Try with opacity
```css
div { transition: all 0.4s ease }
.hide { opacity: 0; }
```
```html
<input onclick="newpost.classList.toggle('hide')" type="button" value="toggle">
<div id="newpost">Hello</div>
``` | This is how I hide and show content using a class. changing the class to nothing will change the display to block, changing the class to 'a' will show the display as none.
```
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color:#777777;
}
block1{
display:block; background-color:black; color:white; pad... |
4,528,085 | Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button
```
<div id="newpost">
``` | 2010/12/24 | ['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/'] | Look at [jQuery Toggle](http://api.jquery.com/toggle/)
**HTML:**
```
<div id='content'>Hello World</div>
<input type='button' id='hideshow' value='hide/show'>
```
**jQuery:**
```
jQuery(document).ready(function(){
jQuery('#hideshow').live('click', function(event) {
jQuery('#content').toggle('s... | This is how I hide and show content using a class. changing the class to nothing will change the display to block, changing the class to 'a' will show the display as none.
```
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color:#777777;
}
block1{
display:block; background-color:black; color:white; pad... |
4,528,085 | Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button
```
<div id="newpost">
``` | 2010/12/24 | ['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/'] | **Pure JavaScript:**
```
var button = document.getElementById('button'); // Assumes element with id='button'
button.onclick = function() {
var div = document.getElementById('newpost');
if (div.style.display !== 'none') {
div.style.display = 'none';
}
else {
div.style.display = 'block';... | Try with opacity
```css
div { transition: all 0.4s ease }
.hide { opacity: 0; }
```
```html
<input onclick="newpost.classList.toggle('hide')" type="button" value="toggle">
<div id="newpost">Hello</div>
``` |
4,528,085 | Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button
```
<div id="newpost">
``` | 2010/12/24 | ['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/'] | Since toggling using `style` like:
```js
myElement.style.display = someBoolState ? "block" : "none"
```
is a really bad idea, here are some examples in JS, jQuery, HTML, CSS:
JavaScript [.classList.toggle()](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList)
======================================... | This is how I hide and show content using a class. changing the class to nothing will change the display to block, changing the class to 'a' will show the display as none.
```
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color:#777777;
}
block1{
display:block; background-color:black; color:white; pad... |
4,528,085 | Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button
```
<div id="newpost">
``` | 2010/12/24 | ['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/'] | Try with opacity
```css
div { transition: all 0.4s ease }
.hide { opacity: 0; }
```
```html
<input onclick="newpost.classList.toggle('hide')" type="button" value="toggle">
<div id="newpost">Hello</div>
``` | You could use the following:
`mydiv.style.display === 'block' = (mydiv.style.display === 'block' ? 'none' : 'block');` |
30,831,806 | I'm new to mysqli prepare statement and was surprised to find out the || doesn't work as expected in mysqli prepare statement query.
I have a function which check whether the user registered, and its evaluation should be based upon the unique row id and email address.Besides, since the id column and the email column ar... | 2015/06/14 | ['https://Stackoverflow.com/questions/30831806', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3500129/'] | You need to bind two params like this:
```
$stmt->bind_param('si',$iden, $iden);
```
as you have set two '?'.
s means string, i means integer, b is blob and d is double. | The problem is you have specified that in the prepare statement you want to bind two values. But in the bindValue statement you are only binding one value. Also coming to the issue that $iden can be the email or number then I think the best way is to generate conditional statements for them. So if I was you, I will go ... |
436,326 | Let $V$ be an irreducible finite dimensional complex representation of the product of groups $G\times H$. Is it necessarily isomorphic to a tensor product of irreducible representation of $G$ and $H$? If not what is a counter-example, and under what extra assumptions this is known to be true?
Remark. I think for conti... | 2022/12/11 | ['https://mathoverflow.net/questions/436326', 'https://mathoverflow.net', 'https://mathoverflow.net/users/16183/'] | If your groups are finite, then Andy’s [answer](https://mathoverflow.net/a/436339/2383) is perfectly fine. If you want to do topological groups you must be slightly (but not much) more careful. First since we are dealing with finite dimensional representations, algebraic and topological reducibility are the same.
It i... | Most books on the representation theory of finite groups prove this using character theory. This is an efficient way of proving it, but I think it doesn’t give much insight into why it is true (and what other settings it generalizes to). I wrote up a more direct proof [here](https://www3.nd.edu/%7Eandyp/notes/RepOfProd... |
38,838,407 | Let's say we have a dictionary
```
dict = { 'Dollar': 12, 'Half-Coin': 4, 'Quarter': 3, 'Dime': 7 }
```
How would I go about printing the code so it looks like:
>
> Dollar 12, Half-Coin 4, Quarter 3, Dime 7
>
>
> | 2016/08/08 | ['https://Stackoverflow.com/questions/38838407', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5255751/'] | Use `','.join()`, passing in a generator of strings.
```
d = { 'Dollar': 12, 'Half-Coin': 4, 'Quarter': 3, 'Dime': 7 }
print ', '.join('{} {}'.format(k,v) for k,v in d.items())
```
Result:
```
Half-Coin 4, Quarter 3, Dollar 12, Dime 7
```
If you want the results to be in a predictable order, you'll need to sort t... | ```
dict = { 'Dollar': 12, 'Half-Coin': 4, 'Quarter': 3, 'Dime': 7 }
out=""
for i in dict:
out += i+" "+str(dict[i])+", "
print out[:-2]
```
result:
```
Half-Coin 4, Quarter 3, Dollar 12, Dime 7
``` |
38,838,407 | Let's say we have a dictionary
```
dict = { 'Dollar': 12, 'Half-Coin': 4, 'Quarter': 3, 'Dime': 7 }
```
How would I go about printing the code so it looks like:
>
> Dollar 12, Half-Coin 4, Quarter 3, Dime 7
>
>
> | 2016/08/08 | ['https://Stackoverflow.com/questions/38838407', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5255751/'] | Use `','.join()`, passing in a generator of strings.
```
d = { 'Dollar': 12, 'Half-Coin': 4, 'Quarter': 3, 'Dime': 7 }
print ', '.join('{} {}'.format(k,v) for k,v in d.items())
```
Result:
```
Half-Coin 4, Quarter 3, Dollar 12, Dime 7
```
If you want the results to be in a predictable order, you'll need to sort t... | ```
", ".join([x +" "+str(dict[x]) for x in dict.keys()])
``` |
295,247 | I want to plot a polynomial that is parametrized by an additional parameter d. I took samples of the domain of d and stored the coefficients of the polynomial for each of these samples in a table:
```
d a0 a1 a2 a3 a4
0 0.31632 0.038794 -0.637117 0.457322 -0.0940009
0.002 ... | 2016/02/22 | ['https://tex.stackexchange.com/questions/295247', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/28004/'] | Here's a way that uses a `pgfplotsinvokeforeach` approach.
[](https://i.stack.imgur.com/pH66q.png)
There are a few important parts, including:
```
% declare a polynomial function
\pgfmathdeclarefunction{mypoly}{6}{%
% #1: a0
% #2: a1
% #3: a2
% ... | I would probably just use a scripting language and create the LaTeX source code. Here is an example in Python.
```
#!/usr/bin/env python
import csv
with open('data.csv', 'rb') as csvfile:
coeff = csv.reader(csvfile, delimiter=',')
coeff.next()
for row in coeff:
print("\\addplot[mark=none] {" + row[... |
84,358 | As I understand it, copyright applies to creative expression and not for examples rules of games. Does this also apply to the ISO standards ([example, costs CHF 158](https://www.iso.org/standard/30669.html))? For example, could one re-write the standards in one's own words and sell them in competition with ISO? Or is t... | 2022/09/15 | ['https://law.stackexchange.com/questions/84358', 'https://law.stackexchange.com', 'https://law.stackexchange.com/users/41938/'] | Expression vs Idea
------------------
>
> As I understand it, copyright applies to creative expression and not for examples rules of games.
>
>
>
That is not correct as stated. Game rule, or more exactly the fixed expression of a set of game rule (what one finds in the package of a commercial game, or in a book s... | “In your own words” would be fine. Trouble might come from another source. If you make people believe that the contents of your document is equivalent to a standard, but it isn’t, that could be a problem. And of course you need to be careful that your document is not a derivative work. |
725,790 | I can extract all information related with any outlook account from windows registry on windows machine. Like Incoming and outgoing server, username , encrypted password and account type(POP or IMAP). All information which I can collect from windows registry is in hex.
**I want to extract same information for account ... | 2014/03/04 | ['https://superuser.com/questions/725790', 'https://superuser.com', 'https://superuser.com/users/297714/'] | Information about Thunderbird account is stored in plain text file at user profile
```
%appdata%\thunderbird\profiles\%yourprofile%\prefs.js
```
Passwords are stored under `key3.db` and `signons.sqlite` at same location, but those are somewhat encrytped. | Nirsoft's [MailPassView](http://www.nirsoft.net/utils/mailpv.html) will extract account details from most common mail clients, including port numbers. Like all Nirsoft stuff it's a very useful little tool, although many anti-virus applications will detect it as 'Hack Tool' or 'Potentially Unwanted Program', for obvious... |
14,472 | I am confused by all the excitement surrounding the EU cookie directive; why is it such a painful thing?
As far as I can see cookies that are required for your site to function are allowed such as shopping carts and site logins. Am I missing something here?
The original HTTP specification was designed to work in a st... | 2011/05/27 | ['https://webmasters.stackexchange.com/questions/14472', 'https://webmasters.stackexchange.com', 'https://webmasters.stackexchange.com/users/7473/'] | The "excitement" relates to confusion about how the new directive (PDF: [2009/136/EC](http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ%3aL:2009:337:0011:0036%3aEn%3aPDF)) should be interpreted and implemented, and whether or not it's fair to European webmasters:
### Do the laws apply to third party cookies?
T... | It appears to be painful for people who read the headlines and don't know that about those allowed exceptions.
It is also painful if you have cookies for statistical purposes as they aren't allowed without consent:
>
> The exception would not apply, for
> example, just because you have
> decided that your website ... |
14,472 | I am confused by all the excitement surrounding the EU cookie directive; why is it such a painful thing?
As far as I can see cookies that are required for your site to function are allowed such as shopping carts and site logins. Am I missing something here?
The original HTTP specification was designed to work in a st... | 2011/05/27 | ['https://webmasters.stackexchange.com/questions/14472', 'https://webmasters.stackexchange.com', 'https://webmasters.stackexchange.com/users/7473/'] | The "excitement" relates to confusion about how the new directive (PDF: [2009/136/EC](http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ%3aL:2009:337:0011:0036%3aEn%3aPDF)) should be interpreted and implemented, and whether or not it's fair to European webmasters:
### Do the laws apply to third party cookies?
T... | Most complaints I've seen fall outside of the exceptions you've mentioned and more into the realm of marketing/data. Some of the big issues I see are:
1. Standard analytics (Google Analytics and others)
2. Additional testing (A/B testing etc for usability/conversion rate optimization)
3. Affiliate tracking.
4. Re-mark... |
21,041,564 | Is there any way to do the following without either invoking garbage collection or increasing heap size to avoid eventual GC?
```
List<Long> someList = new ArrayList<Long>();
someList.add(1l);
someList = new ArrayList<Long>(); //Will this cause GC of the old `someList`?
```
So what I'm asking is if the original `Arr... | 2014/01/10 | ['https://Stackoverflow.com/questions/21041564', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2763361/'] | Use [ArrayList.clear();](http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html#clear%28%29) instead of creating new ArrayList
```
someList.clear();
``` | The older `ArrayList` will become eligible for garbage collection on line 3, provided there is no other reference pointing to it, as it seems is the case here. However, it isn't guaranteed to be GCed right away.
If you want to avoid extra creation of the `ArrayList`, you can simply clear it by using `List#clear()` met... |
21,041,564 | Is there any way to do the following without either invoking garbage collection or increasing heap size to avoid eventual GC?
```
List<Long> someList = new ArrayList<Long>();
someList.add(1l);
someList = new ArrayList<Long>(); //Will this cause GC of the old `someList`?
```
So what I'm asking is if the original `Arr... | 2014/01/10 | ['https://Stackoverflow.com/questions/21041564', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2763361/'] | The older `ArrayList` will become eligible for garbage collection on line 3, provided there is no other reference pointing to it, as it seems is the case here. However, it isn't guaranteed to be GCed right away.
If you want to avoid extra creation of the `ArrayList`, you can simply clear it by using `List#clear()` met... | I assume by your question you want to keep a reference to the old list (and also its content, otherwise whats the point)?
If so then just add a reference to it before reassigning:
```
List<Long> someList = new ArrayList<Long>();
someList.add(1L);
List<Long> oldList = someList;
someList = new ArrayList<Long>();
``` |
21,041,564 | Is there any way to do the following without either invoking garbage collection or increasing heap size to avoid eventual GC?
```
List<Long> someList = new ArrayList<Long>();
someList.add(1l);
someList = new ArrayList<Long>(); //Will this cause GC of the old `someList`?
```
So what I'm asking is if the original `Arr... | 2014/01/10 | ['https://Stackoverflow.com/questions/21041564', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2763361/'] | Use [ArrayList.clear();](http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html#clear%28%29) instead of creating new ArrayList
```
someList.clear();
``` | I assume by your question you want to keep a reference to the old list (and also its content, otherwise whats the point)?
If so then just add a reference to it before reassigning:
```
List<Long> someList = new ArrayList<Long>();
someList.add(1L);
List<Long> oldList = someList;
someList = new ArrayList<Long>();
``` |
38,645 | Just after 3:23 in [this TED Radio Hour segment](http://www.npr.org/2016/10/21/497837955/what-can-we-learn-from-one-of-the-world-s-most-toxic-accidents), featured guest Holly Morris makes the claim that "the older you are, the less detrimental the effects of radiation is." The context is in why explaining older people ... | 2017/06/10 | ['https://skeptics.stackexchange.com/questions/38645', 'https://skeptics.stackexchange.com', 'https://skeptics.stackexchange.com/users/27319/'] | It seems plausible that such a "pool" did exist at Auschwitz in 1944. It probably served several purposes: A pool for swimming in by hard working prisoners, a fire reservoir tank and possible to fool the West at the same time who took aerial photos of the camp in order to see the living conditions of the prisoners.
> ... | >
> Is it a "fire brigade reservoir", which I assume has something to do with fire safety although I don't know exactly what this means or why they would need it?
>
>
>
A fire brigade reservoir is a [supply of water](http://www.firerescuemagazine.com/articles/print/volume-9/issue-3/firefighting-operations/obtainin... |
38,645 | Just after 3:23 in [this TED Radio Hour segment](http://www.npr.org/2016/10/21/497837955/what-can-we-learn-from-one-of-the-world-s-most-toxic-accidents), featured guest Holly Morris makes the claim that "the older you are, the less detrimental the effects of radiation is." The context is in why explaining older people ... | 2017/06/10 | ['https://skeptics.stackexchange.com/questions/38645', 'https://skeptics.stackexchange.com', 'https://skeptics.stackexchange.com/users/27319/'] | It seems plausible that such a "pool" did exist at Auschwitz in 1944. It probably served several purposes: A pool for swimming in by hard working prisoners, a fire reservoir tank and possible to fool the West at the same time who took aerial photos of the camp in order to see the living conditions of the prisoners.
> ... | According to the [Third Reich in Ruins](http://www.thirdreichruins.com/auschwitz.htm), the below photo of the pool was obtained from [Auschwitz-Birkenau State Museum](http://www.auschwitz.org/). The site says:
>
> This water tank was built as a reservoir for fire fighting purposes (there are several such fire fighti... |
38,645 | Just after 3:23 in [this TED Radio Hour segment](http://www.npr.org/2016/10/21/497837955/what-can-we-learn-from-one-of-the-world-s-most-toxic-accidents), featured guest Holly Morris makes the claim that "the older you are, the less detrimental the effects of radiation is." The context is in why explaining older people ... | 2017/06/10 | ['https://skeptics.stackexchange.com/questions/38645', 'https://skeptics.stackexchange.com', 'https://skeptics.stackexchange.com/users/27319/'] | According to the [Third Reich in Ruins](http://www.thirdreichruins.com/auschwitz.htm), the below photo of the pool was obtained from [Auschwitz-Birkenau State Museum](http://www.auschwitz.org/). The site says:
>
> This water tank was built as a reservoir for fire fighting purposes (there are several such fire fighti... | >
> Is it a "fire brigade reservoir", which I assume has something to do with fire safety although I don't know exactly what this means or why they would need it?
>
>
>
A fire brigade reservoir is a [supply of water](http://www.firerescuemagazine.com/articles/print/volume-9/issue-3/firefighting-operations/obtainin... |
3,702,998 | I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.
1. Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)
2. Failing at a built-in option... | 2010/09/13 | ['https://Stackoverflow.com/questions/3702998', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446605/'] | I tried [android-CalendarView](http://developer.android.com/reference/android/widget/CalendarView.html), Caldroid and later switched to **[android-times-square](https://github.com/square/android-times-square)** which has this improvements:
* Much faster switching to other months due to vertical scrolling (no paginatio... | it is possible but not easy.
<http://jimblackler.net/blog/?p=151&cpage=2#comment-52767>
and
```
private void InsertAppointment(String strTitle, String strDescription, String strEventLocation, long StartDateTime, long EndDateTime, boolean bAllDay, boolean bHasAlarm){
int tAllday;
int tHasAlarm;
if (bAllDay... |
3,702,998 | I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.
1. Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)
2. Failing at a built-in option... | 2010/09/13 | ['https://Stackoverflow.com/questions/3702998', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446605/'] | AFAIK, there are no other way than implement your own calendar. So... what you would have to do is using a `GridLayout` with 7 columns and create a custom `BaseAdapter` to display data correctly. | it is possible but not easy.
<http://jimblackler.net/blog/?p=151&cpage=2#comment-52767>
and
```
private void InsertAppointment(String strTitle, String strDescription, String strEventLocation, long StartDateTime, long EndDateTime, boolean bAllDay, boolean bHasAlarm){
int tAllday;
int tHasAlarm;
if (bAllDay... |
3,702,998 | I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.
1. Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)
2. Failing at a built-in option... | 2010/09/13 | ['https://Stackoverflow.com/questions/3702998', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446605/'] | Android now provides three ways to incorporate calendars in your app.
1. [Calendar view](http://developer.android.com/reference/android/widget/CalendarView.html) for picking dates and such.
2. [Calendar provider](http://developer.android.com/guide/topics/providers/calendar-provider.html) can be accessed to add and rem... | You can use MFCalendarView: <https://github.com/MustafaFerhan/MFCalendarView>
set multiple events;
```
ArrayList<String> eventDays = new ArrayList<String>();
eventDays.add("2014-02-25");
eventDays.add(Util.getCurrentDate());
mf.setEvents(eventDays);
```
and handle with MFCalendarView's listener:
```
mf = (MFCalen... |
3,702,998 | I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.
1. Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)
2. Failing at a built-in option... | 2010/09/13 | ['https://Stackoverflow.com/questions/3702998', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446605/'] | I tried [android-CalendarView](http://developer.android.com/reference/android/widget/CalendarView.html), Caldroid and later switched to **[android-times-square](https://github.com/square/android-times-square)** which has this improvements:
* Much faster switching to other months due to vertical scrolling (no paginatio... | You can use the android calendar picker I have created, it is open source project and you can easily add it to your project.
<https://github.com/sancarbar/Android-Calendar-Picker> |
3,702,998 | I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.
1. Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)
2. Failing at a built-in option... | 2010/09/13 | ['https://Stackoverflow.com/questions/3702998', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446605/'] | AFAIK, there are no other way than implement your own calendar. So... what you would have to do is using a `GridLayout` with 7 columns and create a custom `BaseAdapter` to display data correctly. | You can use the android calendar picker I have created, it is open source project and you can easily add it to your project.
<https://github.com/sancarbar/Android-Calendar-Picker> |
3,702,998 | I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.
1. Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)
2. Failing at a built-in option... | 2010/09/13 | ['https://Stackoverflow.com/questions/3702998', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446605/'] | I wrote Caldroid library (<https://github.com/roomorama/Caldroid>) that is simple to setup and have many features such as setup min/max date, disabled dates, select date range, swipe to change month, fully localized, support rotation properly etc. It's easy to customize the look and feel. Just to share if someone might... | You can use MFCalendarView: <https://github.com/MustafaFerhan/MFCalendarView>
set multiple events;
```
ArrayList<String> eventDays = new ArrayList<String>();
eventDays.add("2014-02-25");
eventDays.add(Util.getCurrentDate());
mf.setEvents(eventDays);
```
and handle with MFCalendarView's listener:
```
mf = (MFCalen... |
3,702,998 | I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.
1. Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)
2. Failing at a built-in option... | 2010/09/13 | ['https://Stackoverflow.com/questions/3702998', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446605/'] | Android now provides three ways to incorporate calendars in your app.
1. [Calendar view](http://developer.android.com/reference/android/widget/CalendarView.html) for picking dates and such.
2. [Calendar provider](http://developer.android.com/guide/topics/providers/calendar-provider.html) can be accessed to add and rem... | You can use the android calendar picker I have created, it is open source project and you can easily add it to your project.
<https://github.com/sancarbar/Android-Calendar-Picker> |
3,702,998 | I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.
1. Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)
2. Failing at a built-in option... | 2010/09/13 | ['https://Stackoverflow.com/questions/3702998', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446605/'] | AFAIK, there are no other way than implement your own calendar. So... what you would have to do is using a `GridLayout` with 7 columns and create a custom `BaseAdapter` to display data correctly. | You can use MFCalendarView: <https://github.com/MustafaFerhan/MFCalendarView>
set multiple events;
```
ArrayList<String> eventDays = new ArrayList<String>();
eventDays.add("2014-02-25");
eventDays.add(Util.getCurrentDate());
mf.setEvents(eventDays);
```
and handle with MFCalendarView's listener:
```
mf = (MFCalen... |
3,702,998 | I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.
1. Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)
2. Failing at a built-in option... | 2010/09/13 | ['https://Stackoverflow.com/questions/3702998', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446605/'] | This library seems really nice and with a more modern UI (Material Design) :
<https://github.com/prolificinteractive/material-calendarview>
You just have to import it with gradle:
```
compile 'com.prolificinteractive:material-calendarview:1.4.0'
```
And add it in your layout:
```
<com.prolificinteractive.material... | You can use MFCalendarView: <https://github.com/MustafaFerhan/MFCalendarView>
set multiple events;
```
ArrayList<String> eventDays = new ArrayList<String>();
eventDays.add("2014-02-25");
eventDays.add(Util.getCurrentDate());
mf.setEvents(eventDays);
```
and handle with MFCalendarView's listener:
```
mf = (MFCalen... |
3,702,998 | I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.
1. Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)
2. Failing at a built-in option... | 2010/09/13 | ['https://Stackoverflow.com/questions/3702998', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446605/'] | I wrote Caldroid library (<https://github.com/roomorama/Caldroid>) that is simple to setup and have many features such as setup min/max date, disabled dates, select date range, swipe to change month, fully localized, support rotation properly etc. It's easy to customize the look and feel. Just to share if someone might... | Android now provides three ways to incorporate calendars in your app.
1. [Calendar view](http://developer.android.com/reference/android/widget/CalendarView.html) for picking dates and such.
2. [Calendar provider](http://developer.android.com/guide/topics/providers/calendar-provider.html) can be accessed to add and rem... |
30,189,605 | I've been playing around with flex box and I would like to center the "Logo" test in the upper left corner vertically in its blue container.
You can see it here: <http://codepen.io/TimRos/pen/MwKNgw>
```
* {
margin: 0;
padding: 0;
}
.box {
color: white;
font-size: 80px;
text-align: center;
tex... | 2015/05/12 | ['https://Stackoverflow.com/questions/30189605', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4400418/'] | This approach uses a public enum and sets the style variable according to the users menu choice:
```
package chess;
//...
public class Screen extends JFrame
implements ActionListener {
private JMenuItem random = new JMenuItem("Random");
private JMenuItem aggressive = new JMenuItem("Aggressive");
p... | You are calling a method and it seems that you want to use something that comes back from that method but the method itself returns nothing, i.e. "void". I changed your Screen class so that the method returns something now.
```
public class Screen extends JFrame
implements ActionListener {
public... |
1,328,078 | In the "Control Panel > Ease of Access Centre > Make the keyboard easier to use" is an option to "Underline keyboard shortcuts and access keys."
Is there a way of programmatically switching this on and off?
I'm using Visual Basic Scripts, but can use .NET. | 2009/08/25 | ['https://Stackoverflow.com/questions/1328078', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1726/'] | 1. Run Registry Editor and go to HKEY\_CURRENT\_USER\Control Panel\Accessibility\Keyboard Preference
2. Now create or modify a String Value (REG\_SZ) called On and set its value to 1
Information is comming from:
<http://www.windowsvalley.com/get-underlined-keyboard-shortcuts-and-access-keys-permanently/> | AFAIK, there's no way to toggle this option programmatically except for automating the approproate GUI actions (opening the Control Panel, switching the option on/off and applying the changes). In this case, I'd recommend using [AutoIt](http://www.autoitscript.com/autoit3/index.shtml) to automate the option switching. |
1,328,078 | In the "Control Panel > Ease of Access Centre > Make the keyboard easier to use" is an option to "Underline keyboard shortcuts and access keys."
Is there a way of programmatically switching this on and off?
I'm using Visual Basic Scripts, but can use .NET. | 2009/08/25 | ['https://Stackoverflow.com/questions/1328078', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1726/'] | AFAIK, there's no way to toggle this option programmatically except for automating the approproate GUI actions (opening the Control Panel, switching the option on/off and applying the changes). In this case, I'd recommend using [AutoIt](http://www.autoitscript.com/autoit3/index.shtml) to automate the option switching. | It turns out you CAN programatically change the “underline keyboard shortcuts” option in your own application. You need to send the WM\_UPDATEUISTATE message to your main form according to the documentation found at: <https://learn.microsoft.com/en-us/windows/win32/menurc/wm-updateuistate>
Since you mentioned Visual B... |
1,328,078 | In the "Control Panel > Ease of Access Centre > Make the keyboard easier to use" is an option to "Underline keyboard shortcuts and access keys."
Is there a way of programmatically switching this on and off?
I'm using Visual Basic Scripts, but can use .NET. | 2009/08/25 | ['https://Stackoverflow.com/questions/1328078', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1726/'] | 1. Run Registry Editor and go to HKEY\_CURRENT\_USER\Control Panel\Accessibility\Keyboard Preference
2. Now create or modify a String Value (REG\_SZ) called On and set its value to 1
Information is comming from:
<http://www.windowsvalley.com/get-underlined-keyboard-shortcuts-and-access-keys-permanently/> | It turns out you CAN programatically change the “underline keyboard shortcuts” option in your own application. You need to send the WM\_UPDATEUISTATE message to your main form according to the documentation found at: <https://learn.microsoft.com/en-us/windows/win32/menurc/wm-updateuistate>
Since you mentioned Visual B... |
11,500 | The problem I'm trying to solve here is very simple but the available data is very limited. That makes it a hard problem to solve.
The available data are as follows:
1. I have 100 patients and I need to rank order them in terms of how healthy they are.
2. I only have 5 measurements for each patient. Each of the five ... | 2011/06/02 | ['https://stats.stackexchange.com/questions/11500', 'https://stats.stackexchange.com', 'https://stats.stackexchange.com/users/333/'] | A simple approach would be to calculate the sum score or the mean. Another approach would not assume that all variables are of equal importance and we could calculate a weighted mean.
Let's assume we have the following 10 patients and variables `v1` to `v5`.
```
> set.seed(1)
> df <- data.frame(v1 = sample(1:5, 10, r... | I would just simply sum them up, weighting each factor if necessary. |
11,500 | The problem I'm trying to solve here is very simple but the available data is very limited. That makes it a hard problem to solve.
The available data are as follows:
1. I have 100 patients and I need to rank order them in terms of how healthy they are.
2. I only have 5 measurements for each patient. Each of the five ... | 2011/06/02 | ['https://stats.stackexchange.com/questions/11500', 'https://stats.stackexchange.com', 'https://stats.stackexchange.com/users/333/'] | *Any* function $f: \mathbb{R}^5 \to \mathbb{R}$ that is separately increasing in each of its arguments will work. For example, you can select positive parameters $\alpha\_i$ and any real parameters $\lambda\_i$ and rank the data $(x\_1, x\_2, x\_3, x\_4, x\_5)$ according to the values of
$$\sum\_{i=1}^{5} \alpha\_i (x... | I would just simply sum them up, weighting each factor if necessary. |
11,500 | The problem I'm trying to solve here is very simple but the available data is very limited. That makes it a hard problem to solve.
The available data are as follows:
1. I have 100 patients and I need to rank order them in terms of how healthy they are.
2. I only have 5 measurements for each patient. Each of the five ... | 2011/06/02 | ['https://stats.stackexchange.com/questions/11500', 'https://stats.stackexchange.com', 'https://stats.stackexchange.com/users/333/'] | I would just simply sum them up, weighting each factor if necessary. | How about generating a synthetic binary target variable first and then running a logistic regression model?
The synthetic variable should be something like... "If the observation is in the top decile on all of the input variable distributions flag it as 1 else 0"
Having generated the binary target variable... Run log... |
11,500 | The problem I'm trying to solve here is very simple but the available data is very limited. That makes it a hard problem to solve.
The available data are as follows:
1. I have 100 patients and I need to rank order them in terms of how healthy they are.
2. I only have 5 measurements for each patient. Each of the five ... | 2011/06/02 | ['https://stats.stackexchange.com/questions/11500', 'https://stats.stackexchange.com', 'https://stats.stackexchange.com/users/333/'] | A simple approach would be to calculate the sum score or the mean. Another approach would not assume that all variables are of equal importance and we could calculate a weighted mean.
Let's assume we have the following 10 patients and variables `v1` to `v5`.
```
> set.seed(1)
> df <- data.frame(v1 = sample(1:5, 10, r... | How about generating a synthetic binary target variable first and then running a logistic regression model?
The synthetic variable should be something like... "If the observation is in the top decile on all of the input variable distributions flag it as 1 else 0"
Having generated the binary target variable... Run log... |
11,500 | The problem I'm trying to solve here is very simple but the available data is very limited. That makes it a hard problem to solve.
The available data are as follows:
1. I have 100 patients and I need to rank order them in terms of how healthy they are.
2. I only have 5 measurements for each patient. Each of the five ... | 2011/06/02 | ['https://stats.stackexchange.com/questions/11500', 'https://stats.stackexchange.com', 'https://stats.stackexchange.com/users/333/'] | *Any* function $f: \mathbb{R}^5 \to \mathbb{R}$ that is separately increasing in each of its arguments will work. For example, you can select positive parameters $\alpha\_i$ and any real parameters $\lambda\_i$ and rank the data $(x\_1, x\_2, x\_3, x\_4, x\_5)$ according to the values of
$$\sum\_{i=1}^{5} \alpha\_i (x... | How about generating a synthetic binary target variable first and then running a logistic regression model?
The synthetic variable should be something like... "If the observation is in the top decile on all of the input variable distributions flag it as 1 else 0"
Having generated the binary target variable... Run log... |
499,446 | My algorithm textbook has a theorem that says
'For every $r > 1$ and every $d > 0$, we have $n^d = O(r^n)$.'
However, it does not provide proof.
Of course I know exponential grows faster than polynomial in most cases, but is it true for all case?
What if the polynomial function is something like $n^{100^{100}}$ an... | 2013/09/20 | ['https://math.stackexchange.com/questions/499446', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/95794/'] | Yes, it is true for all cases. This can be seen by noting that
$$\lim\_{n\to\infty} \frac{n^k}{e^n} = 0$$
for any $k$. This can be seen by an application of L'Hospital's rule a number of times, or by using induction as [here](https://math.stackexchange.com/questions/55468/how-to-prove-that-exponential-grows-faster-th... | Hint: Yes. See Taylor expansion of exponential function. |
499,446 | My algorithm textbook has a theorem that says
'For every $r > 1$ and every $d > 0$, we have $n^d = O(r^n)$.'
However, it does not provide proof.
Of course I know exponential grows faster than polynomial in most cases, but is it true for all case?
What if the polynomial function is something like $n^{100^{100}}$ an... | 2013/09/20 | ['https://math.stackexchange.com/questions/499446', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/95794/'] | Yes, it is true for all cases. This can be seen by noting that
$$\lim\_{n\to\infty} \frac{n^k}{e^n} = 0$$
for any $k$. This can be seen by an application of L'Hospital's rule a number of times, or by using induction as [here](https://math.stackexchange.com/questions/55468/how-to-prove-that-exponential-grows-faster-th... | Let $n = k^2$.
Then $n^c = k^{2c}$ and $2^n = (2^k)^k$.
Clearly $2^k \ge k+1 > k$ so all we need is $k > 2c$.
In general if we want to find $n \in \mathbb{N}$ such that $r^n > n^c$ where $r > 1$, we can do essentially the same:
Let $n = ak^2$ where $a > \log\_r(2)$.
Then $r^n > (2^k)^k$ and $n^c = a^c k^{2c}$.
It... |
499,446 | My algorithm textbook has a theorem that says
'For every $r > 1$ and every $d > 0$, we have $n^d = O(r^n)$.'
However, it does not provide proof.
Of course I know exponential grows faster than polynomial in most cases, but is it true for all case?
What if the polynomial function is something like $n^{100^{100}}$ an... | 2013/09/20 | ['https://math.stackexchange.com/questions/499446', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/95794/'] | Let $n = k^2$.
Then $n^c = k^{2c}$ and $2^n = (2^k)^k$.
Clearly $2^k \ge k+1 > k$ so all we need is $k > 2c$.
In general if we want to find $n \in \mathbb{N}$ such that $r^n > n^c$ where $r > 1$, we can do essentially the same:
Let $n = ak^2$ where $a > \log\_r(2)$.
Then $r^n > (2^k)^k$ and $n^c = a^c k^{2c}$.
It... | Hint: Yes. See Taylor expansion of exponential function. |
17,809,234 | I'm new to Java, in fact I know next to nothing. I've been interested in the type of data an android app is holding on me. So, I can see within an XML file this app has created strings which appear to to be encrypted using AES128-CBC.
So I've decompiled their .apk file and looking through their source I can see a meth... | 2013/07/23 | ['https://Stackoverflow.com/questions/17809234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2359639/'] | I have no experience with Android development at all, I can only comment from the Java side of things.
If you have been able to decompile the program, you should be able to use the code as you like - so, assuming that DecodeMe really does what it's name implies, then yes it should decode the text.
Add the decompiled ... | That is a java method you just mined from the APK.
>
> private void doNothing() {}
>
>
>
Whoa, this is another. You can use it.
Sorry, just some fun. :)
Yes, you can actually use it, but check if it uses some class that is also defined in the application. You have to mine all custom classes, too. |
57,582,787 | I would like to deploy my react app onto my personal website. I currently have it deployed onto to heroku and have that linked on my personal site. But I would like to eliminate heroku from the equation and have everything on my own site. Whenever I try to deploy it, I upload the build files into my file manager public... | 2019/08/20 | ['https://Stackoverflow.com/questions/57582787', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11954181/'] | To deploy your react app into your web site just follow these steps :
1. Build your react app using : **npm run build**
2. Go to the app folder then to the build subfolder and you need to upload all contents to your server into the public\_html folder
I have tested these steps using create-react-app this is the ordin... | It appears you need to change the `homepage` parameter in your configuration file and change few settings with your `router`
See this as I think it can help <https://scottvinkle.me/blogs/work/how-to-deploy-a-react-app-to-a-subdirectory> |
71,229,648 | I have been using Keras/TF's [`CSVLogger`](https://keras.io/api/callbacks/csv_logger/) in order to save the training and validation accuracies. Then I was plotting those data to check the trajectory of training and validation accuracy or loss.
Yesterday, I read [this link](https://www.tutorialspoint.com/deep_learning_... | 2022/02/22 | ['https://Stackoverflow.com/questions/71229648', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/159072/'] | Here are the big key differences between the two:
model.evaluate() gives a different loss on training data from the one in the training process, while CSVLogger tracks metrics on the validation set after every epoch in the process. | Log and plot the results
------------------------
* The `CSVLogger` will save the results **of the training** in a **CSV file**.
* The output of `fit`, normally called `history`, will have the same results ready in a variable, without needing a CSV file.
Their data should be exactly the same.
Evaluate
--------
The ... |
23,314,041 | Actionscript to use Math.random what will this mean Right = 6 + Math.random() \* 2;
I know Math.random is between 0-0.99... but will it come out (6 - 7)? | 2014/04/26 | ['https://Stackoverflow.com/questions/23314041', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3281613/'] | `Math.random()` returns a number greater or equal to 0 and less than 1.0, i.e.
`0 <= Math.random() < 1.0`
If we multiply this with `b` then we get a number greater or equal to 0 and less than b, i.e.
`(0 * b) <= (Math.random() * b) < (1.0 * b)`
or `0 <= (Math.random() * b) < b`
If we add `a` with this then we get... | I prefer to write a function to set the scale and range for you. Like this:
```
public static function getRandomNumber(low:Number=0, high:Number=1):Number
{
return Math.floor(Math.random() * (1+high-low)) + low;
}
```
Now you can call it:
```
getRandomNumber(6, 7); //returns 6-7 inclusive
``` |
7,589,603 | I want to use a view script to render my zend form as it seems to be the best way to
control the layout/design of the form while still using the Zend\_Elements classes.
From the view script, I render the element with `$this->element->getElement('elementName')` .
I'm having problems with the names of the elements. Th... | 2011/09/28 | ['https://Stackoverflow.com/questions/7589603', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/445114/'] | Are you just trying to output your form using `<?php echo $this->form; ?>` from your view script?
That works well for simple forms, but for my more complex forms I tend to render each element individually but don't need to use ViewScript decorator on each individual element to do this. Just try something like this fro... | The solution would be to use the `belongsTo()` form element property.
Example :
```
new Zend_Form_Element_Text('<elementName>', array('belongsTo' => '<subformName>'))
```
In this way, the render() method will use a form element name like
```
name="<subformName>[<elementName>]"
``` |
7,589,603 | I want to use a view script to render my zend form as it seems to be the best way to
control the layout/design of the form while still using the Zend\_Elements classes.
From the view script, I render the element with `$this->element->getElement('elementName')` .
I'm having problems with the names of the elements. Th... | 2011/09/28 | ['https://Stackoverflow.com/questions/7589603', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/445114/'] | Are you just trying to output your form using `<?php echo $this->form; ?>` from your view script?
That works well for simple forms, but for my more complex forms I tend to render each element individually but don't need to use ViewScript decorator on each individual element to do this. Just try something like this fro... | I had the same problem and i solved it with a decorator
1 : Create a generic subform with elements
2 : Using a specific decorator with PrepareElements
3 : Change form to an array with setIsArray(true)
Example :
Form
```
$i = 4;
for($i = 0; $i < $nbReclam ; $i++)
{
$rowForm = new Zend_Form_SubForm($i);
$n... |
7,589,603 | I want to use a view script to render my zend form as it seems to be the best way to
control the layout/design of the form while still using the Zend\_Elements classes.
From the view script, I render the element with `$this->element->getElement('elementName')` .
I'm having problems with the names of the elements. Th... | 2011/09/28 | ['https://Stackoverflow.com/questions/7589603', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/445114/'] | The current solution is to use the PrepareElements decorator on the subforms with one change - remove the recursive call in the PrepareElements code. Also, no "setElementsBelongTo" is required.
This seem to generate the correct names and ids. | The solution would be to use the `belongsTo()` form element property.
Example :
```
new Zend_Form_Element_Text('<elementName>', array('belongsTo' => '<subformName>'))
```
In this way, the render() method will use a form element name like
```
name="<subformName>[<elementName>]"
``` |
7,589,603 | I want to use a view script to render my zend form as it seems to be the best way to
control the layout/design of the form while still using the Zend\_Elements classes.
From the view script, I render the element with `$this->element->getElement('elementName')` .
I'm having problems with the names of the elements. Th... | 2011/09/28 | ['https://Stackoverflow.com/questions/7589603', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/445114/'] | The current solution is to use the PrepareElements decorator on the subforms with one change - remove the recursive call in the PrepareElements code. Also, no "setElementsBelongTo" is required.
This seem to generate the correct names and ids. | I had the same problem and i solved it with a decorator
1 : Create a generic subform with elements
2 : Using a specific decorator with PrepareElements
3 : Change form to an array with setIsArray(true)
Example :
Form
```
$i = 4;
for($i = 0; $i < $nbReclam ; $i++)
{
$rowForm = new Zend_Form_SubForm($i);
$n... |
63,575,174 | Unable to set card footer as expected output
**Expected output:**
[](https://i.stack.imgur.com/Feadm.png)
**My Code:**
```html
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div ... | 2020/08/25 | ['https://Stackoverflow.com/questions/63575174', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7136100/'] | ```css
.card-footer:last-child {
border-radius: 0!important;
}
.card-footer {
padding: 0!important;
background-color: unset!important;
border-top: unset!important;
}
.text-center {
color: #fff;
}
.card-img-overlay {
display: flex;
flex-direction: column;
justify-content: flex-end;
... | ```
<div class="row">
<div class="col-md-3">
<div class="card">
<img class="card-img" src="https://images.unsplash.com/photo-1523805009345-7448845a9e53?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=752&q=80" alt="...">
<div class="card-img-overlay">
<h5 class="card-title"></h5>
<... |
63,575,174 | Unable to set card footer as expected output
**Expected output:**
[](https://i.stack.imgur.com/Feadm.png)
**My Code:**
```html
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div ... | 2020/08/25 | ['https://Stackoverflow.com/questions/63575174', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7136100/'] | ```css
.card-footer:last-child {
border-radius: 0!important;
}
.card-footer {
padding: 0!important;
background-color: unset!important;
border-top: unset!important;
}
.text-center {
color: #fff;
}
.card-img-overlay {
display: flex;
flex-direction: column;
justify-content: flex-end;
... | ```css
.img-wrapper{
position: relative;
text-align: center;
color: white;
}
.card-footer{
position: absolute;
top: 60%;
left: 50%;
transform: translate(-50%, -50%);
}
h3, h1{
color: #fff
}
```
```html
<div class="col-md-3">
<div class="card">
<div class="img-wrapper">
<img src="https://image... |
63,575,174 | Unable to set card footer as expected output
**Expected output:**
[](https://i.stack.imgur.com/Feadm.png)
**My Code:**
```html
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div ... | 2020/08/25 | ['https://Stackoverflow.com/questions/63575174', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7136100/'] | Try this:
```css
.card-footer:last-child {
border-radius: 0!important;
}
.card-footer {
padding: 0!important;
background-color: unset!important;
border-top: unset!important;
}
.text-center {
color: #fff;
}
.card-img-overlay {
display: flex;
flex-direction: column;
justify-content: fl... | ```
<div class="row">
<div class="col-md-3">
<div class="card">
<img class="card-img" src="https://images.unsplash.com/photo-1523805009345-7448845a9e53?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=752&q=80" alt="...">
<div class="card-img-overlay">
<h5 class="card-title"></h5>
<... |
63,575,174 | Unable to set card footer as expected output
**Expected output:**
[](https://i.stack.imgur.com/Feadm.png)
**My Code:**
```html
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div ... | 2020/08/25 | ['https://Stackoverflow.com/questions/63575174', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7136100/'] | Try this:
```css
.card-footer:last-child {
border-radius: 0!important;
}
.card-footer {
padding: 0!important;
background-color: unset!important;
border-top: unset!important;
}
.text-center {
color: #fff;
}
.card-img-overlay {
display: flex;
flex-direction: column;
justify-content: fl... | ```css
.img-wrapper{
position: relative;
text-align: center;
color: white;
}
.card-footer{
position: absolute;
top: 60%;
left: 50%;
transform: translate(-50%, -50%);
}
h3, h1{
color: #fff
}
```
```html
<div class="col-md-3">
<div class="card">
<div class="img-wrapper">
<img src="https://image... |
6,176,627 | I am getting problems when generating a multi-dimensional array with unknown size. How can I fix it? | 2011/05/30 | ['https://Stackoverflow.com/questions/6176627', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/737369/'] | To generate a multi-dimensional array with unknown size is called a jagged array.
For example:
```
String[][] array = new String[5][];
```
Java uses arrays of arrays for multi-dimensional arrays. I think you have to specify the first size. Otherwise, use list of lists.
```
ArrayList<ArrayList<String>> list = new A... | Array is static. ArrayList is dynamic.
Before creating an array you should be aware of the size of the array. To create a multidimensional array without knowing array size is not possible.
Better you have to use a nested `ArrayList` or nested `Vector`:
```
ArrayList<ArrayList<String>> list = new ArrayList<ArrayList<... |
26,172,820 | ```
some text here
<span class="my--class-name--here" id="some--id">some -- text--here</span>
test text--here
<div class="another--class-name">test --test</div>
<!--[if IE 9]><video style="display: none;"><![endif]-->
```
For the above content, I want some help in writing code to replace all occurrence of double das... | 2014/10/03 | ['https://Stackoverflow.com/questions/26172820', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1227325/'] | If you are wanting a one-liner to replace outside of `<` and `>`, you can use the following.
```
$html = preg_replace('~<[^>]*>(*SKIP)(*F)|--~', '—', $html);
```
The idea is to skip any content that is located between an opening and closing bracket character.
On the left side of the alternation operator we match th... | Use a negative lookahead to match `--` which was not inside any html tags.
```
--(?![^><]*>)
```
Replace the matched `--` with `—`.
[DEMO](http://regex101.com/r/lJ1fL0/2)
```
<?php
$string = <<<EOT
some text here
<span class="my--class-name--here" id="some--id">some -- text--here</span>
test text--here
<div class... |
28,595 | ### Introduction
When building an electronics project, a schematic may call for a resistor of an unusual value (say, 510 ohms). You check your parts bin and find that you have no 510-ohm resistors. But you do have many common values above and below this value. By combining resistors in parallel and series, you should ... | 2014/05/25 | ['https://codegolf.stackexchange.com/questions/28595', 'https://codegolf.stackexchange.com', 'https://codegolf.stackexchange.com/users/16615/'] | Javascript (E6) 156 ~~162 164 186~~
===================================
**Last Edit** Assuming all resistor values > 0, you can use them for the loop condition
```
F=(t,s)=>{D=a=>Math.abs(a[1]/t-1);for(i=r=[];a=s[j=i++];r[l]=[a,a])for(;b=s[j--];)l=r.push([a+'+'+b,c=a+b],[a+'|'+b,a*b/c]);return r.sort((a,b)=>D(a)-D(b)... | Perl, 213 199 185 bytes
=======================
**213 bytes:**
```
$t=pop;sub t{abs 1-(split/=/,pop)[1]/$t}sub S{$_[0]+$_[1]}sub P{$_[0]*$_[1]/&S}$"=',';@i=@ARGV;say for sort{t($a)<=>t($b)}grep s!(..\b(\d+)\b,?\b(\d+)?\b\))=\K(??{$2<$3})!$1!ee&&/\d$/,<{S,P}({@i},{@i})= S({@i})=>;
```
**199 bytes:**
```
$t=pop;sub ... |
28,595 | ### Introduction
When building an electronics project, a schematic may call for a resistor of an unusual value (say, 510 ohms). You check your parts bin and find that you have no 510-ohm resistors. But you do have many common values above and below this value. By combining resistors in parallel and series, you should ... | 2014/05/25 | ['https://codegolf.stackexchange.com/questions/28595', 'https://codegolf.stackexchange.com', 'https://codegolf.stackexchange.com/users/16615/'] | Mathematica, ~~151~~ 122 characters
-----------------------------------
Expects the target resistance to be stored in `r` and the list of available resistors in `l`.
```
SortBy[Join[{#,#}&/@l,Join@@(#@@@Union[Sort/@N@l~Tuples~{2}]&/@{{"+",##,#+#2}&,{"|",##,#*#2/(#+#2)}&})],Abs[#[[-1]]/r-1]&]
```
Less golf:
```
Sor... | Javascript (E6) 156 ~~162 164 186~~
===================================
**Last Edit** Assuming all resistor values > 0, you can use them for the loop condition
```
F=(t,s)=>{D=a=>Math.abs(a[1]/t-1);for(i=r=[];a=s[j=i++];r[l]=[a,a])for(;b=s[j--];)l=r.push([a+'+'+b,c=a+b],[a+'|'+b,a*b/c]);return r.sort((a,b)=>D(a)-D(b)... |
28,595 | ### Introduction
When building an electronics project, a schematic may call for a resistor of an unusual value (say, 510 ohms). You check your parts bin and find that you have no 510-ohm resistors. But you do have many common values above and below this value. By combining resistors in parallel and series, you should ... | 2014/05/25 | ['https://codegolf.stackexchange.com/questions/28595', 'https://codegolf.stackexchange.com', 'https://codegolf.stackexchange.com/users/16615/'] | APL (102)
=========
```
{V←{⊃¨⍺{⍺,⍺⍺,⍵,'=',⍺⍵⍵⍵}⍺⍺/¨Z/⍨≤/¨Z←,∘.,⍨⍵}⋄K[⍋|¯1+⍺÷⍨0 4↓K←↑('|'{÷+/÷⍺⍵}V⍵),('+'+V⍵),{⍵,' =',⍵}¨⍵;]}
```
This takes the target resistance as the left argument and a list of available resistors as the right argument.
Explanation:
* `V←{`...`}`: `V` is a function that:
+ `Z/⍨≤/¨Z←,∘.,⍨⍵`: ... | Perl, 213 199 185 bytes
=======================
**213 bytes:**
```
$t=pop;sub t{abs 1-(split/=/,pop)[1]/$t}sub S{$_[0]+$_[1]}sub P{$_[0]*$_[1]/&S}$"=',';@i=@ARGV;say for sort{t($a)<=>t($b)}grep s!(..\b(\d+)\b,?\b(\d+)?\b\))=\K(??{$2<$3})!$1!ee&&/\d$/,<{S,P}({@i},{@i})= S({@i})=>;
```
**199 bytes:**
```
$t=pop;sub ... |
28,595 | ### Introduction
When building an electronics project, a schematic may call for a resistor of an unusual value (say, 510 ohms). You check your parts bin and find that you have no 510-ohm resistors. But you do have many common values above and below this value. By combining resistors in parallel and series, you should ... | 2014/05/25 | ['https://codegolf.stackexchange.com/questions/28595', 'https://codegolf.stackexchange.com', 'https://codegolf.stackexchange.com/users/16615/'] | APL (102)
=========
```
{V←{⊃¨⍺{⍺,⍺⍺,⍵,'=',⍺⍵⍵⍵}⍺⍺/¨Z/⍨≤/¨Z←,∘.,⍨⍵}⋄K[⍋|¯1+⍺÷⍨0 4↓K←↑('|'{÷+/÷⍺⍵}V⍵),('+'+V⍵),{⍵,' =',⍵}¨⍵;]}
```
This takes the target resistance as the left argument and a list of available resistors as the right argument.
Explanation:
* `V←{`...`}`: `V` is a function that:
+ `Z/⍨≤/¨Z←,∘.,⍨⍵`: ... | Ruby 2.1, ~~156~~ 154 bytes
===========================
```
s=->(a,z){c={};a.map{|e|a.map{|f|c[e]=e;c[e+f]="#{e}+#{f}";c[1/(1.0/f+1.0/e)]="#{e}|#{f}"}};c.sort_by{|k,|(k/z.to_f-1).abs}.map{|e|puts"#{e[1]}=#{e[0]}"}}
```
Ungolfed:
---------
```
s =->(a,z) {
c={}
a.map{|e|
a.map{|f|
c[e]=e
c[e+f]="... |
28,595 | ### Introduction
When building an electronics project, a schematic may call for a resistor of an unusual value (say, 510 ohms). You check your parts bin and find that you have no 510-ohm resistors. But you do have many common values above and below this value. By combining resistors in parallel and series, you should ... | 2014/05/25 | ['https://codegolf.stackexchange.com/questions/28595', 'https://codegolf.stackexchange.com', 'https://codegolf.stackexchange.com/users/16615/'] | Python 3 - ~~250~~ ~~247~~ 270 bytes
====================================
```
from itertools import*
import sys
r=sys.argv[1:]
t=int(r.pop())
p=set(map(tuple,map(sorted,product(r,r))))
a=[('+'.join(b),sum(map(int,b)))for b in p]+[('|'.join(b),1/sum(map(lambda n:1/int(n),b)))for b in p]
for s in sorted(a,key=lambda b:a... | Perl, 213 199 185 bytes
=======================
**213 bytes:**
```
$t=pop;sub t{abs 1-(split/=/,pop)[1]/$t}sub S{$_[0]+$_[1]}sub P{$_[0]*$_[1]/&S}$"=',';@i=@ARGV;say for sort{t($a)<=>t($b)}grep s!(..\b(\d+)\b,?\b(\d+)?\b\))=\K(??{$2<$3})!$1!ee&&/\d$/,<{S,P}({@i},{@i})= S({@i})=>;
```
**199 bytes:**
```
$t=pop;sub ... |
28,595 | ### Introduction
When building an electronics project, a schematic may call for a resistor of an unusual value (say, 510 ohms). You check your parts bin and find that you have no 510-ohm resistors. But you do have many common values above and below this value. By combining resistors in parallel and series, you should ... | 2014/05/25 | ['https://codegolf.stackexchange.com/questions/28595', 'https://codegolf.stackexchange.com', 'https://codegolf.stackexchange.com/users/16615/'] | Julia - ~~179~~ 163 bytes
=========================
```
f(t,s)=(\ =repmat;m=endof(s);A=A[v=(A=s\m).>=(B=sort(A))];B=B[v];F=[s,C=A+B,A.*B./C];n=sum(v);print([[s P=[" "]\m P;A [+]\n B;A [|]\n B] F][sortperm(abs(F-t)),:]))
```
This works the same as the old version, but the argument in the print statement has been orga... | Perl, 213 199 185 bytes
=======================
**213 bytes:**
```
$t=pop;sub t{abs 1-(split/=/,pop)[1]/$t}sub S{$_[0]+$_[1]}sub P{$_[0]*$_[1]/&S}$"=',';@i=@ARGV;say for sort{t($a)<=>t($b)}grep s!(..\b(\d+)\b,?\b(\d+)?\b\))=\K(??{$2<$3})!$1!ee&&/\d$/,<{S,P}({@i},{@i})= S({@i})=>;
```
**199 bytes:**
```
$t=pop;sub ... |
28,595 | ### Introduction
When building an electronics project, a schematic may call for a resistor of an unusual value (say, 510 ohms). You check your parts bin and find that you have no 510-ohm resistors. But you do have many common values above and below this value. By combining resistors in parallel and series, you should ... | 2014/05/25 | ['https://codegolf.stackexchange.com/questions/28595', 'https://codegolf.stackexchange.com', 'https://codegolf.stackexchange.com/users/16615/'] | Javascript (E6) 156 ~~162 164 186~~
===================================
**Last Edit** Assuming all resistor values > 0, you can use them for the loop condition
```
F=(t,s)=>{D=a=>Math.abs(a[1]/t-1);for(i=r=[];a=s[j=i++];r[l]=[a,a])for(;b=s[j--];)l=r.push([a+'+'+b,c=a+b],[a+'|'+b,a*b/c]);return r.sort((a,b)=>D(a)-D(b)... | Javascript, 248 bytes
=====================
```js
function r(T,L){R=[],O="";for(i in L){R.push([a=L[i],a]);for(j=i;j<L.length;)b=L[j++],s=a+b,R.push([a+"+"+b,s],[a+"|"+b,a*b/s])}R.sort(function(a,b){A=Math.abs;return A(a[1]/T-1)-A(b[1]/T-1)});for(i in R)q=R[i],O+=q[0]+"="+q[1]+"\n";console.log(O)}
```
Usage : `r(510... |
28,595 | ### Introduction
When building an electronics project, a schematic may call for a resistor of an unusual value (say, 510 ohms). You check your parts bin and find that you have no 510-ohm resistors. But you do have many common values above and below this value. By combining resistors in parallel and series, you should ... | 2014/05/25 | ['https://codegolf.stackexchange.com/questions/28595', 'https://codegolf.stackexchange.com', 'https://codegolf.stackexchange.com/users/16615/'] | APL (102)
=========
```
{V←{⊃¨⍺{⍺,⍺⍺,⍵,'=',⍺⍵⍵⍵}⍺⍺/¨Z/⍨≤/¨Z←,∘.,⍨⍵}⋄K[⍋|¯1+⍺÷⍨0 4↓K←↑('|'{÷+/÷⍺⍵}V⍵),('+'+V⍵),{⍵,' =',⍵}¨⍵;]}
```
This takes the target resistance as the left argument and a list of available resistors as the right argument.
Explanation:
* `V←{`...`}`: `V` is a function that:
+ `Z/⍨≤/¨Z←,∘.,⍨⍵`: ... | Julia - ~~179~~ 163 bytes
=========================
```
f(t,s)=(\ =repmat;m=endof(s);A=A[v=(A=s\m).>=(B=sort(A))];B=B[v];F=[s,C=A+B,A.*B./C];n=sum(v);print([[s P=[" "]\m P;A [+]\n B;A [|]\n B] F][sortperm(abs(F-t)),:]))
```
This works the same as the old version, but the argument in the print statement has been orga... |
28,595 | ### Introduction
When building an electronics project, a schematic may call for a resistor of an unusual value (say, 510 ohms). You check your parts bin and find that you have no 510-ohm resistors. But you do have many common values above and below this value. By combining resistors in parallel and series, you should ... | 2014/05/25 | ['https://codegolf.stackexchange.com/questions/28595', 'https://codegolf.stackexchange.com', 'https://codegolf.stackexchange.com/users/16615/'] | APL (102)
=========
```
{V←{⊃¨⍺{⍺,⍺⍺,⍵,'=',⍺⍵⍵⍵}⍺⍺/¨Z/⍨≤/¨Z←,∘.,⍨⍵}⋄K[⍋|¯1+⍺÷⍨0 4↓K←↑('|'{÷+/÷⍺⍵}V⍵),('+'+V⍵),{⍵,' =',⍵}¨⍵;]}
```
This takes the target resistance as the left argument and a list of available resistors as the right argument.
Explanation:
* `V←{`...`}`: `V` is a function that:
+ `Z/⍨≤/¨Z←,∘.,⍨⍵`: ... | Python 3 - ~~250~~ ~~247~~ 270 bytes
====================================
```
from itertools import*
import sys
r=sys.argv[1:]
t=int(r.pop())
p=set(map(tuple,map(sorted,product(r,r))))
a=[('+'.join(b),sum(map(int,b)))for b in p]+[('|'.join(b),1/sum(map(lambda n:1/int(n),b)))for b in p]
for s in sorted(a,key=lambda b:a... |
28,595 | ### Introduction
When building an electronics project, a schematic may call for a resistor of an unusual value (say, 510 ohms). You check your parts bin and find that you have no 510-ohm resistors. But you do have many common values above and below this value. By combining resistors in parallel and series, you should ... | 2014/05/25 | ['https://codegolf.stackexchange.com/questions/28595', 'https://codegolf.stackexchange.com', 'https://codegolf.stackexchange.com/users/16615/'] | J - 86 71 70 char
=================
```
((]/:[|@<:@%~2{::"1])(;a:,<)"0,[:,/(<,.+`|,.+/;+&.%/)"1@;@((<@,.{:)\))
```
I'm not going to bother to explain every little detail because a lot of the code is spent syncing up the results of different functions, but here's the gist of the golf:
* `;@((<@,.{:)\)` makes every p... | Python 3 - ~~250~~ ~~247~~ 270 bytes
====================================
```
from itertools import*
import sys
r=sys.argv[1:]
t=int(r.pop())
p=set(map(tuple,map(sorted,product(r,r))))
a=[('+'.join(b),sum(map(int,b)))for b in p]+[('|'.join(b),1/sum(map(lambda n:1/int(n),b)))for b in p]
for s in sorted(a,key=lambda b:a... |
58,913 | I have just bought a brand new MacBook Pro with 4 GB RAM, and was wondering which Windows 7 version 32 bit or 64 bit I should install with BootCamp, in order to do Visual Studio development?
Is Visual Studio 32 bit? Any pointers to the correct install process would also be appreciated. | 2009/10/22 | ['https://superuser.com/questions/58913', 'https://superuser.com', 'https://superuser.com/users/-1/'] | No brainer: 64bit.
In addition to the ability to use more RAM and run 64bit apps, 64bit chips have other features the OS itself can use to get performance benefits that a 32bit OS won't know about. More registers, for example.
So even if 32bit Visual Studio is the only app you run, you're still better off running 64b... | Visual Studio is a 32 bit application only, so if that is the major reason for installing windows, 64-bit will not give you any additional features, other than it will be able to handle all 4 GB of memory, whereas 32-bit will only give 3.2 GB or so.
See this question for details about general 32-bit vs 64 bit systems:... |
58,913 | I have just bought a brand new MacBook Pro with 4 GB RAM, and was wondering which Windows 7 version 32 bit or 64 bit I should install with BootCamp, in order to do Visual Studio development?
Is Visual Studio 32 bit? Any pointers to the correct install process would also be appreciated. | 2009/10/22 | ['https://superuser.com/questions/58913', 'https://superuser.com', 'https://superuser.com/users/-1/'] | While Visual Studio is 32 bit application, depending on what type of applications you're planning to develop, you might find it beneficial to use the 64-bit version. IIRC you can run and debug both 32-bit and 64-bit executables in 64-bit Windows but not in 32-bit Windows (as the latter isn't able to run 64-bit apps). | Visual Studio is a 32 bit application only, so if that is the major reason for installing windows, 64-bit will not give you any additional features, other than it will be able to handle all 4 GB of memory, whereas 32-bit will only give 3.2 GB or so.
See this question for details about general 32-bit vs 64 bit systems:... |
58,913 | I have just bought a brand new MacBook Pro with 4 GB RAM, and was wondering which Windows 7 version 32 bit or 64 bit I should install with BootCamp, in order to do Visual Studio development?
Is Visual Studio 32 bit? Any pointers to the correct install process would also be appreciated. | 2009/10/22 | ['https://superuser.com/questions/58913', 'https://superuser.com', 'https://superuser.com/users/-1/'] | No brainer: 64bit.
In addition to the ability to use more RAM and run 64bit apps, 64bit chips have other features the OS itself can use to get performance benefits that a 32bit OS won't know about. More registers, for example.
So even if 32bit Visual Studio is the only app you run, you're still better off running 64b... | While Visual Studio is 32 bit application, depending on what type of applications you're planning to develop, you might find it beneficial to use the 64-bit version. IIRC you can run and debug both 32-bit and 64-bit executables in 64-bit Windows but not in 32-bit Windows (as the latter isn't able to run 64-bit apps). |
6,284,893 | I am using [SDAC](http://www.devart.com/sdac/) components to query a SQL Server 2008 database. It has a `recordcount`property as all datasets do and it also has the `FetchAll` property (which I think it is called `packedrecords` on `clientdatasets`). Said that, I got a few questions:
1 - If I set `FetchAll = True` the... | 2011/06/08 | ['https://Stackoverflow.com/questions/6284893', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/528211/'] | This code:
```
StreamReader sourceStream = new StreamReader(filePath +"\\"+ fileName);
byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
```
You're reading the bytestream as text with a specific encoding (UTF8)... but GIF and ZIP are binary files, not text files. The encoding is mangling them.
... | You are reading binary data to string (assuming it utf8) and converts it back to bytes array. That's completely wrong. |
50,744,257 | I have a data frame that such as below.
```
df <- data.frame(mnth = c("jan", "feb", "feb", "mar", "mar",
"mar", "apr", "apr", "apr", "apr",
"may", "may", "may", "may", "may"),
n = c(1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5),
val... | 2018/06/07 | ['https://Stackoverflow.com/questions/50744257', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5323536/'] | Use a regular expression that matches the specified string followed by anything, and the `-o` option to `grep` so it only returns the part of the line that matched:
```
grep -o 'how.*' file.txt
``` | You could use sed for this
```
$ cat file.txt
Hello, how are you?
$ sed -r "s/^.+(how.+)$/\1/" file.txt
how are you?
$
```
this used sed regex to anchor the text you want to start with - in this case, the word "how" and terminate when it finds the end of the line. |
74,401,695 | I want use Firebase Auth in Flutter project. And I am use `provider`. Everything is okey but I am facing one issue with `provider`.
My IconButtonWidget:
```
class SocialIconButton extends StatelessWidget {
final String socialIcon;
const SocialIconButton({Key? key, required this.socialIcon})
: super(key: key... | 2022/11/11 | ['https://Stackoverflow.com/questions/74401695', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/20477196/'] | You're not using the username and the password you provided in your docker-compose file. Try this and then enter `my_password`:
```bash
docker exec -it container_id psql -U my_user -d my_db --password
```
Check [the official documentation](https://docs.postgresql.fr/15/app-psql.html) to find out about the PostgreSQL... | I would also like to add, in your compose file you're not exposing any ports for the db container. So it will be unreachable via external sources (you, your app or anything that isn't ran within that container). |
74,401,695 | I want use Firebase Auth in Flutter project. And I am use `provider`. Everything is okey but I am facing one issue with `provider`.
My IconButtonWidget:
```
class SocialIconButton extends StatelessWidget {
final String socialIcon;
const SocialIconButton({Key? key, required this.socialIcon})
: super(key: key... | 2022/11/11 | ['https://Stackoverflow.com/questions/74401695', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/20477196/'] | You're not using the username and the password you provided in your docker-compose file. Try this and then enter `my_password`:
```bash
docker exec -it container_id psql -U my_user -d my_db --password
```
Check [the official documentation](https://docs.postgresql.fr/15/app-psql.html) to find out about the PostgreSQL... | I think you need to add `environment` to project container.
```
environment:
- DB_HOST=db
- DB_NAME=my_db
- DB_USER=youruser
- DB_PASS=yourpass
depends_on:
- db
```
add this before `depends_on`
And now see if it solves |
74,401,695 | I want use Firebase Auth in Flutter project. And I am use `provider`. Everything is okey but I am facing one issue with `provider`.
My IconButtonWidget:
```
class SocialIconButton extends StatelessWidget {
final String socialIcon;
const SocialIconButton({Key? key, required this.socialIcon})
: super(key: key... | 2022/11/11 | ['https://Stackoverflow.com/questions/74401695', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/20477196/'] | You're not using the username and the password you provided in your docker-compose file. Try this and then enter `my_password`:
```bash
docker exec -it container_id psql -U my_user -d my_db --password
```
Check [the official documentation](https://docs.postgresql.fr/15/app-psql.html) to find out about the PostgreSQL... | You should add ports to the docker-compose for the postgres image,as this would allow postgres to be accessible outside the container
```
- ports:
"5432:5432"
```
You can checkout more here [docker-compose for postgres](https://geshan.com.np/blog/2021/12/docker-postgres/) |
10,262,114 | I need to script my app (not a game) and I have a problem, choosing a script lang for this.
Lua looks fine (actually, it is ideal for my task), but it has problems with unicode strings, which will be used.
Also, I thought about Python, but I don't like It's syntax, and it's Dll is too big for me ( about 2.5 Mib).
Pytho... | 2012/04/21 | ['https://Stackoverflow.com/questions/10262114', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/684275/'] | Lua strings are encoding-agnostic. So, yes, you can write unicode strings in Lua scripts. If you need pattern matching, then the standard Lua string library does not support unicode classes. But plain substring search works. | Have a look at JavaScript - the [V8 engine](https://developers.google.com/v8/embed) is pretty powerful and JavaScript does not come with a big stdlib. Besides that, you can easily embed it and from what I know it handles unicode fine. |
10,262,114 | I need to script my app (not a game) and I have a problem, choosing a script lang for this.
Lua looks fine (actually, it is ideal for my task), but it has problems with unicode strings, which will be used.
Also, I thought about Python, but I don't like It's syntax, and it's Dll is too big for me ( about 2.5 Mib).
Pytho... | 2012/04/21 | ['https://Stackoverflow.com/questions/10262114', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/684275/'] | Have a look at JavaScript - the [V8 engine](https://developers.google.com/v8/embed) is pretty powerful and JavaScript does not come with a big stdlib. Besides that, you can easily embed it and from what I know it handles unicode fine. | Have a look at [`Io`](http://www.iolanguage.com).
It's [unicode](http://www.iolanguage.com/scm/io/docs/IoGuide.html#Unicode) all the way down and [embeddable](http://www.iolanguage.com/scm/io/docs/IoGuide.html#Embedding). Also it seems to provide some [C++ binding library](https://stackoverflow.com/a/3153987/12195). |
10,262,114 | I need to script my app (not a game) and I have a problem, choosing a script lang for this.
Lua looks fine (actually, it is ideal for my task), but it has problems with unicode strings, which will be used.
Also, I thought about Python, but I don't like It's syntax, and it's Dll is too big for me ( about 2.5 Mib).
Pytho... | 2012/04/21 | ['https://Stackoverflow.com/questions/10262114', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/684275/'] | There isn't really such a thing as a "unicode string". Strings are a sequence of bytes that can contain anything. Knowing the encoding of the data in the string matters, though.
I use Lua with [UTF-8 strings](http://en.wikipedia.org/wiki/UTF-8), which just works for all the operations I care about. I do not use any Un... | Have a look at JavaScript - the [V8 engine](https://developers.google.com/v8/embed) is pretty powerful and JavaScript does not come with a big stdlib. Besides that, you can easily embed it and from what I know it handles unicode fine. |
10,262,114 | I need to script my app (not a game) and I have a problem, choosing a script lang for this.
Lua looks fine (actually, it is ideal for my task), but it has problems with unicode strings, which will be used.
Also, I thought about Python, but I don't like It's syntax, and it's Dll is too big for me ( about 2.5 Mib).
Pytho... | 2012/04/21 | ['https://Stackoverflow.com/questions/10262114', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/684275/'] | Have a look at JavaScript - the [V8 engine](https://developers.google.com/v8/embed) is pretty powerful and JavaScript does not come with a big stdlib. Besides that, you can easily embed it and from what I know it handles unicode fine. | Take look at [Jim Tcl](http://jim.tcl.tk). It's small, easily embeddable and extendable, supports UTF-8 strings, and it's pretty powerful |
10,262,114 | I need to script my app (not a game) and I have a problem, choosing a script lang for this.
Lua looks fine (actually, it is ideal for my task), but it has problems with unicode strings, which will be used.
Also, I thought about Python, but I don't like It's syntax, and it's Dll is too big for me ( about 2.5 Mib).
Pytho... | 2012/04/21 | ['https://Stackoverflow.com/questions/10262114', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/684275/'] | Lua strings are encoding-agnostic. So, yes, you can write unicode strings in Lua scripts. If you need pattern matching, then the standard Lua string library does not support unicode classes. But plain substring search works. | Have a look at [`Io`](http://www.iolanguage.com).
It's [unicode](http://www.iolanguage.com/scm/io/docs/IoGuide.html#Unicode) all the way down and [embeddable](http://www.iolanguage.com/scm/io/docs/IoGuide.html#Embedding). Also it seems to provide some [C++ binding library](https://stackoverflow.com/a/3153987/12195). |
10,262,114 | I need to script my app (not a game) and I have a problem, choosing a script lang for this.
Lua looks fine (actually, it is ideal for my task), but it has problems with unicode strings, which will be used.
Also, I thought about Python, but I don't like It's syntax, and it's Dll is too big for me ( about 2.5 Mib).
Pytho... | 2012/04/21 | ['https://Stackoverflow.com/questions/10262114', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/684275/'] | There isn't really such a thing as a "unicode string". Strings are a sequence of bytes that can contain anything. Knowing the encoding of the data in the string matters, though.
I use Lua with [UTF-8 strings](http://en.wikipedia.org/wiki/UTF-8), which just works for all the operations I care about. I do not use any Un... | Lua strings are encoding-agnostic. So, yes, you can write unicode strings in Lua scripts. If you need pattern matching, then the standard Lua string library does not support unicode classes. But plain substring search works. |
10,262,114 | I need to script my app (not a game) and I have a problem, choosing a script lang for this.
Lua looks fine (actually, it is ideal for my task), but it has problems with unicode strings, which will be used.
Also, I thought about Python, but I don't like It's syntax, and it's Dll is too big for me ( about 2.5 Mib).
Pytho... | 2012/04/21 | ['https://Stackoverflow.com/questions/10262114', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/684275/'] | Lua strings are encoding-agnostic. So, yes, you can write unicode strings in Lua scripts. If you need pattern matching, then the standard Lua string library does not support unicode classes. But plain substring search works. | Take look at [Jim Tcl](http://jim.tcl.tk). It's small, easily embeddable and extendable, supports UTF-8 strings, and it's pretty powerful |
3,926,936 | I have a directory of 9 images:
```
image_0001, image_0002, image_0003
image_0010, image_0011
image_0011-1, image_0011-2, image_0011-3
image_9999
```
I would like to be able to list them in an efficient way, like this (4 entries for 9 images):
```
(image_000[1-3], image_00[10-11], image_0011-[1-3], image_9999)
`... | 2010/10/13 | ['https://Stackoverflow.com/questions/3926936', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/178686/'] | Here is a working implementation of what you want to achieve, using the code you added as a starting point:
```
#!/usr/bin/env python
import itertools
import re
# This algorithm only works if DATA is sorted.
DATA = ["image_0001", "image_0002", "image_0003",
"image_0010", "image_0011",
"image_0011-1",... | ```
def ranges(sorted_list):
first = None
for x in sorted_list:
if first is None:
first = last = x
elif x == increment(last):
last = x
else:
yield first, last
first = last = x
if first is not None:
yield first, last
```
The `i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.