qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
55,663,896 | I don't want to directly import security\_access\_key in my application due to security reason.
I tried accessing environment variable like below
step 1:
added security\_access\_key to .env file
```
security_access_key=abc123
```
step 2:
access it in App.js
```
console.log(process.env.security_access_key)
```... | 2019/04/13 | [
"https://Stackoverflow.com/questions/55663896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7750342/"
] | The CMakeError.log or CMakeOutput.log files will contain more information about this error.
(You can look for vcvars64.bat)
For me, it said "The input line is too long" and "The syntax of the command is incorrect" in these files. In my case it was caused by the PATH environment variable being too long. The errors were... | I had the same problem.
In my case, it was because of incorrect autoexec in my command line. So I cleaned up corresponding entry in my registry (HKLM\Software\Microsoft\Command Processor\AutoRun) and everything started working.
If that does not help, I recommend to create new account on your PC and test it there. If ... |
18,673,142 | The ultimate objective is to replace all instances of ^NULL^ with ^^. For this question, to increase readability, I'll try to replace ^NULL^ with ^fred^. Here is my test data.
```
/usr/redbrick_dir $ cat temp
a^NULL^b^c^
e^NULL^NULL^f^
g^h^i^NULL^
```
This is what I expect to work.
```
/usr/redbrick_dir $ cat temp ... | 2013/09/07 | [
"https://Stackoverflow.com/questions/18673142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1832636/"
] | You have a very simple logic error. You call `:configureDataStore` with one parameter, but inside the routine you reference `%servers%` (a constant) when you should be using `%1` (the parameter)
Actually, you should use `%~1` if you want to remove the enclosing quotes.
Instead of using `goto :eos`, you should use `go... | Your problem is in this line, if I understand what you are trying to do (which is mightily over-engineered)
```
set servers = %%b
```
Remove the spaces like so, as you were creating a variable "%servers %" with the space.
```
set servers=%%b
``` |
27,646,302 | I am working on [this demo](http://www.bootply.com/tkYK17Alqi). I am trying to find out why the HTML disappears after using the second button.
As long as you only click on btn `#from-content-1` or only on `#from-content-2` every thing is fine but if you click on `#from-content-1` and then on `#from-content-2` and back... | 2014/12/25 | [
"https://Stackoverflow.com/questions/27646302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2426488/"
] | You need use [event delegation](https://stackoverflow.com/questions/8110934/direct-vs-delegated-jquery-on), because you add events, before element has been appended to page
```
$("#bodyContainer").on('mouseover', '.tagLines', function(){
$(this).css("background-color","#ffffff").css("box-shadow", "0 0 4px 4px #C9... | There isn't .tagLine element in DOM when bind events to it.
The code like this,
```
var PGHome = Backbone.View.extend({
tagName: 'div',
events:{
'mouseover .tagLines': function(){
// ...
},
'mouseleave .tagLines': function(){
// ...
},
'click .tagLines': function(){
//... |
351,657 | I main as Kayle often, so my mastery score displays as about 850k and rising.
All the rest of the people (except for once in a while it seems) have 10k and less.
This is giving my lane opposition insight into how much I play as Kayle on top lane, so the more observant ones play safer than most would.
Is there a way ... | 2019/05/22 | [
"https://gaming.stackexchange.com/questions/351657",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/46587/"
] | Although there is no official answer from any Riot employee, multiple discussion threads and my own research have hinted that it is **not possible to hide or reset Mastery Points at the moment**.
Sources:
* [Boards post 1](https://boards.na.leagueoflegends.com/en/c/player-behavior-moderation/jrUavvvh-hide-champion-ma... | Create a new account, but no seriously I don't think there is a way to hide your mastery score. I wanted to do it for my main account because like you, I used to main a champ (fiddle supp) to the point where people just wouldn't do anything but cs against me. Not that I was a high rank but people just got turned off by... |
72,797,526 | I´m creating a multiScene app for iOS in Swift Storyboard.
I want to add a UINavigationController programmatically in UIViewController or if there is possible with storyboard, I have made a lot a research for this and I haven´t find anything valuable.
[In each view controller I want to add the Navigation Controller](h... | 2022/06/29 | [
"https://Stackoverflow.com/questions/72797526",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10348489/"
] | `git format-patch` is well suited to extract a linear history of commits, but not for merges :
* the documentation states it explicitly (from [`git help format-patch`](https://git-scm.com/docs/git-format-patch), emphasis mine):
>
> DESCRIPTION
>
> Prepare each **non-merge commit** with its "patch" ...
>
>
> [..... | >
>
> ```
> git merge anotherbranch
>
> ```
>
>
I would rather *rebase* the branch on top of the target branch (on top of main), before making a patch between that new branch HEAD and main (instead of `HEAD~2`)
```bash
git switch anotherbranch
git rebase main
git format-patch -o patches main
``` |
72,797,526 | I´m creating a multiScene app for iOS in Swift Storyboard.
I want to add a UINavigationController programmatically in UIViewController or if there is possible with storyboard, I have made a lot a research for this and I haven´t find anything valuable.
[In each view controller I want to add the Navigation Controller](h... | 2022/06/29 | [
"https://Stackoverflow.com/questions/72797526",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10348489/"
] | I found a way to do this in the way I wanted.
```bash
git remote add otherrepo ../otherrepo
git fetch otherrepo
# If you want to fetch lfs objects as well
git lfs fetch --all otherrepo
# -X subtree: Or you will get a lot of merge-conflicts, some of them with empty lines.
# --signoff: To add signoff on the merge-comm... | >
>
> ```
> git merge anotherbranch
>
> ```
>
>
I would rather *rebase* the branch on top of the target branch (on top of main), before making a patch between that new branch HEAD and main (instead of `HEAD~2`)
```bash
git switch anotherbranch
git rebase main
git format-patch -o patches main
``` |
72,797,526 | I´m creating a multiScene app for iOS in Swift Storyboard.
I want to add a UINavigationController programmatically in UIViewController or if there is possible with storyboard, I have made a lot a research for this and I haven´t find anything valuable.
[In each view controller I want to add the Navigation Controller](h... | 2022/06/29 | [
"https://Stackoverflow.com/questions/72797526",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10348489/"
] | I found a way to do this in the way I wanted.
```bash
git remote add otherrepo ../otherrepo
git fetch otherrepo
# If you want to fetch lfs objects as well
git lfs fetch --all otherrepo
# -X subtree: Or you will get a lot of merge-conflicts, some of them with empty lines.
# --signoff: To add signoff on the merge-comm... | `git format-patch` is well suited to extract a linear history of commits, but not for merges :
* the documentation states it explicitly (from [`git help format-patch`](https://git-scm.com/docs/git-format-patch), emphasis mine):
>
> DESCRIPTION
>
> Prepare each **non-merge commit** with its "patch" ...
>
>
> [..... |
45,299,625 | I am trying to update my database via new android room library, but it is not working. Here it is my approach
```
@IgnoreExtraProperties
@Entity(tableName = CarModel.TABLE_NAME,
indices = {@Index(value = "car_name", unique = true)})
public class CarModel {
public static final String TABLE_NAME = "cars";
... | 2017/07/25 | [
"https://Stackoverflow.com/questions/45299625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1597841/"
] | Make sure the row you want to updated and model you are sending to update should have same id which you have defined as primary key. | I am sorry for posting this as an answer but I am not allowed to add a simple comment yet so here is my idea:
Have you tried using only `insertCars()` instead of `updateCars()`?
Anyway it looks like your `isCarsEmpty()` LiveData callback gets triggered the whole time because when the observer is called the Database is... |
45,299,625 | I am trying to update my database via new android room library, but it is not working. Here it is my approach
```
@IgnoreExtraProperties
@Entity(tableName = CarModel.TABLE_NAME,
indices = {@Index(value = "car_name", unique = true)})
public class CarModel {
public static final String TABLE_NAME = "cars";
... | 2017/07/25 | [
"https://Stackoverflow.com/questions/45299625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1597841/"
] | I am sorry for posting this as an answer but I am not allowed to add a simple comment yet so here is my idea:
Have you tried using only `insertCars()` instead of `updateCars()`?
Anyway it looks like your `isCarsEmpty()` LiveData callback gets triggered the whole time because when the observer is called the Database is... | The update means you fetch a `CarModel` which is already in the database and after updating this `CarModel` you return the new values to the Database, except the Id you return the same Id
what to do
you need for example a global variable of type `CarModel` and implement set functions in the `CarModel`
In MainActi... |
45,299,625 | I am trying to update my database via new android room library, but it is not working. Here it is my approach
```
@IgnoreExtraProperties
@Entity(tableName = CarModel.TABLE_NAME,
indices = {@Index(value = "car_name", unique = true)})
public class CarModel {
public static final String TABLE_NAME = "cars";
... | 2017/07/25 | [
"https://Stackoverflow.com/questions/45299625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1597841/"
] | Make sure the row you want to updated and model you are sending to update should have same id which you have defined as primary key. | The update means you fetch a `CarModel` which is already in the database and after updating this `CarModel` you return the new values to the Database, except the Id you return the same Id
what to do
you need for example a global variable of type `CarModel` and implement set functions in the `CarModel`
In MainActi... |
35,186,966 | so I am not even sure where to begin on this ... basically my friend wants me to set up a shoutcast audio stream but we need to be able to control what plays and when through http get or post requests. Does anyone know where to begin on setting this up? | 2016/02/03 | [
"https://Stackoverflow.com/questions/35186966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3788161/"
] | The best tool for this job is currently [Liquidsoap](http://savonet.sourceforge.net/).
It's a scripting language and framework for controlling your audio. You can add HTTP endpoints to do whatever you script it to do.
A few cautions:
* Some functionality is notoriously unstable. Test thoroughly, and for long periods... | Liquidsoap is the way to go, but as stated above, it's cumbersome to install. An alternative is to use the **sc\_trans** player, a native command line audio player for shoutcast.
Although sc\_trans is a little bit deprecated, it does the job. Don't know why it's not supported anymore by shoutcast or winamp, but the fo... |
42,131 | I was wondering if it is okay to work in different lab during summer.
I am first year master's student and currently I am working in the lab as volunteer at my college. During summer (May through August), because of housing/financial reasons, I have to go back home which is in different state. Despite wasting my summe... | 2015/03/22 | [
"https://academia.stackexchange.com/questions/42131",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/32078/"
] | **Ask your advisor.**
Whether it is *okay* or not will depend entirely on him. He may have some reason why he wouldn't want you to (rational or not). It shouldn't come across as rude if you ask him openly and express your reasoning (have to go back home but would still like to be research productive and may be a good ... | **It depends on funding.**
If your advisor at your master's program is providing you with a year-round stipend, then you should secure permission in advance, [as suggested by Austin Henley](https://academia.stackexchange.com/a/42132/53).
On the other hand, if you are in fact volunteering in the laboratory as part of ... |
23,125,711 | I am trying to implement multiple for loop in batch like:
```
for x=1:10
for y=x+1:10
//my code
end
end
```
My code is:
```
@echo off
for /l %%x in (1,1,10) do (
for /l %%y in (%%y+1,1,10) do (
//my code
)
)
```
However, it doesn't work. Can anyone help me? Thanks. | 2014/04/17 | [
"https://Stackoverflow.com/questions/23125711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1742664/"
] | I'm reposting a solution but in a simpler script.
```
@echo off
setlocal enableDelayedExpansion
for /l %%x in (1,1,10) do (
set /a inner=%%x+1
for /l %%y in (!inner!,1,10) do (
echo %%x, %%y
)
)
endlocal
pause
``` | ```
@echo off
setlocal enableDelayedExpansion
for /l %%x in (1;,;1step;,;10#=101) do (
set /a inner=%%x+1
@@echo ###%%x is from outer loop###
for /l %%y in (,,,!inner!==1@==10times,9) do (
@@echo -----%%y is from inner loop
)
)
endlocal
```
**Simplified**
```
@echo off
setlocal enableDelayedExpansion
for ... |
23,125,711 | I am trying to implement multiple for loop in batch like:
```
for x=1:10
for y=x+1:10
//my code
end
end
```
My code is:
```
@echo off
for /l %%x in (1,1,10) do (
for /l %%y in (%%y+1,1,10) do (
//my code
)
)
```
However, it doesn't work. Can anyone help me? Thanks. | 2014/04/17 | [
"https://Stackoverflow.com/questions/23125711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1742664/"
] | I'm reposting a solution but in a simpler script.
```
@echo off
setlocal enableDelayedExpansion
for /l %%x in (1,1,10) do (
set /a inner=%%x+1
for /l %%y in (!inner!,1,10) do (
echo %%x, %%y
)
)
endlocal
pause
``` | ```
@echo off
for /l %%x in (1,1,10) do (
echo #LOOP [1] ITERATION [%%x]
for /l %%y in (1,1,10) do (
echo ##LOOP [2] ITERATION [%%y]
)
echo.
)
``` |
29,553,596 | Here's my insert query:
```
INSERT INTO listing_replica_child (
(
SELECT rtz_comma_list(column_name)
FROM information_schema.columns
WHERE table_name = 'listing'
)
)
VALUES (
(
SELECT (
(
SELECT rtz_comma_list(column_name)
F... | 2015/04/10 | [
"https://Stackoverflow.com/questions/29553596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2507319/"
] | I guess you use `print()` (which first converts its argument to a string before sending it to stdout) or `sys.stdout` (which only accepts str objects).
To write directly on stdout, you can use `sys.stdout.buffer`, a file-like object that supports bytes objects:
```
import sys
import gzip
s = 'foo'*100
sys.stdout.bu... | Thanks for the answers Valentin and Phillip!
I managed to solve the issue, both of you contributed to the final answer. Turns out it was a combination of things.
Here's the final code that works:
```
response = json.JSONEncoder().encode(loadData)
sys.stdout.write('Content-type: application/octet-stream\n')
... |
3,064,292 | In the android developer's webpage there's an example on how to show an alert dialog when the user taps on an item in the map.
What I want to do is show the default bubble the maps App shows when you tap on a POI.
Is there a way to do this? Am I missing something here? | 2010/06/17 | [
"https://Stackoverflow.com/questions/3064292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/190330/"
] | You could [`.filter()`](http://api.jquery.com/filter) your result set based on the index of the result:
```
$("#table tr").filter(function(idx) {
return (idx % 6) >= 3
}).addClass('alt');
```
[jsfiddle demo](http://www.jsfiddle.net/V7aw9/) | Jquery each function should do it:
<http://api.jquery.com/jQuery.each/>
```
$('#mytable > tr').each(function(index, ctr) {
var id = Math.floor(index / 3) % 2;
if(id == 0) {
// CHANGE TO COLOR 1
} else {
// CHANGE TO COLOR 2
}
});
```
The trick is the integer division by 3 [the Math.flo... |
3,064,292 | In the android developer's webpage there's an example on how to show an alert dialog when the user taps on an item in the map.
What I want to do is show the default bubble the maps App shows when you tap on a POI.
Is there a way to do this? Am I missing something here? | 2010/06/17 | [
"https://Stackoverflow.com/questions/3064292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/190330/"
] | Jquery each function should do it:
<http://api.jquery.com/jQuery.each/>
```
$('#mytable > tr').each(function(index, ctr) {
var id = Math.floor(index / 3) % 2;
if(id == 0) {
// CHANGE TO COLOR 1
} else {
// CHANGE TO COLOR 2
}
});
```
The trick is the integer division by 3 [the Math.flo... | With possibly a slow selector performance, you could also do this:
```
$(":nth-child(6n), :nth-child(6n-1), :nth-child(6n-2)", $("#test"))
.addClass("alt");
```
And you could even do this entirely with CSS3 (using the `nth-child` selector), provided that your target browsers all support CSS3 (not yet). |
3,064,292 | In the android developer's webpage there's an example on how to show an alert dialog when the user taps on an item in the map.
What I want to do is show the default bubble the maps App shows when you tap on a POI.
Is there a way to do this? Am I missing something here? | 2010/06/17 | [
"https://Stackoverflow.com/questions/3064292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/190330/"
] | Jquery each function should do it:
<http://api.jquery.com/jQuery.each/>
```
$('#mytable > tr').each(function(index, ctr) {
var id = Math.floor(index / 3) % 2;
if(id == 0) {
// CHANGE TO COLOR 1
} else {
// CHANGE TO COLOR 2
}
});
```
The trick is the integer division by 3 [the Math.flo... | If you generated multiple `<tbody>` elements in your code, you could do it very efficiently like this:
<http://jsfiddle.net/jLJMu/>
HTML
```
<table id='mytable'>
<tbody>
<tr><td>content</td></tr>
<tr><td>content</td></tr>
<tr><td>content</td></tr>
</tbody>
<tbody>
<tr><td>... |
3,064,292 | In the android developer's webpage there's an example on how to show an alert dialog when the user taps on an item in the map.
What I want to do is show the default bubble the maps App shows when you tap on a POI.
Is there a way to do this? Am I missing something here? | 2010/06/17 | [
"https://Stackoverflow.com/questions/3064292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/190330/"
] | You could [`.filter()`](http://api.jquery.com/filter) your result set based on the index of the result:
```
$("#table tr").filter(function(idx) {
return (idx % 6) >= 3
}).addClass('alt');
```
[jsfiddle demo](http://www.jsfiddle.net/V7aw9/) | With possibly a slow selector performance, you could also do this:
```
$(":nth-child(6n), :nth-child(6n-1), :nth-child(6n-2)", $("#test"))
.addClass("alt");
```
And you could even do this entirely with CSS3 (using the `nth-child` selector), provided that your target browsers all support CSS3 (not yet). |
3,064,292 | In the android developer's webpage there's an example on how to show an alert dialog when the user taps on an item in the map.
What I want to do is show the default bubble the maps App shows when you tap on a POI.
Is there a way to do this? Am I missing something here? | 2010/06/17 | [
"https://Stackoverflow.com/questions/3064292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/190330/"
] | You could [`.filter()`](http://api.jquery.com/filter) your result set based on the index of the result:
```
$("#table tr").filter(function(idx) {
return (idx % 6) >= 3
}).addClass('alt');
```
[jsfiddle demo](http://www.jsfiddle.net/V7aw9/) | If you generated multiple `<tbody>` elements in your code, you could do it very efficiently like this:
<http://jsfiddle.net/jLJMu/>
HTML
```
<table id='mytable'>
<tbody>
<tr><td>content</td></tr>
<tr><td>content</td></tr>
<tr><td>content</td></tr>
</tbody>
<tbody>
<tr><td>... |
50,945,040 | I am using
```
gsub(".*_","",ldf[[j]]),1,nchar(gsub(".*_","",ldf[[j]]))-4)
```
to create a path and filename to write to. It works fine for names in `lfd` that only have one underscore. Having a filename with another underscore further back, it cuts everything off that is in front of the second underscore.
I have... | 2018/06/20 | [
"https://Stackoverflow.com/questions/50945040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5453092/"
] | It seems you want
```
sub("^[^_]*_([^_]*).*", "\\1", ldf[[j]])
```
See the [regex demo](https://regex101.com/r/aDNw9G/2)
The pattern matches
* `^` - start of string
* `[^_]*` - 0+ chars other than `_`
* `_` - an underascxore
* `([^_]*)` - Capturing group #1: any 0+ chars other than `_`
* `.*` - the rest of the str... | Regular expression repetition is greedy by default, as explained in `?regex`:
>
> By default repetition is greedy, so the maximal possible number of
> repeats is used. This can be changed to ‘minimal’ by appending ? to
> the quantifier. (There are further quantifiers that allow approximate
> matching: see the TRE ... |
23,207,147 | Azure websites have a default "site URL" provided by Azure, something like mysite.azurewebsites.net. Is it possible to get this URL from inside the website itself (i.e. from the ASP.NET application)?
There are several properties in the Environment and HttpRuntime class that contain the name of the website (e.g. "mysit... | 2014/04/21 | [
"https://Stackoverflow.com/questions/23207147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/220230/"
] | **Edit (2/4/16):** You can get the `URL` from the appSetting/EnvironmentVariable `websiteUrl`. This will also give you the custom hostname if you have one setup.
There are few of ways you can do that.
1. From the `HOSTNAME` header
------------------------------
This is valid **only** if the request is hitting the s... | Also, you can use `Environment.GetEnvironmentVariable("WEBSITE_HOSTNAME")`.
This will return full URL (`"http://{your-site-name}.azurewebsites.net"`), no string manipulations required.
To see a full list of properties available in environment variables just type `Get-ChildItem Env:` in SCM PowerShell debug console. |
29,695,829 | I know that you can get variables and call functions both by using the name directly
```
variable.functionName
```
or using the name as a string
```
variable["functionName"] or variable[functionNameString]
```
Now my question is:
Is there any resulting difference in these different ways or are they completely int... | 2015/04/17 | [
"https://Stackoverflow.com/questions/29695829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1187314/"
] | The PUC-Rio Lua 5.1 byte code for
```
print(variable.functionName)
print(variable["functionName"])
print(variable[functionNameString])
```
is
```
main <var.lua:0,0> (14 instructions, 56 bytes at 0xafe530)
0+ params, 3 slots, 0 upvalues, 0 locals, 4 constants, 0 functions
1 [1] GETGLOBAL 0 -1 ; print
... | They are the same. From [the manual](http://www.lua.org/manual/5.3/manual.html#2.1):
>
> ... To represent records, Lua uses the field name as an index. The language supports this representation by providing `a.name` as syntactic sugar for `a["name"]`.
>
>
> |
36,216,442 | Here's my code:
```
import java.util.Scanner;
public class TaylorSeries{
public static int factorial(int num){
if(num == 0) return 1;
return num * factorial(num -1);
}
public static void main(String args[]){
Scanner scanner=new Scanner(System.in);
System.out.println("Enter the number:");
int n... | 2016/03/25 | [
"https://Stackoverflow.com/questions/36216442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5043280/"
] | `Circle.Red(...)` sets `this` (`@`) to `Circle`; so `new @` = `new Circle`.
`obj(...)` does not set `this`, so `new @` is invoking `new` on something else (depending on the context).
You can fix this by binding: `obj = Circle.Red.bind(Circle)` | When invoked as `obj()`, there's no context to the call; meaning `this` inside the function is *not* `Circle`, but rather likely `window`. You need to bind the context to preserve it:
```
obj = Circle.Red.bind Circle
``` |
5,877 | I was working on a model today and I need to make the black surface into a normal surface so that the ship's cockpit is solid. I am unable to select the black surface. I tried using the flip normals feature, but I was still unable to select it. Any advice on how to make it into a solid is greatly appreciated. Thanks. :... | 2018/04/26 | [
"https://3dprinting.stackexchange.com/questions/5877",
"https://3dprinting.stackexchange.com",
"https://3dprinting.stackexchange.com/users/6883/"
] | The foundation of any 3D printer is the controller and the firmware. Many devices are based on Arduino type controllers, with stepper motor driver boards either integrated or added as a plug-in component.
Some manufacturers will use in-house or outside resources and develop their own boards and firmware.
You can sear... | this is an extension to fred\_dot\_u answer.
As I am in the process of building my own printer, I decided to use RAMPS Arduino shield for electronics and Marlin firmware + Arduino mega2560 as a logic controller.
As above are battle-tested, I don't need to discover wheel again, but rather focus on the mechanics.
The R... |
21,128 | Do the lenses that fit a Nikon D-100 also fit a Nikon D-90 camera body? | 2012/03/11 | [
"https://photo.stackexchange.com/questions/21128",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/2371/"
] | **Yes. Do not think about them as D100 lenses. [They are Nikon F-Mount lenses](http://www.neocamera.com/list_lenses.php?mount=nikon).**
The D100 is Nikon DSLR with a 1.5X sensor crop and will work with any F-mount lens. This includes the Nikkor, Sigma, Tokina, Tamron, etc. Additionally, the D90 and D100 have a built-i... | @Ital, Almost.
It will work with any F-mount lens from the 1980s on. Many of the first Nikkor F-mount lenses have a tang to connect to the old-style meters. This tang will have interference issues with many modern bodies.
I happen to have a half dozen or more pre-AI Nikkor lenses that won't mount of many modern Niko... |
9,867,744 | I am working on rails 3 and sqlite db.
Using a IN query.
Currently passing an string variable of items to IN query.
But While executing that query it takes '' so it's not working.
How to get over this situation?
Here is my code
```
items = ""
items << "#{@invitation_user1.id}" << "," << "#{@invitation_user2.id}" << "... | 2012/03/26 | [
"https://Stackoverflow.com/questions/9867744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/347698/"
] | You can just pass an array in. Rails is clever enough to to the right thing with it:
```
items = [
@invitation_user1.id,
@invitation_user2.id,
@user1.id,
@user2.id,
@profile1.id,
@profile2.id
]
@activities = Version.where("item_id IN (?)", items)
# or equivalently:
@activities = Version.where(:item_id => ... | Use array instead of string.
For example
```
ids = [ @invitation_user1.id, @invitation_user2.id, @user1.id, @user2.id ]
```
Then easily you can find the records by
```
@versions = Version.find_all_by_id(ids)
```
This will result the query you expected.
```
SELECT "versions".* FROM "versions" WHERE (item_id IN ... |
9,867,744 | I am working on rails 3 and sqlite db.
Using a IN query.
Currently passing an string variable of items to IN query.
But While executing that query it takes '' so it's not working.
How to get over this situation?
Here is my code
```
items = ""
items << "#{@invitation_user1.id}" << "," << "#{@invitation_user2.id}" << "... | 2012/03/26 | [
"https://Stackoverflow.com/questions/9867744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/347698/"
] | You can just pass an array in. Rails is clever enough to to the right thing with it:
```
items = [
@invitation_user1.id,
@invitation_user2.id,
@user1.id,
@user2.id,
@profile1.id,
@profile2.id
]
@activities = Version.where("item_id IN (?)", items)
# or equivalently:
@activities = Version.where(:item_id => ... | What you are looking for is [split](http://ruby-doc.org/core-1.9.3/String.html#method-i-split):
```
[1] pry(main)> a = '19,20,4,1,1,4,1'
=> "19,20,4,1,1,4,1"
[2] pry(main)> a.split(',')
=> ["19", "20", "4", "1", "1", "4", "1"]
[3] pry(main)> a.split(',').map(&:to_i)
=> [19, 20, 4, 1, 1, 4, 1]
```
But, as you are con... |
61,070,293 | I'm looking to calculate the **median** of "score" (a dictionary value) inside a list.
```
my_dict = {"John": [{"class": "math", "score": 100, "year": 2014}, {"class": "english", "score": 85, "year": 2015}, {"class": "science", "score": 90, "year": 2015}],
"Timmy": [{"class": "math", "score": 87, "year": 2014}, {"cla... | 2020/04/06 | [
"https://Stackoverflow.com/questions/61070293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12706383/"
] | You can use the median from [statistics](https://docs.python.org/3/library/statistics.html).
```
from statistics import median
my_dict = {"John": [{"class": "math", "score": 100, "year": 2014}, {"class": "english", "score": 85, "year": 2015}, {"class": "science", "score": 90, "year": 2015}],
"Timmy": [{"class": "mat... | ```
my_dict = {"John": [{"class": "math", "score": 100, "year": 2014}, {"class": "english", "score": 85, "year": 2015}, {"class": "science", "score": 90, "year": 2015}],
"Timmy": [{"class": "math", "score": 87, "year": 2014}, {"class": "english", "score": 91, "year": 2015}],
"Sally":[{"class": "math", "score": 95, "y... |
61,070,293 | I'm looking to calculate the **median** of "score" (a dictionary value) inside a list.
```
my_dict = {"John": [{"class": "math", "score": 100, "year": 2014}, {"class": "english", "score": 85, "year": 2015}, {"class": "science", "score": 90, "year": 2015}],
"Timmy": [{"class": "math", "score": 87, "year": 2014}, {"cla... | 2020/04/06 | [
"https://Stackoverflow.com/questions/61070293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12706383/"
] | One liner using [median](https://docs.python.org/3/library/statistics.html#statistics.median) and dict comprehension
```
from statistics import median
{k:median([v.get('score',0) for v in my_dict[k]]) for k in my_dict.keys()}
```
Output:
```
{'John': 90, 'Timmy': 89.0, 'Sally': 95}
``` | ```
my_dict = {"John": [{"class": "math", "score": 100, "year": 2014}, {"class": "english", "score": 85, "year": 2015}, {"class": "science", "score": 90, "year": 2015}],
"Timmy": [{"class": "math", "score": 87, "year": 2014}, {"class": "english", "score": 91, "year": 2015}],
"Sally":[{"class": "math", "score": 95, "y... |
50,573,692 | I have a problem with my layout of my App. I have 2 Fragments which must be displayed in an Activity. It works fine, but the Layout somehome displays an EditText twice and also behind each other. You can see the hint of the EditText is darker and once I type something in the TextEdit I can see the other EditText indepe... | 2018/05/28 | [
"https://Stackoverflow.com/questions/50573692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1363078/"
] | Change height and width of both the fragments to wrap\_content and see if it works for you ? | I've used `Hint` in the second text and `TEXT` in the first
```
android:hint="@string/turnover_tax"
```
To display the `text` dimly use the `Hint` instead of the Netscape
```
android:hint="Your String"
android:text="Your String"
```
I've used `Hint` in the second text and `TEXT` in the first
```
android:hint="@s... |
50,573,692 | I have a problem with my layout of my App. I have 2 Fragments which must be displayed in an Activity. It works fine, but the Layout somehome displays an EditText twice and also behind each other. You can see the hint of the EditText is darker and once I type something in the TextEdit I can see the other EditText indepe... | 2018/05/28 | [
"https://Stackoverflow.com/questions/50573692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1363078/"
] | Change height and width of both the fragments to wrap\_content and see if it works for you ? | I found my mistake. I was adding in the onCreate of the main Activity a Fragment on top of the already set Fragment using the FragmentManager. The Fragment was already set in the layout ( itself, that is why I don't need to use a FragmentManager (*fragment\_calculation.xml*).
All I had to do is set the layout of the a... |
695 | I see that our current-day Bibles only refer to God as LORD. Can you explain to me what the different names of God are and what they mean? | 2011/08/26 | [
"https://christianity.stackexchange.com/questions/695",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/15/"
] | HERE ARE SOME OTHER NAMES OF GOD
JANELLE - GOD IS GRACIOUS
THOR - THY MAKER
ABBA - FATHER
ALPHA & OMEGA - THE BEGINNING & END
IMMANUEL - GOD WITH US | If you are looking for the proper noun name of God, then there is only one name. Some of the said above are titles, except for one name JEHOVAH. When Moises ask God what is his name God said in Exodus 3:15, Then God said once more to Moses: “This is what you are to say to the sons of Israel, Jehovah the God of your for... |
695 | I see that our current-day Bibles only refer to God as LORD. Can you explain to me what the different names of God are and what they mean? | 2011/08/26 | [
"https://christianity.stackexchange.com/questions/695",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/15/"
] | HERE ARE SOME OTHER NAMES OF GOD
JANELLE - GOD IS GRACIOUS
THOR - THY MAKER
ABBA - FATHER
ALPHA & OMEGA - THE BEGINNING & END
IMMANUEL - GOD WITH US | The name of god is rendered in English Jehovah. We do not know that that is exactly how it is pronounced. Your name in your language is familiar to you, but yet when you hear your name in another language it will sometimes sound very alien.
I don't expect a foreign person to be able to pronounce my name correctly. In ... |
695 | I see that our current-day Bibles only refer to God as LORD. Can you explain to me what the different names of God are and what they mean? | 2011/08/26 | [
"https://christianity.stackexchange.com/questions/695",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/15/"
] | Elohim
------
Genesis 1:1 (ESV)
>
> **1**
> In the beginning, God [Elohim] created the heavens and the earth.
>
Pslam 19:1 (ESV)
>
> **1** The heavens declare the glory of God, [Elohim]
> and the sky above proclaims his handiwork.
>
The name "Elohim" means "God" and is a reference to God's power and might.
... | You may want to start by understanding where the usage of LORD came. LORD is Jehovah, which is Yahweh (YHWH), the ineffable name of the God of Israel. (This is why Jewish people sometimes write G-d.)
Start with the Wikipedia article on Jehova. <http://en.wikipedia.org/wiki/Jehovah>
Under the <http://en.wikipedia.org/... |
695 | I see that our current-day Bibles only refer to God as LORD. Can you explain to me what the different names of God are and what they mean? | 2011/08/26 | [
"https://christianity.stackexchange.com/questions/695",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/15/"
] | You may want to start by understanding where the usage of LORD came. LORD is Jehovah, which is Yahweh (YHWH), the ineffable name of the God of Israel. (This is why Jewish people sometimes write G-d.)
Start with the Wikipedia article on Jehova. <http://en.wikipedia.org/wiki/Jehovah>
Under the <http://en.wikipedia.org/... | HERE ARE SOME OTHER NAMES OF GOD
JANELLE - GOD IS GRACIOUS
THOR - THY MAKER
ABBA - FATHER
ALPHA & OMEGA - THE BEGINNING & END
IMMANUEL - GOD WITH US |
695 | I see that our current-day Bibles only refer to God as LORD. Can you explain to me what the different names of God are and what they mean? | 2011/08/26 | [
"https://christianity.stackexchange.com/questions/695",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/15/"
] | Elohim
------
Genesis 1:1 (ESV)
>
> **1**
> In the beginning, God [Elohim] created the heavens and the earth.
>
Pslam 19:1 (ESV)
>
> **1** The heavens declare the glory of God, [Elohim]
> and the sky above proclaims his handiwork.
>
The name "Elohim" means "God" and is a reference to God's power and might.
... | the question was "what are the different names of god in the bible and what do they mean?" However, *IN TH BIBLE* there is only ONE name for god! best identified from the tetragrammaton "YHWH" Yahweh which means "hayah asher hayah" translated "I AM THAT I AM" in Exodus 3:14. To which many bible scholars and teachers ad... |
695 | I see that our current-day Bibles only refer to God as LORD. Can you explain to me what the different names of God are and what they mean? | 2011/08/26 | [
"https://christianity.stackexchange.com/questions/695",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/15/"
] | Elohim
------
Genesis 1:1 (ESV)
>
> **1**
> In the beginning, God [Elohim] created the heavens and the earth.
>
Pslam 19:1 (ESV)
>
> **1** The heavens declare the glory of God, [Elohim]
> and the sky above proclaims his handiwork.
>
The name "Elohim" means "God" and is a reference to God's power and might.
... | The name of god is rendered in English Jehovah. We do not know that that is exactly how it is pronounced. Your name in your language is familiar to you, but yet when you hear your name in another language it will sometimes sound very alien.
I don't expect a foreign person to be able to pronounce my name correctly. In ... |
695 | I see that our current-day Bibles only refer to God as LORD. Can you explain to me what the different names of God are and what they mean? | 2011/08/26 | [
"https://christianity.stackexchange.com/questions/695",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/15/"
] | Elohim
------
Genesis 1:1 (ESV)
>
> **1**
> In the beginning, God [Elohim] created the heavens and the earth.
>
Pslam 19:1 (ESV)
>
> **1** The heavens declare the glory of God, [Elohim]
> and the sky above proclaims his handiwork.
>
The name "Elohim" means "God" and is a reference to God's power and might.
... | HERE ARE SOME OTHER NAMES OF GOD
JANELLE - GOD IS GRACIOUS
THOR - THY MAKER
ABBA - FATHER
ALPHA & OMEGA - THE BEGINNING & END
IMMANUEL - GOD WITH US |
695 | I see that our current-day Bibles only refer to God as LORD. Can you explain to me what the different names of God are and what they mean? | 2011/08/26 | [
"https://christianity.stackexchange.com/questions/695",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/15/"
] | You may want to start by understanding where the usage of LORD came. LORD is Jehovah, which is Yahweh (YHWH), the ineffable name of the God of Israel. (This is why Jewish people sometimes write G-d.)
Start with the Wikipedia article on Jehova. <http://en.wikipedia.org/wiki/Jehovah>
Under the <http://en.wikipedia.org/... | The name of god is rendered in English Jehovah. We do not know that that is exactly how it is pronounced. Your name in your language is familiar to you, but yet when you hear your name in another language it will sometimes sound very alien.
I don't expect a foreign person to be able to pronounce my name correctly. In ... |
695 | I see that our current-day Bibles only refer to God as LORD. Can you explain to me what the different names of God are and what they mean? | 2011/08/26 | [
"https://christianity.stackexchange.com/questions/695",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/15/"
] | Elohim
------
Genesis 1:1 (ESV)
>
> **1**
> In the beginning, God [Elohim] created the heavens and the earth.
>
Pslam 19:1 (ESV)
>
> **1** The heavens declare the glory of God, [Elohim]
> and the sky above proclaims his handiwork.
>
The name "Elohim" means "God" and is a reference to God's power and might.
... | If you are looking for the proper noun name of God, then there is only one name. Some of the said above are titles, except for one name JEHOVAH. When Moises ask God what is his name God said in Exodus 3:15, Then God said once more to Moses: “This is what you are to say to the sons of Israel, Jehovah the God of your for... |
695 | I see that our current-day Bibles only refer to God as LORD. Can you explain to me what the different names of God are and what they mean? | 2011/08/26 | [
"https://christianity.stackexchange.com/questions/695",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/15/"
] | HERE ARE SOME OTHER NAMES OF GOD
JANELLE - GOD IS GRACIOUS
THOR - THY MAKER
ABBA - FATHER
ALPHA & OMEGA - THE BEGINNING & END
IMMANUEL - GOD WITH US | the question was "what are the different names of god in the bible and what do they mean?" However, *IN TH BIBLE* there is only ONE name for god! best identified from the tetragrammaton "YHWH" Yahweh which means "hayah asher hayah" translated "I AM THAT I AM" in Exodus 3:14. To which many bible scholars and teachers ad... |
29,635,082 | I need to have the `wrapper` div element to be full height and so adjust its height depending on the whole height of the page so no scrollbars are displayed.
My html:
```
<header>
I am the header and my height is fixed to 40px.
</header>
<div id="wrapper">
I am the wrapper
</div>
```
My css:
```
html,body {
... | 2015/04/14 | [
"https://Stackoverflow.com/questions/29635082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693560/"
] | You can use [CSS calc()](https://developer.mozilla.org/en-US/docs/Web/CSS/calc):
```
#wrapper {
height: calc(100% - 40px); /* 40px is the header value */
background-color: red;
}
```
[JSFiddle](https://jsfiddle.net/3putthcv/4/)
---
Or `display:table/table-row`:
```css
html,
body {
height: 100%;
width: ... | What about setting the size based on the `top`, `left`, `right` and `bottom` like this ([demo](https://jsfiddle.net/3putthcv/3/)) (full disclosure, it won't work if the content is [too large](https://jsfiddle.net/3putthcv/5/)):
```
#wrapper {
background-color: red;
bottom: 0;
left: 0;
position: absolute;
... |
10,597 | I'm using X11 forwarding over `ssh` to run Linux apps on my Windows box, and when the network drops it loses everything that was running. Is there anything similar to `screen` for X11? | 2011/04/04 | [
"https://unix.stackexchange.com/questions/10597",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/2455/"
] | [Xpra](http://code.google.com/p/partiwm/wiki/xpra) or the [Xpra fork](http://xpra.org/) claim to be exactly that:
>
> So basically it's [screen](http://www.gnu.org/software/screen/) for remote X apps.
>
>
>
I haven't used it in a while, but it worked pretty well when I tried it. You start the server on the remote... | You're looking for [VNC](http://en.wikipedia.org/wiki/Virtual_Network_Computing). The principle somewhat is similar to screen: you run a VNC server (the backgound `SCREEN` process), and a VNC client (the foreground `screen` process). The VNC server is an X server, so you can run X applications in it.
Run a VNC server ... |
10,597 | I'm using X11 forwarding over `ssh` to run Linux apps on my Windows box, and when the network drops it loses everything that was running. Is there anything similar to `screen` for X11? | 2011/04/04 | [
"https://unix.stackexchange.com/questions/10597",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/2455/"
] | [Xpra](http://code.google.com/p/partiwm/wiki/xpra) or the [Xpra fork](http://xpra.org/) claim to be exactly that:
>
> So basically it's [screen](http://www.gnu.org/software/screen/) for remote X apps.
>
>
>
I haven't used it in a while, but it worked pretty well when I tried it. You start the server on the remote... | Actually, you can forward X into `screen`. Only thing to do is to set up the `$DISPLAY` in the `screen` window so that it is the same out side of it.
### Procedure
after `ssh -X` into the remote machine, type
```
$ echo $DISPLAY
```
and copy the result, usually `localhost:N.0`. Then enter `screen`, in the local `... |
10,597 | I'm using X11 forwarding over `ssh` to run Linux apps on my Windows box, and when the network drops it loses everything that was running. Is there anything similar to `screen` for X11? | 2011/04/04 | [
"https://unix.stackexchange.com/questions/10597",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/2455/"
] | [Xpra](http://code.google.com/p/partiwm/wiki/xpra) or the [Xpra fork](http://xpra.org/) claim to be exactly that:
>
> So basically it's [screen](http://www.gnu.org/software/screen/) for remote X apps.
>
>
>
I haven't used it in a while, but it worked pretty well when I tried it. You start the server on the remote... | I found [X2Go](https://wiki.x2go.org/doku.php/start) to be very good at this. It creates separate windows like X11 does (Single application mode), and the latency is much better than xpra, which I found to be unusable. |
10,597 | I'm using X11 forwarding over `ssh` to run Linux apps on my Windows box, and when the network drops it loses everything that was running. Is there anything similar to `screen` for X11? | 2011/04/04 | [
"https://unix.stackexchange.com/questions/10597",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/2455/"
] | You're looking for [VNC](http://en.wikipedia.org/wiki/Virtual_Network_Computing). The principle somewhat is similar to screen: you run a VNC server (the backgound `SCREEN` process), and a VNC client (the foreground `screen` process). The VNC server is an X server, so you can run X applications in it.
Run a VNC server ... | Actually, you can forward X into `screen`. Only thing to do is to set up the `$DISPLAY` in the `screen` window so that it is the same out side of it.
### Procedure
after `ssh -X` into the remote machine, type
```
$ echo $DISPLAY
```
and copy the result, usually `localhost:N.0`. Then enter `screen`, in the local `... |
10,597 | I'm using X11 forwarding over `ssh` to run Linux apps on my Windows box, and when the network drops it loses everything that was running. Is there anything similar to `screen` for X11? | 2011/04/04 | [
"https://unix.stackexchange.com/questions/10597",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/2455/"
] | You're looking for [VNC](http://en.wikipedia.org/wiki/Virtual_Network_Computing). The principle somewhat is similar to screen: you run a VNC server (the backgound `SCREEN` process), and a VNC client (the foreground `screen` process). The VNC server is an X server, so you can run X applications in it.
Run a VNC server ... | I found [X2Go](https://wiki.x2go.org/doku.php/start) to be very good at this. It creates separate windows like X11 does (Single application mode), and the latency is much better than xpra, which I found to be unusable. |
10,597 | I'm using X11 forwarding over `ssh` to run Linux apps on my Windows box, and when the network drops it loses everything that was running. Is there anything similar to `screen` for X11? | 2011/04/04 | [
"https://unix.stackexchange.com/questions/10597",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/2455/"
] | Actually, you can forward X into `screen`. Only thing to do is to set up the `$DISPLAY` in the `screen` window so that it is the same out side of it.
### Procedure
after `ssh -X` into the remote machine, type
```
$ echo $DISPLAY
```
and copy the result, usually `localhost:N.0`. Then enter `screen`, in the local `... | I found [X2Go](https://wiki.x2go.org/doku.php/start) to be very good at this. It creates separate windows like X11 does (Single application mode), and the latency is much better than xpra, which I found to be unusable. |
9,900 | I am not sure about the terminology, i.e if it's called an electric cooker, burner, stove or something else. So I'll just refer to it as a electric or gas cooker to simplify things.
We don't have a gas supply to our house in the UK as we have moved to a more remote location. We did have a gas supply in our old house a... | 2011/11/05 | [
"https://diy.stackexchange.com/questions/9900",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1670/"
] | In rural locations in the US, propane is often used as a fuel for cooking and heating. The gas is stored in an outdoor tank and piped into the house. Propane burns hotter than methane ("natural gas"). Therefore you may need a special stove to use propane, and if you want to hook up appliances such as a water heater or ... | The links you provided are broken so I'm not sure what you were looking at, but I assume you are looking at propane burners.
By all means do ***NOT*** use a propane burner indoors (or anywhere else that doesn't have execllent ventilation). It's not a matter of *efficiency*, as propane is nearly as thermally efficient... |
9,900 | I am not sure about the terminology, i.e if it's called an electric cooker, burner, stove or something else. So I'll just refer to it as a electric or gas cooker to simplify things.
We don't have a gas supply to our house in the UK as we have moved to a more remote location. We did have a gas supply in our old house a... | 2011/11/05 | [
"https://diy.stackexchange.com/questions/9900",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1670/"
] | You may want to ask around in your local area, as if you're using some sort of bottled gas, you'll need to get resupplied, and whomever the gas supplier is could probably make recommendations.
In the U.S, what I've typically seen is outdoor tanks that are refilled by a large truck. They're typically used for the whole... | The links you provided are broken so I'm not sure what you were looking at, but I assume you are looking at propane burners.
By all means do ***NOT*** use a propane burner indoors (or anywhere else that doesn't have execllent ventilation). It's not a matter of *efficiency*, as propane is nearly as thermally efficient... |
9,900 | I am not sure about the terminology, i.e if it's called an electric cooker, burner, stove or something else. So I'll just refer to it as a electric or gas cooker to simplify things.
We don't have a gas supply to our house in the UK as we have moved to a more remote location. We did have a gas supply in our old house a... | 2011/11/05 | [
"https://diy.stackexchange.com/questions/9900",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1670/"
] | In rural locations in the US, propane is often used as a fuel for cooking and heating. The gas is stored in an outdoor tank and piped into the house. Propane burns hotter than methane ("natural gas"). Therefore you may need a special stove to use propane, and if you want to hook up appliances such as a water heater or ... | You may want to ask around in your local area, as if you're using some sort of bottled gas, you'll need to get resupplied, and whomever the gas supplier is could probably make recommendations.
In the U.S, what I've typically seen is outdoor tanks that are refilled by a large truck. They're typically used for the whole... |
57,277 | Introduction
------------
*Last year* was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?
Challenge
---------
Given an integer `n` as input, write a *full program* to output a birthday cake with `n` candles on.
Output
------
A piece of cake w... | 2015/09/08 | [
"https://codegolf.stackexchange.com/questions/57277",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/-1/"
] | R, 157
------
```
write(if(n<-scan()){
z=matrix(c("$","|","-","~","-"),N<-2*max(1,n)+1,5,T)
z[seq(1,N,1+(n>0)),1:2]=" "
z}else"Congratulations on your new baby! :D","",N,F,"")
``` | JavaScript, ~~143~~ 153 Bytes
=============================
`for(v in k=' $ 0 | 0---0~~~0---'.split(+!(n=+prompt(c=''))))c+=k[v].repeat(n<0?1:n)+'\n';alert(n>0?c:n?c.slice(8):'Congratulations on your new baby! :D')`
To see output in mono space font replace 'alert' by 'console.log' |
57,277 | Introduction
------------
*Last year* was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?
Challenge
---------
Given an integer `n` as input, write a *full program* to output a birthday cake with `n` candles on.
Output
------
A piece of cake w... | 2015/09/08 | [
"https://codegolf.stackexchange.com/questions/57277",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/-1/"
] | R, 157
------
```
write(if(n<-scan()){
z=matrix(c("$","|","-","~","-"),N<-2*max(1,n)+1,5,T)
z[seq(1,N,1+(n>0)),1:2]=" "
z}else"Congratulations on your new baby! :D","",N,F,"")
``` | Lua 5.2, 187 Bytes
==================
```
p=print n=io.read"*n"r=string.rep
if n==0 then p"Congratulations on your new baby! :D"else
m=3*math.max(n,1)if n>0 then p(r(" $ ",n))p(r(" | ",n))end
p(r("-",m))p(r("~",m))p(r("-",m))end
```
Minimalistic version. I'm open for improvements :) |
57,277 | Introduction
------------
*Last year* was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?
Challenge
---------
Given an integer `n` as input, write a *full program* to output a birthday cake with `n` candles on.
Output
------
A piece of cake w... | 2015/09/08 | [
"https://codegolf.stackexchange.com/questions/57277",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/-1/"
] | CJam, ~~76~~ 75 bytes
=====================
```
ri_W>\_1e>)" $ |--~~--"2/f*Wf<N*"Congratulations on your new baby! :D"?_8>?
```
Try it online in the [CJam interpreter](http://cjam.aditsu.net/#code=ri_W%3E%5C_1e%3E)%22%20%24%20%7C--~~--%222%2Ff*Wf%3CN*%22Congratulations%20on%20your%20new%20baby!%20%3AD%22%3F_8%3E%3F&... | [Zsh](http://zsh.sourceforge.net/), 162 bytes
=============================================
[try it online!!](https://tio.run/##LU5LDoIwFNxzimfzQoqGlOLKF9CF3kJdtAbUhLQJlCgiXr3WyGK@m5lXd/M1T8aoutwssJPhruocoUyY53wRNInjoijY3pprq1zfKHe3pgNrYLB9C6Z6gFZ6WAAdWBxXz7uLhhKPKItsl1O@RHkGVeLIGxqIACmZQM95JYnSUESco9xmv63/D1Qng6MSAsV... |
57,277 | Introduction
------------
*Last year* was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?
Challenge
---------
Given an integer `n` as input, write a *full program* to output a birthday cake with `n` candles on.
Output
------
A piece of cake w... | 2015/09/08 | [
"https://codegolf.stackexchange.com/questions/57277",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/-1/"
] | [Jelly](https://github.com/DennisMitchell/jelly), 49 46 bytes
=============================================================
```
Ḥ‘»3“-~-”ẋ€;@⁶p⁾$|¤ẋ€$Yµ“ŒḅœÑḄŻ:Ṁ¿Þ5sṭ+¬ḅḣ;»¹?
```
[Try it online!](https://tio.run/##y0rNyan8///hjiWPGmYc2m38qGGObp3uo4a5D3d1P2paY@3wqHFbwaPGfSo1h5ZAhFQiD20Fqjo66eGO1qOTD098uKPl6G6rhzsbDu0... | ECMAScript 2015 – 134 bytes
===========================
```js
n=>n?[' $'.repeat(n=(n>0)*n),' |'.repeat(n),d='-'.repeat(c=n?1+2*n:3),'~'.repeat(c),d].join`
`:'Congratulations on your new baby! :D'
``` |
57,277 | Introduction
------------
*Last year* was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?
Challenge
---------
Given an integer `n` as input, write a *full program* to output a birthday cake with `n` candles on.
Output
------
A piece of cake w... | 2015/09/08 | [
"https://codegolf.stackexchange.com/questions/57277",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/-1/"
] | golflua, 113 characters
=======================
```
\p(c)w(S.t(c,n))~$n=I.r()+0?n==0w"Congratulations on your new baby! :D"!??n>0p" $"p" |"n=n*2+1!?n=3$p"-"p"~"p"-"$
```
Sample run:
```
bash-4.3$ golflua -e '\p(c)w(S.t(c,n))~$n=I.r()+0?n==0w"Congratulations on your new baby! :D"!??n>0p" $"p" |"n=n*2+1!?n=3$p"-"p"~"... | Python 2, 131 bytes
===================
```python
x,y,n="$|-~-"," -~-",input()
for i in zip(y,*[y,y]*(n<0)+[x,y]*n)if n else["Congratulations on your new baby! :D"]:print"".join(i)
```
Happy belated birthday to OP :D Haven't been here in ages, I need to warm up my golfing skills again...using my favorite 90 degree ... |
57,277 | Introduction
------------
*Last year* was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?
Challenge
---------
Given an integer `n` as input, write a *full program* to output a birthday cake with `n` candles on.
Output
------
A piece of cake w... | 2015/09/08 | [
"https://codegolf.stackexchange.com/questions/57277",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/-1/"
] | Python 3, 169 bytes
===================
```python
n=int(input())
m=max(n*2+1,3)
f=' {}'*n+'\n'+' {}'*n+'\n'+'-'*m+'\n'+'~'*m+'\n'+'-'*m
if n==0:f='Congratulations on your new baby! :D'
print(f.format(*['$']*n+['|']*n))
``` | [Zsh](http://zsh.sourceforge.net/), 162 bytes
=============================================
[try it online!!](https://tio.run/##LU5LDoIwFNxzimfzQoqGlOLKF9CF3kJdtAbUhLQJlCgiXr3WyGK@m5lXd/M1T8aoutwssJPhruocoUyY53wRNInjoijY3pprq1zfKHe3pgNrYLB9C6Z6gFZ6WAAdWBxXz7uLhhKPKItsl1O@RHkGVeLIGxqIACmZQM95JYnSUESco9xmv63/D1Qng6MSAsV... |
57,277 | Introduction
------------
*Last year* was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?
Challenge
---------
Given an integer `n` as input, write a *full program* to output a birthday cake with `n` candles on.
Output
------
A piece of cake w... | 2015/09/08 | [
"https://codegolf.stackexchange.com/questions/57277",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/-1/"
] | Lua, 299 Bytes
==============
```
a=0+io.read() b=string.rep p=print if a==0 then p("Congratulations on your new baby! :D") else p(b(" ",a)..b("$ ",a)..("\n")..b(" ",a)..b("| ",a)) if a<0 or a==1 then p("---\n~~~\n---") else p(b(" ",a-1).."-"..b("-",2*a).."\n"..b(" ",a-1).."~"..b("~",2*a).."\n"..b(" ",a-1).."-"..b("-"... | Java 7, 197 ~~198~~ bytes
=========================
```
String c(int y){String a=" ",b=a,c="---",n="\n";for(int i=0;i<y;a+="$ ",b+="| ")if(y>0&i++>0)c+="--";c=c+n+c.replace('-','~')+n+c;return y<0?c:y>0?a+n+b+n+c:"Congratulations on your new baby! :D";}
```
**Ungolfed:**
```
String c(int y){
String a = " ",
... |
57,277 | Introduction
------------
*Last year* was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?
Challenge
---------
Given an integer `n` as input, write a *full program* to output a birthday cake with `n` candles on.
Output
------
A piece of cake w... | 2015/09/08 | [
"https://codegolf.stackexchange.com/questions/57277",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/-1/"
] | R, 157
------
```
write(if(n<-scan()){
z=matrix(c("$","|","-","~","-"),N<-2*max(1,n)+1,5,T)
z[seq(1,N,1+(n>0)),1:2]=" "
z}else"Congratulations on your new baby! :D","",N,F,"")
``` | Lua, 299 Bytes
==============
```
a=0+io.read() b=string.rep p=print if a==0 then p("Congratulations on your new baby! :D") else p(b(" ",a)..b("$ ",a)..("\n")..b(" ",a)..b("| ",a)) if a<0 or a==1 then p("---\n~~~\n---") else p(b(" ",a-1).."-"..b("-",2*a).."\n"..b(" ",a-1).."~"..b("~",2*a).."\n"..b(" ",a-1).."-"..b("-"... |
57,277 | Introduction
------------
*Last year* was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?
Challenge
---------
Given an integer `n` as input, write a *full program* to output a birthday cake with `n` candles on.
Output
------
A piece of cake w... | 2015/09/08 | [
"https://codegolf.stackexchange.com/questions/57277",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/-1/"
] | bash, ~~264~~ 242 bytes
=======================
First of all: happy birthday, @BetaDecay :)
And now...
```
read n;p="printf ";e="echo ";x="exit";s="seq ";[ $n -eq 0 ]&&$e"Congratulations on your new baby! :D"&&$x;[ $n -gt 0 ]&&{ $p' %.s$ ' `$s 1 $n`;$e; $p' %.s| ' `$s 1 $n`;$e;};$p'%.s---' `$s 1 $n`;$e;$p'%.s~~~' `$... | C, 196 bytes
============
Prints leading spaces before empty candle cake. According to comments in the challenge, that's okay.
```
i,n;main(c,v)char**v;{c=atoi(v[1]);n=c<0;if(c)for(c=n?1:c;i++<10*c+10;)putchar(i%(2*c+2)?i<4*c+5?n|i%2?32:i<2*c+2?36:'|':i/(2*c+2)==3?'~':45:10);else puts("Congratulations on your new bab... |
57,277 | Introduction
------------
*Last year* was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?
Challenge
---------
Given an integer `n` as input, write a *full program* to output a birthday cake with `n` candles on.
Output
------
A piece of cake w... | 2015/09/08 | [
"https://codegolf.stackexchange.com/questions/57277",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/-1/"
] | Lua, 299 Bytes
==============
```
a=0+io.read() b=string.rep p=print if a==0 then p("Congratulations on your new baby! :D") else p(b(" ",a)..b("$ ",a)..("\n")..b(" ",a)..b("| ",a)) if a<0 or a==1 then p("---\n~~~\n---") else p(b(" ",a-1).."-"..b("-",2*a).."\n"..b(" ",a-1).."~"..b("~",2*a).."\n"..b(" ",a-1).."-"..b("-"... | C, 729 bytes
============
I'm new to programming, and new to Stack Exchange, however I still wanted to give it a shot with whatever my professor has taught me as of now:
```
#include<stdio.h>
int main(void)
{char a[2][100]={" "}, b[3][100],i;int c;for(i=1;i<100;i+=2){a[0][i]='$';a[1][i]='|';}for(i=0;i<100;++i){b[0][i... |
46,310,792 | I have a PHP variable `$MostRecentQuestionType` whose value is `SimplifyingFractions`. I want to print `Simplifying Fractions`, so I tried the following, but it returns `Array ( [0] => Simplifyin [1] => Fractions )`
```
$MostRecentQuestionType = $data['MostRecentQuestionType'];
$MostRecentQuestionTypeExploded = preg_s... | 2017/09/19 | [
"https://Stackoverflow.com/questions/46310792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8163679/"
] | Something like this:
```
<?php
$MostRecentQuestionType = "SimplifyingFractions";
$MostRecentQuestionTypeExploded = preg_split('/(?=[A-Z])/',$MostRecentQuestionType);
print(implode($MostRecentQuestionTypeExploded," "));
```
You could also cut out the middle man by doing:
```
<?php
$MostRecentQuestionType = "Simplify... | Instead of your print\_r command, you can do this :
```
foreach($MostRecentQuestionTypeExploded as $value) { print($value." ");}
``` |
140,607 | Why does my 24 volt DC servo motor move with 5 volt DC drawing 5 amps, but does not move with 24 volt DC?
The power supply is 24 volt DC up to 10 amps.
Datasheet are available for the [DS4S servo driver](http://www.cncdrive.com/downloads/DG4S_series_manual.pdf) and the [servo motor](https://drive.google.com/file/d/0B... | 2014/11/28 | [
"https://electronics.stackexchange.com/questions/140607",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/57476/"
] | You'll need to tell us more about your 24V, 10A power supply, but if the motor is drawing 5A at 5V, then it looks like it'll try to draw more than 10A at 24V. It may be causing the 24V supply to shut down. You must measure the voltage at the output of the 24V supply, while you connect the motor. If the voltage drops to... | Hello everyone and thank you for your inputs.
After trying different things I decided to remove the active current limiter value of 10 amps I had on the servodrive, I left the value to the highest possible for the servodrive of 35 amps, I do not know how much current is the servomotor drawing but now the servo is movi... |
14,256,100 | I want to create a periodic process with inner cycles, using javascript. Each cycle is represented by consequently changing circles - with specified time interval between them and specified time interval between cycles. The problem is also getting harder, because I also need a variable time interval between cycles and ... | 2013/01/10 | [
"https://Stackoverflow.com/questions/14256100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1966277/"
] | A recap, you want to select all rows for which there exists at least one row with the same TransactionID that has a negative quantity?
```
select *
from RBOTRANSACTIONSALESTRANS main
where main.DATAAREAID = 'DAT'
and exists
(
select 1
from RBOTRANSACTIONSALESTRANS sub
where sub.QTY < 0
and s... | more or less the query should be like that
```
select * from
(
select tansactionID, sum(qty) as q, sum(abs(qty)) as q2
from table2 T
group by tansactionID ) T
where q<> q2
```
post the schema so i can adjust it |
14,256,100 | I want to create a periodic process with inner cycles, using javascript. Each cycle is represented by consequently changing circles - with specified time interval between them and specified time interval between cycles. The problem is also getting harder, because I also need a variable time interval between cycles and ... | 2013/01/10 | [
"https://Stackoverflow.com/questions/14256100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1966277/"
] | A recap, you want to select all rows for which there exists at least one row with the same TransactionID that has a negative quantity?
```
select *
from RBOTRANSACTIONSALESTRANS main
where main.DATAAREAID = 'DAT'
and exists
(
select 1
from RBOTRANSACTIONSALESTRANS sub
where sub.QTY < 0
and s... | JOINed query defines `TRANSACTIONID` according your conditions (see `HAVING` conditions). So after JOIN you filter your table to leave only these `TRANSACTIONID`.
```
select t.* from RBOTRANSACTIONSALESTRANS t
join
(
select TRANSACTIONID,min(main.qty),max(main.qty)
from RBOTRANSACTIONSALESTRANS main
GROUP BY TRA... |
14,256,100 | I want to create a periodic process with inner cycles, using javascript. Each cycle is represented by consequently changing circles - with specified time interval between them and specified time interval between cycles. The problem is also getting harder, because I also need a variable time interval between cycles and ... | 2013/01/10 | [
"https://Stackoverflow.com/questions/14256100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1966277/"
] | A recap, you want to select all rows for which there exists at least one row with the same TransactionID that has a negative quantity?
```
select *
from RBOTRANSACTIONSALESTRANS main
where main.DATAAREAID = 'DAT'
and exists
(
select 1
from RBOTRANSACTIONSALESTRANS sub
where sub.QTY < 0
and s... | It seems to me that you may be over complicating the issue. If I am understanding the criteria correctly you want All rows where
* the quantity is < 0
**OR**
* the quantity is < 0 **AND** a row exists with the same transaction ID
with a negative quantity
So to start
```
SELECT *
FROM RBOTRANSACTIONSALESTRANS ... |
7,893 | I want to set up a single python file containing variables that have the locations of all my data sources. This would then be used by all my other scripts, then as a data source changes, I only have to edit the one file.
My Data\_sources.py would look something like this:
```
BC_BEC = "Database Connections\\BC.sde\\F... | 2011/03/29 | [
"https://gis.stackexchange.com/questions/7893",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/1314/"
] | You could create an installed Python module that is importable from every Python script you run by using [Distutils](http://docs.python.org/distutils/introduction.html#a-simple-example) to package it.
From the Python doc:
>
> If all you want to do is distribute a
> module called foo, contained in a file
> foo.py, ... | Create a text config file and read it with Python's [ConfigParser](http://docs.python.org/library/configparser.html).
Slightly nicer examples than the official documentation at <http://effbot.org/librarybook/configparser.htm> |
7,893 | I want to set up a single python file containing variables that have the locations of all my data sources. This would then be used by all my other scripts, then as a data source changes, I only have to edit the one file.
My Data\_sources.py would look something like this:
```
BC_BEC = "Database Connections\\BC.sde\\F... | 2011/03/29 | [
"https://gis.stackexchange.com/questions/7893",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/1314/"
] | In any script in the same directory as Data\_sources.py, put
```
from Data_sources import BC_BEC, BC_TFL
```
at the top. This works because the working directory is always at the head of the python path unless you've modified it.
```
>>> import sys
>>> sys.path[0] == ''
True
```
See also: <http://diveintopython.o... | Create a text config file and read it with Python's [ConfigParser](http://docs.python.org/library/configparser.html).
Slightly nicer examples than the official documentation at <http://effbot.org/librarybook/configparser.htm> |
73,482 | As a computer scientist, I think of each element of musical analysis as a computation we have chosen to do on the music for some reason. I'm not saying I understand how humans decide what the meter is, but I know that we hear a piece (our input) and somehow determine the metrical structure (our output). There are possi... | 2018/08/07 | [
"https://music.stackexchange.com/questions/73482",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/48652/"
] | We have to be a bit careful with the word 'interval' - there are a number of different ways of talking about relative pitch, and the word 'interval' might have different nuances of meaning across those. But in the context of your question, I would say that we care about intervals because:
* A given interval between tw... | Midi note numbers are used for describing an *abstraction* of pitch in the form of a logarithmic fundamental frequency ratio with 12 steps per power of 2. This abstraction has been made in order to capture essential properties of sounds used as Western music notes.
That means that only operations sensibly related to t... |
73,482 | As a computer scientist, I think of each element of musical analysis as a computation we have chosen to do on the music for some reason. I'm not saying I understand how humans decide what the meter is, but I know that we hear a piece (our input) and somehow determine the metrical structure (our output). There are possi... | 2018/08/07 | [
"https://music.stackexchange.com/questions/73482",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/48652/"
] | We have to be a bit careful with the word 'interval' - there are a number of different ways of talking about relative pitch, and the word 'interval' might have different nuances of meaning across those. But in the context of your question, I would say that we care about intervals because:
* A given interval between tw... | One point might be that the Fourier Analysis of functions (notes in the case being considered) is additive. One combines notes to make chords so a major chord (to use a simple example) has the basic frequency of Sin(4x)+Sin(5x)+Sin(6x) when analyzed (ignoring higher harmonic things and inharmonicities of physical objec... |
73,482 | As a computer scientist, I think of each element of musical analysis as a computation we have chosen to do on the music for some reason. I'm not saying I understand how humans decide what the meter is, but I know that we hear a piece (our input) and somehow determine the metrical structure (our output). There are possi... | 2018/08/07 | [
"https://music.stackexchange.com/questions/73482",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/48652/"
] | We have to be a bit careful with the word 'interval' - there are a number of different ways of talking about relative pitch, and the word 'interval' might have different nuances of meaning across those. But in the context of your question, I would say that we care about intervals because:
* A given interval between tw... | Look at it this way: if you are considering how two tones relate to one another, the frequency ratio specifies what interval you hear (an octave, a fifth, and so forth) but not the absolute frequency. The product, on the other hand, specifies how high or low the combination is, but not the interval. So for instance if ... |
15,556,384 | How can I make the website point to a local host instance of a webservice if running through visual studio but point to the server using the hostname when running on iis.
I have a ASP .Net web apis project with rest apis that runs on a specific host. I have a separate website project that makes ajax calls to the web a... | 2013/03/21 | [
"https://Stackoverflow.com/questions/15556384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2184249/"
] | You could update your Hosts file to point to the local server? You should find it here: Windows\System32\drivers\etc\hosts
And here's a good guide: <http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/> | ```
if (String.Equals(HttpContext.Current.Request.Url.Host.ToString(), "localhost"))
``` |
109,569 | When I cleaned my touch-pad yesterday I accidentally clicked on something. After that I was still in normal screen. But the left tool-bar and the right function-section was gone, like in full-screen mode.
But it was — not — full-screen.
So, I figured I could hover over the left border of the screen. And the tool-bar ... | 2018/05/19 | [
"https://graphicdesign.stackexchange.com/questions/109569",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/119534/"
] | In addition to Danielillo's answer....
`Tab` will hide all panels, including the toolbar, while *not* entering full screen mode.
`Shift`+`Tab` will hide all panels *except* the tool bar, while *not* switching to full screen mode. | It's the same shortcut as Photoshop:
Pressing the key **F** once > hide the window frame
Pressing the key **F** twice > hide everything and get full screen artboard |
109,569 | When I cleaned my touch-pad yesterday I accidentally clicked on something. After that I was still in normal screen. But the left tool-bar and the right function-section was gone, like in full-screen mode.
But it was — not — full-screen.
So, I figured I could hover over the left border of the screen. And the tool-bar ... | 2018/05/19 | [
"https://graphicdesign.stackexchange.com/questions/109569",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/119534/"
] | It's the same shortcut as Photoshop:
Pressing the key **F** once > hide the window frame
Pressing the key **F** twice > hide everything and get full screen artboard | It is simple.
When pressing `Tab` it enters this mode.
Then you can hover over the edge of the screen.
And the panels reappear while hovering.
[Taken from here.](https://forums.adobe.com/thread/2492696) |
109,569 | When I cleaned my touch-pad yesterday I accidentally clicked on something. After that I was still in normal screen. But the left tool-bar and the right function-section was gone, like in full-screen mode.
But it was — not — full-screen.
So, I figured I could hover over the left border of the screen. And the tool-bar ... | 2018/05/19 | [
"https://graphicdesign.stackexchange.com/questions/109569",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/119534/"
] | In addition to Danielillo's answer....
`Tab` will hide all panels, including the toolbar, while *not* entering full screen mode.
`Shift`+`Tab` will hide all panels *except* the tool bar, while *not* switching to full screen mode. | It is simple.
When pressing `Tab` it enters this mode.
Then you can hover over the edge of the screen.
And the panels reappear while hovering.
[Taken from here.](https://forums.adobe.com/thread/2492696) |
637,006 | 
Hi
I'm leaving for my exam in around 20 minutes and I know I've posted a similar one to this before but I didn't find useful hep, well one that I could understand.
im able to get t... | 2014/01/13 | [
"https://math.stackexchange.com/questions/637006",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/120993/"
] | Since $\sqrt{578}=\sqrt{289\cdot 2},$
$$\frac{289}{\sqrt{289}\cdot\sqrt{289\cdot 2}}=\frac{289}{\sqrt{289}\cdot \sqrt{289}\cdot \sqrt 2}=\frac{289}{289\cdot \sqrt 2}=\frac{1}{\sqrt 2}=\frac{1\cdot \sqrt 2}{\sqrt 2\cdot\sqrt 2}=\frac{\sqrt 2}{2}.$$
Here, I used
$$\sqrt{289\cdot 2}=\sqrt{289}\times\sqrt 2,$$
$$\sqrt{289... | Simplify root(289) into 17 and root(578) into 17root(2), simplify to 1 over root(2), by dividing top and bottom by 289 (17 squared), you're left with 1 over root(2), which is equivalent to root(2) over 2. Look at the cosine table so the angle is 45. |
73,271 | Overall history
---------------
I have noticed over the years that complicated Beethoven pieces, especially those with sudden dynamic changes, pieces with lots of octaves, and super fast pieces tense up my hands, sometimes to the point that my wrist hurts and I have to stop in the middle of a piece. On the other hand,... | 2018/08/01 | [
"https://music.stackexchange.com/questions/73271",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/9749/"
] | I'll take a guess at the reason - also based on some of your earlier, similar, questions about specific technical problems.
Your "piano technique" isn't piano technique at all. You are trying to play the piano the same way as you would play a harpsichord - and you aren't the first (self-taught?) beginner to fall into ... | Alephzero (which really should be "Aleph-Null" to comply with standard math notation, but whatever :-) ) pretty much covered it.
I'll just add the important warning: get some lessons before you do two irreversible things.
1) damage your nerves or tendons from bad mechanics
2) ingrain really bad habits (see "bad mecha... |
73,271 | Overall history
---------------
I have noticed over the years that complicated Beethoven pieces, especially those with sudden dynamic changes, pieces with lots of octaves, and super fast pieces tense up my hands, sometimes to the point that my wrist hurts and I have to stop in the middle of a piece. On the other hand,... | 2018/08/01 | [
"https://music.stackexchange.com/questions/73271",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/9749/"
] | I'll take a guess at the reason - also based on some of your earlier, similar, questions about specific technical problems.
Your "piano technique" isn't piano technique at all. You are trying to play the piano the same way as you would play a harpsichord - and you aren't the first (self-taught?) beginner to fall into ... | Just practice what you want to practice.
To me, spending all this time playing mozart pieces just to warm up and cool down seems like a huge waste of time.
I would suggest another strategy:
1. No warm up, just play what you want to play, at a speed which is confortable. You will warm up naturaly from there.
2. Wh... |
32,943 | If I don't decide for a while to put down the money for The Lich King (everyone has Burring Crusade now), and I level a character to level 70, what can I expect to be doing in the game without the other expansions, not including leveling another character?
I was thinking PvP, but that would put me in the lowest level... | 2011/10/21 | [
"https://gaming.stackexchange.com/questions/32943",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/10747/"
] | There are a few options open to you.
1) Replay old content, daily quests etc and get your faction rep up, 100% complete all quests in all zones.
2) PvP to get your rank up, earn armour etc, you can also use your resources to create a new lvl 19,29,39 character to PvP.
3) Join a guild dedicated to lvl70 raiding and d... | You can join a level 70 guild and depending on what you like more you can go pvp or raiding. |
3,551,465 | I have a C# program that I want to dynamically create databases with. Although only privileged users will be using this application, I want to follow best practices security wise. How do I go about doing this? I don't think I can use a parameterized query in this case since I'm not wanting to pass in a string, I want t... | 2010/08/23 | [
"https://Stackoverflow.com/questions/3551465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/373327/"
] | You can use the backtick delimiter to ensure the strings are correctly quoted and ensure that whatever is entered by the user is used as a literal identifier.
See: <http://dev.mysql.com/doc/refman/5.0/en/identifiers.html> and [Using backticks around field names](https://stackoverflow.com/questions/261455/using-backtic... | simply run a regular expression against schema to verify that it is a valid name? (contains no spaces, colons etc). I'm not sure if you can or can't use parameterised queries in this case, but if you do, it will fail creating a database called TRANCATE TABLE users; anyway :) |
3,551,465 | I have a C# program that I want to dynamically create databases with. Although only privileged users will be using this application, I want to follow best practices security wise. How do I go about doing this? I don't think I can use a parameterized query in this case since I'm not wanting to pass in a string, I want t... | 2010/08/23 | [
"https://Stackoverflow.com/questions/3551465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/373327/"
] | You can use the backtick delimiter to ensure the strings are correctly quoted and ensure that whatever is entered by the user is used as a literal identifier.
See: <http://dev.mysql.com/doc/refman/5.0/en/identifiers.html> and [Using backticks around field names](https://stackoverflow.com/questions/261455/using-backtic... | I don't know why do you want to create databases dynamically, but I think the correct way of doing this is not to generate databases dynamically.
The only exception I can think of is if you were creating your own database management system. If that's the case, maybe you could look at the source code of some open sourc... |
32,769,285 | I am trying to create an Android app that will change the volume and brightness of the user's device at a time either set by the user, or hard coded into the app itself.
I have searched on StackOverflow, but the closest I have got to is setting the brightness only in the app. I want the app to set the brightness and ... | 2015/09/24 | [
"https://Stackoverflow.com/questions/32769285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2105922/"
] | There two options to do this: quick but brute and longer but more elegant
A. Modify HttpResponse directly:
```
HttpContext.Current.Response.StatusCode = 401;
HttpContext.Current.Response.Write("some content");
```
B. Implement `IHttpActionResult` and set a `Content` property of a `HttpResponseMessage` in that class... | If you want to attach a message along with the 401 response, I think you should do it like this. This is how I did in my project:
```
public class TokenAuthenticationAttribute : AuthorizeAttribute
{
protected override bool IsAuthorized(HttpActionContext actionContext)
{
// Do your authentication here
... |
25,909,592 | i have a cookie which looks like this:
```
4+5+6+2+2+2+2+3+3+3+3+4+4+4+4+5+5+5+5+6+6+6+6+7+7+7+7+8+8+8+8+14+14+14+14+14+21+21+21+21+21
```
i need to remove specific characters based on user input.
so, for example, if i wanted to remove the number 2, it would look like this:
```
4+5+6+3+3+3+3+4+4+4+4+5+5+5+5+6+6+6+... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25909592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3136519/"
] | ```
$input="4+5+6+2+2+2+2+3+3+3+3+4+4+4+4+5+5+5+5+6+6+6+6+7+7+7+7+8+8+8+8+14+14+14+14+14+21+21+21+21+21";
$arr = explode('+',$input);
foreach($arr as $key=>$val){
if($val==2) unset($arr[$key]);
}
$out = implode('+', $arr);
echo $out;
``` | ```
$str = "4+5+6+2+2+2+2+3+3+3+3+4+4+4+4+5+5+5+5+6+6+6+6+7+7+7+7+8+8+8+8+14+14+14+14+14+21+21+21+21+21";
$res = '';
$str_arr = explode('+',$str);
foreach($str_arr as $key=>$val){
if($val!=2) {
$res.= $val.'+';
}
}
echo rtrim($res,'+');
``` |
25,909,592 | i have a cookie which looks like this:
```
4+5+6+2+2+2+2+3+3+3+3+4+4+4+4+5+5+5+5+6+6+6+6+7+7+7+7+8+8+8+8+14+14+14+14+14+21+21+21+21+21
```
i need to remove specific characters based on user input.
so, for example, if i wanted to remove the number 2, it would look like this:
```
4+5+6+3+3+3+3+4+4+4+4+5+5+5+5+6+6+6+... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25909592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3136519/"
] | ```
$input="4+5+6+2+2+2+2+3+3+3+3+4+4+4+4+5+5+5+5+6+6+6+6+7+7+7+7+8+8+8+8+14+14+14+14+14+21+21+21+21+21";
$arr = explode('+',$input);
foreach($arr as $key=>$val){
if($val==2) unset($arr[$key]);
}
$out = implode('+', $arr);
echo $out;
``` | ```
$cookie = "4+5+6+2+2+2+2+3+3+3+3+4+4+4+4+5+5+5+5+6+6+6+6+7+7+7+7+8+8+8+8+14+14+14+14+14+21+21+21+21+21";
$replaces = array("/\\+2\\b/","/^2\+/");
$cookie = preg_replace($replaces,"",$cookie);
echo $cookie;
``` |
43,867,072 | I've created custom pipe to filter my data from database
There is pipe
```
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'filter'
})
export class FilterPipe implements PipeTransform {
transform(aliases: any, term: any): any {
// check if search term is undefined
if (term === undefin... | 2017/05/09 | [
"https://Stackoverflow.com/questions/43867072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1204079/"
] | You don't have to write the exact `width` and `height`.
To scale the background image to fit inside its container, you can simply use:
```
background-size:contain;
``` | set
```
background-size: 100% 100%;
background-repeat: no-repeat;
``` |
43,867,072 | I've created custom pipe to filter my data from database
There is pipe
```
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'filter'
})
export class FilterPipe implements PipeTransform {
transform(aliases: any, term: any): any {
// check if search term is undefined
if (term === undefin... | 2017/05/09 | [
"https://Stackoverflow.com/questions/43867072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1204079/"
] | You don't have to write the exact `width` and `height`.
To scale the background image to fit inside its container, you can simply use:
```
background-size:contain;
``` | Use this javascript to get image width and height:
```
var img = new Image();
img.onload = function() {
alert(this.width + 'x' + this.height);
}
img.src = 'https://i.stack.imgur.com/4TObz.png';
``` |
43,867,072 | I've created custom pipe to filter my data from database
There is pipe
```
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'filter'
})
export class FilterPipe implements PipeTransform {
transform(aliases: any, term: any): any {
// check if search term is undefined
if (term === undefin... | 2017/05/09 | [
"https://Stackoverflow.com/questions/43867072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1204079/"
] | You don't have to write the exact `width` and `height`.
To scale the background image to fit inside its container, you can simply use:
```
background-size:contain;
``` | @Durga's answer fits your need.
However, letting the resource file to decide your DOM component size seems not to be the best practice, doing the opposite way (use css to auto fit the image to your container, as @Koby suggested) is usually preferred. |
27,282,007 | I am trying to create a UserPreferences table that will contain every combination of 5 boolean values and will have Entity Framework automatically manage saving and retrieving combinations so that; if an incoming combination of boolean values does not exist in the UserPreferences table it would be created, and if an in... | 2014/12/03 | [
"https://Stackoverflow.com/questions/27282007",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2509962/"
] | You want to create a Foreign Key.
To do this in Entity framework, change your classes to look like this. The `UserPreferencesID` tells us EF that Customer is strongly linked to a single UserPreferences. Applying `virtual` to the `Preferences` property will allow EF to auto-fill the value of the property from the table... | FWIW, I would not do it this way. It may sound like nitpicking, but this is not a normalized design. Who will guarantee that there will always be 5 booleans involved in user settings? What I would recommend is -
* To create a settings table as name-value pairs in which each user can have 5 records, currently. Maybe le... |
44,104,351 | I have my code for a simple activity to return to the main activity once the user clicks on the home button.
```
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_greetings);
// Set up onclicklistener for ho... | 2017/05/22 | [
"https://Stackoverflow.com/questions/44104351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5845351/"
] | Without your code really hard understand why you can not find by id, but I can offer this way:
HomeButtonActivity.java
```
public class HomeButtonActivity extends AppCompatActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
Button ... | create class e.g ReturnClass and create constructor for it, then pass Context as parameter e.g ReturnClass(Context context) then write
`Intent intent = new Intent(context , MainActivity.class);
context.startActivity(intent);`
from each activity you can call this class and pass activity to it , and ReturnClass return... |
37,192,732 | I have a date field that is numeric and displays as 201603 (CalendarYearMonth), for example. I want to be able to subtract 90 days from this date so that the end date is 201512 (RetentionYearMonth). I then need to reference the end date from another table. When I try to join the tables based on this date, they don't ma... | 2016/05/12 | [
"https://Stackoverflow.com/questions/37192732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3154648/"
] | The quotes are client-side, not server-side. Just put them directly in the client-side code like you would for any other string literal:
```
extension: '@string.Join("|", new FileHelper().ValidFileExtensions))'
``` | Declare variable in Your view like this:
```
@{
string validation = string.Format("\"{0}\"", string.Join("|", new FileHelper().ValidFileExtensions)));
}
```
And use like this:
```
extension: @validation
``` |
59,103,431 | I am trying to log some user data, namely some feedback from a dialog to application insights.
I want to basically show some statistics regarding the kind of feedback the bot gets on the app insights dashboard.
However, the documentation [<https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-telemetry?view... | 2019/11/29 | [
"https://Stackoverflow.com/questions/59103431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12456146/"
] | You can use JavaScript's [array filter function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) to iterate over all date objects. For each object, first convert the date string to an [internal date representation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Re... | you can try this function.I'm just comparing hours if you want to compare minutes and seconds then add one more level of if else
```js
const arr = [{dt: '2019-11-29 12:00:00'},{dt: '2019-11-29 3:0$.00:00'},{dt: '2019-11-30 12:00:00'},{dt: '2019-11-30 6:00:00'}];
console.log('without filter ===',arr)
let filteredArr... |
30,192,059 | hie am trying to select the integer value before the char C in my SQL database table which contains the information below.
```
240mm2 X 15C WIRING CABLE
150mm2 X 3C flex
10mm2 x 4C swa
```
so far i have used the query
```
select left ('C',CHARINDEX ('C',product_name)) from product
```
and i get 'C' on my result... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30192059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4887598/"
] | Two observations: the integer before "C" has a space before it and there is no space between the integer and "C".
If these are generally true, then you can do what you want using `substring_index()`:
```
select substring_index(substring_index(product_name, 'C', 1), ' ', -1) + 0 as thenumber
```
The `+ 0` simply con... | You could use a combination of instring and substring.
First get the position of the C
Then substring till C
It goes like this:
```
SELECT INSTR('foobarbar', 'bar');
= 4
```
And then you select substring from 1 to 4. |
30,192,059 | hie am trying to select the integer value before the char C in my SQL database table which contains the information below.
```
240mm2 X 15C WIRING CABLE
150mm2 X 3C flex
10mm2 x 4C swa
```
so far i have used the query
```
select left ('C',CHARINDEX ('C',product_name)) from product
```
and i get 'C' on my result... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30192059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4887598/"
] | Two observations: the integer before "C" has a space before it and there is no space between the integer and "C".
If these are generally true, then you can do what you want using `substring_index()`:
```
select substring_index(substring_index(product_name, 'C', 1), ' ', -1) + 0 as thenumber
```
The `+ 0` simply con... | If you're doing this in SQL Server you could try the following:
```
Select Substring(product_name,
PATINDEX('% [0-9]%',product_name) + 1,
PATINDEX('%[0-9]C%',product_name) - PATINDEX('% [0-9]%',product_name)
) as num
from Product
```
This assumes that there is a sp... |
30,192,059 | hie am trying to select the integer value before the char C in my SQL database table which contains the information below.
```
240mm2 X 15C WIRING CABLE
150mm2 X 3C flex
10mm2 x 4C swa
```
so far i have used the query
```
select left ('C',CHARINDEX ('C',product_name)) from product
```
and i get 'C' on my result... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30192059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4887598/"
] | If you're doing this in SQL Server you could try the following:
```
Select Substring(product_name,
PATINDEX('% [0-9]%',product_name) + 1,
PATINDEX('%[0-9]C%',product_name) - PATINDEX('% [0-9]%',product_name)
) as num
from Product
```
This assumes that there is a sp... | You could use a combination of instring and substring.
First get the position of the C
Then substring till C
It goes like this:
```
SELECT INSTR('foobarbar', 'bar');
= 4
```
And then you select substring from 1 to 4. |
608,873 | At my work as developer I do a lot of XML writing and parsing using C#. I have read very little about XAML, XSLT and XML schemas at Wikipedia and I don't see if they would make my XML-driven coding easier. Should I study any of these technologies? Which of them? Any other? | 2009/03/04 | [
"https://Stackoverflow.com/questions/608873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48465/"
] | They are all different.
* XAML is an example of data stored *in* xml (same as xhtml, etc), used in WCF/WPF/Silverlight etc
* XSLT is a declarative transformation language
* XML schemas (XSD) *define* valid xml
Each have different use-cases, and all are useful for different scenarios. XSD is worth knowing as it allows... | They are all useful, and it depends on the applications you work on, but for me, [XML Schema](http://en.wikipedia.org/wiki/Xml_schema) is crucial. It lets you define, more than does DTD, the structure of what your XML Documents should look like. You can define more detailed restrictions on what values elements and attr... |
5,728,821 | Hey, So I want to create a new tree which is basically the intersection (mathematical definition of intersection) of 2 given binary search trees. I have a method that prints out all the nodes at a particular level of the tree and I have a method that can find out the depth of the tree.I am pasting my work so far though... | 2011/04/20 | [
"https://Stackoverflow.com/questions/5728821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/530955/"
] | You have to traversal both trees in order at the same time and "in sync".
I'd suggest to implement the Iterable interface for your class. Then you get the first values from both trees. If they are equal, put it in the new tree, and get the next values from both iterators. If not, iterate the iterator with the smaller ... | The intersection of two trees is presumably the nodes that are in both trees?
Given that you'll have to explore the tree to do this, why not just do an in-order traversal, store the nodes and then do an intersection operation on ordered lists? |
5,728,821 | Hey, So I want to create a new tree which is basically the intersection (mathematical definition of intersection) of 2 given binary search trees. I have a method that prints out all the nodes at a particular level of the tree and I have a method that can find out the depth of the tree.I am pasting my work so far though... | 2011/04/20 | [
"https://Stackoverflow.com/questions/5728821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/530955/"
] | You have to traversal both trees in order at the same time and "in sync".
I'd suggest to implement the Iterable interface for your class. Then you get the first values from both trees. If they are equal, put it in the new tree, and get the next values from both iterators. If not, iterate the iterator with the smaller ... | My suggestion for such an intersection is simple:
Given tree A and tree B, to find tree C = A \intersect B:
1: Copy either tree A or B. Let us assume A for clarity.
This copy is now your tree C. Now let's 'trim' it.
2: For c = C.root\_node and b = B.root\_node:
if b==c,
Repeat the procedure with nodes ... |
5,728,821 | Hey, So I want to create a new tree which is basically the intersection (mathematical definition of intersection) of 2 given binary search trees. I have a method that prints out all the nodes at a particular level of the tree and I have a method that can find out the depth of the tree.I am pasting my work so far though... | 2011/04/20 | [
"https://Stackoverflow.com/questions/5728821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/530955/"
] | You have to traversal both trees in order at the same time and "in sync".
I'd suggest to implement the Iterable interface for your class. Then you get the first values from both trees. If they are equal, put it in the new tree, and get the next values from both iterators. If not, iterate the iterator with the smaller ... | For the recursive implementation of finding intersection of two binary search trees , I came up with the following code. I am not very sure of the time complexity, but it does work all right.
void BST::findIntersection(cell \*root1, cell \* root2) {
```
if(root1 == NULL ) {
// cout<<"Tree 1 node is null , returning... |
61,183,080 | When I am trying to play the video I am getting this exception below.
>
> \*\*\* Assertion failure in -[CustomSlider \_setValue:minValue:maxValue:andSendAction:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore/UIKit-3698.119.2/UISlider.m:1477
>
>
> \*\*\* Terminating app due to uncaught exception 'NSInte... | 2020/04/13 | [
"https://Stackoverflow.com/questions/61183080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5769997/"
] | The error message says that `maximumValue` is NaN (not-a-number), which means `newDurationSeconds` is not a number, which means `currentItem.duration.seconds` is not a number. Check to make sure it's not NaN before using it, like this:
```
[...]
guard currentItem.duration >= .zero, !currentItem.duration.seconds.isNaN ... | The slider's maximum value is nan which means the duration of your avPlayer is indefinite, you can get an estimate using:
```
let newDurationSeconds = Float(currentItem.asset.duration.seconds ?? 00)
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.