qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
5,751,040 | Could someone provide a list of html attributes that are allowed in a table? Not the normal ones like id, style, and class, but attributes that are specifically for tables like border, bgcolor (if it exists), and cellspacing. | 2011/04/21 | [
"https://Stackoverflow.com/questions/5751040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | <http://www.w3.org/TR/html4/struct/tables.html#h-11.2.1> | Check out the [w3 doc](http://www.w3.org/TR/html4/struct/tables.html#h-11.2.1). |
5,751,040 | Could someone provide a list of html attributes that are allowed in a table? Not the normal ones like id, style, and class, but attributes that are specifically for tables like border, bgcolor (if it exists), and cellspacing. | 2011/04/21 | [
"https://Stackoverflow.com/questions/5751040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | Do you want those in the standard or also non-standard ones?
I like the fact that this page differentiates, and it could be a good starting point:
<http://webdesign.about.com/od/tables/a/aa121597.htm> | <http://www.w3.org/TR/html4/struct/tables.html#h-11.2.1> |
5,751,040 | Could someone provide a list of html attributes that are allowed in a table? Not the normal ones like id, style, and class, but attributes that are specifically for tables like border, bgcolor (if it exists), and cellspacing. | 2011/04/21 | [
"https://Stackoverflow.com/questions/5751040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | Check out the [w3 doc](http://www.w3.org/TR/html4/struct/tables.html#h-11.2.1). | Have a look at <http://www.w3.org/TR/html4/struct/tables.html> |
5,751,040 | Could someone provide a list of html attributes that are allowed in a table? Not the normal ones like id, style, and class, but attributes that are specifically for tables like border, bgcolor (if it exists), and cellspacing. | 2011/04/21 | [
"https://Stackoverflow.com/questions/5751040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | Do you want those in the standard or also non-standard ones?
I like the fact that this page differentiates, and it could be a good starting point:
<http://webdesign.about.com/od/tables/a/aa121597.htm> | Have a look at <http://www.w3.org/TR/html4/struct/tables.html> |
5,751,040 | Could someone provide a list of html attributes that are allowed in a table? Not the normal ones like id, style, and class, but attributes that are specifically for tables like border, bgcolor (if it exists), and cellspacing. | 2011/04/21 | [
"https://Stackoverflow.com/questions/5751040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | Do you want those in the standard or also non-standard ones?
I like the fact that this page differentiates, and it could be a good starting point:
<http://webdesign.about.com/od/tables/a/aa121597.htm> | Check out the [w3 doc](http://www.w3.org/TR/html4/struct/tables.html#h-11.2.1). |
62,381,657 | I want you to give me a hand. My idea is to be able to search according to criteria. these criteria are related tables.
where I have a projects table and this has a relationship with the populations and departments table.
[enter image description here](https://i.stack.imgur.com/kpVF6.png)
```
table projects
id | nam... | 2020/06/15 | [
"https://Stackoverflow.com/questions/62381657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13323651/"
] | Try this one:
```html
SELECT p.id, p.name, p.year, pp.name, pp.id, dp.id, dp.name
FROM projects p
join departments_projects dp on p.id = dp.project_id
join population_projects pp on p.id = pp.project_id
WHERE
dp.name='florida' AND
pp.name='city' AND
p.year = 2019;
```
Let us know if it returns your expec... | Maybe you need join table?
```
select *
from projects p
join populations_project pp on p.id = pp.project_id
join departments_project dp on p.id = dp.project_id
where dp.name = 'florida'
and pp.name = 'city'
and p.year BETWEEN '2019' and '2020'
```
[SqlFiddle](http://sqlfiddle.com/#!9/20c410/7)
In you data fo... |
6,423,719 | Yes, I know there are dozens of problems like this but I think I have read them all and it still did not help me.
My project is based on well-known [ScottGu's MVC tutorial](http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvc-framework-part-4-handling-form-edit-and-post-scenarios.aspx).
This is the error I g... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6423719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/764659/"
] | Change the first line :
```
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SklepAlfa.Models.Produkty>" %>
```
to
```
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SklepAlfa.Models.Produtk... | Isn't it obvious?
**Action:**
```
ProdutkyNowyViewModel viewData = new ProdutkyNowyViewModel();
return View("Nowy", viewData);
```
**View:**
```
<%@ ... Inherits="System.Web.Mvc.ViewPage<SklepAlfa.Models.Produkty>" %>
```
Change the `Inherits` to match the type of `viewData`, or vice versa. |
12,203,012 | I'm writing a [regex](http://en.wikipedia.org/wiki/Regular_expression). At this point it allows any number of digits:
```
^(([1-9]*)|(([1-9]*).([0-9]*)))$
```
How do I allow exactly 64 digits at total? | 2012/08/30 | [
"https://Stackoverflow.com/questions/12203012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/873393/"
] | Try this regular expression:
```
^\d{64}$
```
[Rubular link](http://rubular.com/r/Ysm2U4yNJq)
But if you need a precision of 64 on a decimal number (as hinted from your regular expression in question), like the examples below,
```
235235236346345634644.4651346546213165498546516854985213242135355
235.23523634634563... | Replace the \* with {n,m} where n is the minimum matches and m is the maximum matches, for example {0,64}
Or yes, you can do {64} if you want to match exactly 64 (no less).
See this reference [Regular Expression Language - Quick Reference](http://msdn.microsoft.com/en-us/library/az24scfc.aspx) |
12,203,012 | I'm writing a [regex](http://en.wikipedia.org/wiki/Regular_expression). At this point it allows any number of digits:
```
^(([1-9]*)|(([1-9]*).([0-9]*)))$
```
How do I allow exactly 64 digits at total? | 2012/08/30 | [
"https://Stackoverflow.com/questions/12203012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/873393/"
] | Regex
-----
See it **[in action](http://regexr.com?320jr)**.
```
(?=^\d*\.?\d*$)^(\.?\d){64}$
```
Explanation
-----------
```
(?=^\d*\.?\d*$) # Can contain maximum one dot in total between digits
^(\.?\d){64}$ # Match exactly 64 digits, dot is optional
```
The second line causes it to match **64 digits... | Replace the \* with {n,m} where n is the minimum matches and m is the maximum matches, for example {0,64}
Or yes, you can do {64} if you want to match exactly 64 (no less).
See this reference [Regular Expression Language - Quick Reference](http://msdn.microsoft.com/en-us/library/az24scfc.aspx) |
12,203,012 | I'm writing a [regex](http://en.wikipedia.org/wiki/Regular_expression). At this point it allows any number of digits:
```
^(([1-9]*)|(([1-9]*).([0-9]*)))$
```
How do I allow exactly 64 digits at total? | 2012/08/30 | [
"https://Stackoverflow.com/questions/12203012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/873393/"
] | Try this regular expression:
```
^\d{64}$
```
[Rubular link](http://rubular.com/r/Ysm2U4yNJq)
But if you need a precision of 64 on a decimal number (as hinted from your regular expression in question), like the examples below,
```
235235236346345634644.4651346546213165498546516854985213242135355
235.23523634634563... | Try this regex: <http://regex101.com/r/qM9mO8>
`/^(?:\d{64}|(?=.*\.)(?!.*\..*\.)[\d.]{64})$/gm`
This regex will work for 64 consecutive digits or 63 digits and 1 dot.
I figured this was what you were looking for, considering your expression.
Good luck! |
12,203,012 | I'm writing a [regex](http://en.wikipedia.org/wiki/Regular_expression). At this point it allows any number of digits:
```
^(([1-9]*)|(([1-9]*).([0-9]*)))$
```
How do I allow exactly 64 digits at total? | 2012/08/30 | [
"https://Stackoverflow.com/questions/12203012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/873393/"
] | Regex
-----
See it **[in action](http://regexr.com?320jr)**.
```
(?=^\d*\.?\d*$)^(\.?\d){64}$
```
Explanation
-----------
```
(?=^\d*\.?\d*$) # Can contain maximum one dot in total between digits
^(\.?\d){64}$ # Match exactly 64 digits, dot is optional
```
The second line causes it to match **64 digits... | Try this regular expression:
```
^\d{64}$
```
[Rubular link](http://rubular.com/r/Ysm2U4yNJq)
But if you need a precision of 64 on a decimal number (as hinted from your regular expression in question), like the examples below,
```
235235236346345634644.4651346546213165498546516854985213242135355
235.23523634634563... |
12,203,012 | I'm writing a [regex](http://en.wikipedia.org/wiki/Regular_expression). At this point it allows any number of digits:
```
^(([1-9]*)|(([1-9]*).([0-9]*)))$
```
How do I allow exactly 64 digits at total? | 2012/08/30 | [
"https://Stackoverflow.com/questions/12203012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/873393/"
] | Regex
-----
See it **[in action](http://regexr.com?320jr)**.
```
(?=^\d*\.?\d*$)^(\.?\d){64}$
```
Explanation
-----------
```
(?=^\d*\.?\d*$) # Can contain maximum one dot in total between digits
^(\.?\d){64}$ # Match exactly 64 digits, dot is optional
```
The second line causes it to match **64 digits... | Try this regex: <http://regex101.com/r/qM9mO8>
`/^(?:\d{64}|(?=.*\.)(?!.*\..*\.)[\d.]{64})$/gm`
This regex will work for 64 consecutive digits or 63 digits and 1 dot.
I figured this was what you were looking for, considering your expression.
Good luck! |
38,910,653 | I have two arrays currPoints and prevPoints. Both are not necessarily the same size. I want to compare each element in currPoints with prevPoints and replace the value in prevPoints that is closest to the value in currPoints.
Example:
```
prevPoints{2,5,10,13,84,22}
currPoints{1,15,9,99}
```
After applying the algo... | 2016/08/12 | [
"https://Stackoverflow.com/questions/38910653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2717128/"
] | You need to sort both the arrays first. But remember the original orientation of the prevPoints array as you need to get the original array again at the end.
So after sorting:
```
prevPoints{2,5,10,13,22,84}
currPoints{1,9,15,99}
```
Now you basically need to figure out which of the **currPoints** should get into *... | We sort the first list by the x positions, and the second list by the y positions. So each point has a position in each list. Now the way you do this for a nearest neighbor search (at least what I came up with) is you find the position of the point in each list through a binary search. Then we know 4 directions, either... |
44,548,462 | I am trying to use ng2-charts with Angular 4.0 and I would like to have the same thing like here by using chart.js:
```
...
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.bundle.min.js"></script>
...
<canvas id="myChart" width="400" height="400"></canvas>
<script>
... | 2017/06/14 | [
"https://Stackoverflow.com/questions/44548462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6908215/"
] | Change your chart.js
to
```
<script src="node_modules/chart.js/dist/Chart.bundle.min.js"></script>
```
**app module ts code**
```
import { ChartsModule } from 'ng2-charts/ng2-charts';
// In your App's module:
imports: [
ChartsModule
]
```
**Update**
remove script tag in index.html and add in
check your **... | Aside adding the `chart.js` file to `.angular-cli.json`, you're only missing the `chartType` passed as an input to `baseChart`.
```
<canvas baseChart
[chartType]="'horizontalBar'"
[data]="chartData"
(chartHover)="chartHovered($event)"
(chartClick)="chartClicked($event)"></canvas>
``` |
44,548,462 | I am trying to use ng2-charts with Angular 4.0 and I would like to have the same thing like here by using chart.js:
```
...
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.bundle.min.js"></script>
...
<canvas id="myChart" width="400" height="400"></canvas>
<script>
... | 2017/06/14 | [
"https://Stackoverflow.com/questions/44548462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6908215/"
] | Change your chart.js
to
```
<script src="node_modules/chart.js/dist/Chart.bundle.min.js"></script>
```
**app module ts code**
```
import { ChartsModule } from 'ng2-charts/ng2-charts';
// In your App's module:
imports: [
ChartsModule
]
```
**Update**
remove script tag in index.html and add in
check your **... | import { ChartsModule } from 'ng2-charts/ng2-charts';
// In your App's module:
imports: [
ChartsModule
] |
44,548,462 | I am trying to use ng2-charts with Angular 4.0 and I would like to have the same thing like here by using chart.js:
```
...
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.bundle.min.js"></script>
...
<canvas id="myChart" width="400" height="400"></canvas>
<script>
... | 2017/06/14 | [
"https://Stackoverflow.com/questions/44548462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6908215/"
] | Aside adding the `chart.js` file to `.angular-cli.json`, you're only missing the `chartType` passed as an input to `baseChart`.
```
<canvas baseChart
[chartType]="'horizontalBar'"
[data]="chartData"
(chartHover)="chartHovered($event)"
(chartClick)="chartClicked($event)"></canvas>
``` | import { ChartsModule } from 'ng2-charts/ng2-charts';
// In your App's module:
imports: [
ChartsModule
] |
33,550,423 | I have a simple HTML table and I want to style one of the columns which I do with the following CSS.
```
.tableStyles tr td:first-child + td + td {
background-color:aquamarine
}
```
I would like to omit the first row from this so no styling is applied. I tried something like this but it doesnt work.
```
... | 2015/11/05 | [
"https://Stackoverflow.com/questions/33550423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2050577/"
] | For skipping the 1st element of a given type and styling the 2nd, 3rd and 4th elements etc, using
```
:nth-of-type(n+2)
```
is an efficient solution.
Consequently, try:
```
.tableStyles tr:nth-of-type(n+2) td:nth-of-type(3) {
background-color:aquamarine
}
``` | *:nth-child(n+2)* will select starting from the 2nd
.tableStyles tr:nth-child(n+2)
{
background-color:aquamarine
} |
55,183,216 | I have the byte representation of a character in a string, let's say the character is 'H', which has the byte value of 72. My string is therefore "72".
How do I go about converting this string ("72") into its corresponding character value ('H') based on the byte value (72) represented in my string using python 3.6?
P... | 2019/03/15 | [
"https://Stackoverflow.com/questions/55183216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9999594/"
] | In `__mul__` you do for some reason:
```
self.x = Vektor(self.x + digeri.x)
```
which is calling `Vektor.__init__` providing only the positional argument `x`, with the value `self.x + digeri.x`, but nothing for `y`, thus the error.
Also this attempts to change the attribute `x` into an object from `Vektor` itself, I... | The error is due to
```
self.x = Vektor(self.x + digeri.x)
```
When we call Vector like the way you write the syntax, it is thinking that you want to initialize it and it is expecting two inputs. Just get rid of the first two lines of mul function should fix the problem. |
55,183,216 | I have the byte representation of a character in a string, let's say the character is 'H', which has the byte value of 72. My string is therefore "72".
How do I go about converting this string ("72") into its corresponding character value ('H') based on the byte value (72) represented in my string using python 3.6?
P... | 2019/03/15 | [
"https://Stackoverflow.com/questions/55183216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9999594/"
] | How many arguments does `Vektor.__init__` require? Ignoring `self`, it's two - `x` and `y`.
When you wrote `return Vektor(self.x*digeri.x,self.y*digeri.y)`, you passed two arguments, so this works.
When you wrote `self.x = Vektor(self.x + digeri.x)`, this doesn't work, because you don't pass a second argument for the... | In `__mul__` you do for some reason:
```
self.x = Vektor(self.x + digeri.x)
```
which is calling `Vektor.__init__` providing only the positional argument `x`, with the value `self.x + digeri.x`, but nothing for `y`, thus the error.
Also this attempts to change the attribute `x` into an object from `Vektor` itself, I... |
55,183,216 | I have the byte representation of a character in a string, let's say the character is 'H', which has the byte value of 72. My string is therefore "72".
How do I go about converting this string ("72") into its corresponding character value ('H') based on the byte value (72) represented in my string using python 3.6?
P... | 2019/03/15 | [
"https://Stackoverflow.com/questions/55183216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9999594/"
] | How many arguments does `Vektor.__init__` require? Ignoring `self`, it's two - `x` and `y`.
When you wrote `return Vektor(self.x*digeri.x,self.y*digeri.y)`, you passed two arguments, so this works.
When you wrote `self.x = Vektor(self.x + digeri.x)`, this doesn't work, because you don't pass a second argument for the... | The error is due to
```
self.x = Vektor(self.x + digeri.x)
```
When we call Vector like the way you write the syntax, it is thinking that you want to initialize it and it is expecting two inputs. Just get rid of the first two lines of mul function should fix the problem. |
55,892,204 | How to read it using Newtonsoft.Json?
```
{
"192.168.0.12":
{
"Name":"12",
"Mode":"STOP"
},
"192.168.0.13":
{
"Name":"13",
"Mode":"STOP"
}
}
```
I am using this data class as below:
```
class Device{
public string Name;
public string Mode... | 2019/04/28 | [
"https://Stackoverflow.com/questions/55892204",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8796240/"
] | You can use dynamic object `var result = JsonConvert.DeserializeObject<dynamic>(json);`
Code to convert to Dictionary:
```
Dictionary<string, Device> devices = new Dictionary<string, Device>();
string json = "{\"192.168.0.12\": {\"Name\":\"12\",\"Mode\":\"STOP\"},\"192.168.0.13\": {\"Name\":\"13\",\"Mode\":\"STOP\"}}... | Try this, no need to use dynamic.
```
var json = "{
"192.168.0.12":
{
"Name":"12",
"Mode":"STOP"
},
"192.168.0.13":
{
"Name":"13",
"Mode":"STOP"
}
}";
var result = JsonConvert.DeserializeObject<Dictionary<string, Device>>(json);
foreach (var device... |
63,062,732 | I created an endpoint, and I want to display a message if I don't fill a specific parameter.
For example:
```
@NotNull(message = "The distance must be specified.")
@QueryParam("distance")
final double distance;
```
But for some reason I don't receive anything if I don't fill the field. Maybe because this is n... | 2020/07/23 | [
"https://Stackoverflow.com/questions/63062732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13423620/"
] | As double value can never be null, this never meets the criteria. If you try with a Wrapper class Double, then this should give your expected result.
```
@NotNull(message = "The distance must be specified.")
@QueryParam("distance")
final Double distance;
``` | `double` will always evaluate to `0` in case it doesn't exist, that's why `@NotNull` is not throwing an exception.
Use `Double` then if you don't send it, it will null. |
212,723 | My goal is to separate a full-color image into its luminance and chrominance ("color") components and display them as two images: 1) a black and white image (for the luminance) and 2) a color image (for the chrominance).
It would appear that the proper color space for this separation would be CMYK (cyan-magenta-yellow... | 2020/01/11 | [
"https://mathematica.stackexchange.com/questions/212723",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/9735/"
] | ```
img = Import["https://i.stack.imgur.com/2L3Hc.png"]
```
[](https://i.stack.imgur.com/2L3Hc.png)
You can also use [`ImageMultiply`](https://reference.wolfram.com/language/ref/ImageMultiply.html) or [`ImageApply`](https://reference.wolfram.com/lan... | I think I figured it out:
[](https://i.stack.imgur.com/c4nvR.png)
This re-combines the CMYK channels, but with the black channel effectively set to 0.
[](https://i.stack.imgur.com/t... |
212,723 | My goal is to separate a full-color image into its luminance and chrominance ("color") components and display them as two images: 1) a black and white image (for the luminance) and 2) a color image (for the chrominance).
It would appear that the proper color space for this separation would be CMYK (cyan-magenta-yellow... | 2020/01/11 | [
"https://mathematica.stackexchange.com/questions/212723",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/9735/"
] | Here's something that uses the [`"LAB"` colorspace](https://reference.wolfram.com/language/ref/LABColor.html):
```
butterfly = ColorConvert[Import["https://i.stack.imgur.com/2L3Hc.png"], "LAB";
```
To kill the color channels:
```
ImageMultiply[butterfly, {1, 0, 0}]
```
[](https://i.stack.imgur.com/c4nvR.png)
This re-combines the CMYK channels, but with the black channel effectively set to 0.
[](https://i.stack.imgur.com/t... |
212,723 | My goal is to separate a full-color image into its luminance and chrominance ("color") components and display them as two images: 1) a black and white image (for the luminance) and 2) a color image (for the chrominance).
It would appear that the proper color space for this separation would be CMYK (cyan-magenta-yellow... | 2020/01/11 | [
"https://mathematica.stackexchange.com/questions/212723",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/9735/"
] | ```
img = Import["https://i.stack.imgur.com/2L3Hc.png"]
```
[](https://i.stack.imgur.com/2L3Hc.png)
You can also use [`ImageMultiply`](https://reference.wolfram.com/language/ref/ImageMultiply.html) or [`ImageApply`](https://reference.wolfram.com/lan... | Here's something that uses the [`"LAB"` colorspace](https://reference.wolfram.com/language/ref/LABColor.html):
```
butterfly = ColorConvert[Import["https://i.stack.imgur.com/2L3Hc.png"], "LAB";
```
To kill the color channels:
```
ImageMultiply[butterfly, {1, 0, 0}]
```
[ and didn't find any.
Is there a quick way of setting this up? | 2009/04/22 | [
"https://Stackoverflow.com/questions/777825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91343/"
] | Bob,
Got something for you here. I created it a while back, just never made a post for it. It should be EXACTLY what your looking for.
[Top Posts / Top Comments Widgets](http://www.spoiledtechie.com/post/Top-Post-and-Top-Comment-Widgets-for-BlogEngineNet.aspx) | If it is for *you* to see (i.e. not an on-screen counter, but something you can look at separately): [Google analytics](http://www.google.com/analytics/), perhaps with [feedburner](http://feedburner.google.com) if you have an atom/rss feed.
Adding google analytics is simply a case of adding a few lines of script (that... |
777,825 | I am setting up a new blog and looked for a widget I could add that would give me the total number of views for a blog post (and it would be nice to find out the number of views in the last X days) and didn't find any.
Is there a quick way of setting this up? | 2009/04/22 | [
"https://Stackoverflow.com/questions/777825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91343/"
] | Bob,
Got something for you here. I created it a while back, just never made a post for it. It should be EXACTLY what your looking for.
[Top Posts / Top Comments Widgets](http://www.spoiledtechie.com/post/Top-Post-and-Top-Comment-Widgets-for-BlogEngineNet.aspx) | Check out Al Nyveldt's post [Most Popular Posts Extension and Widget](http://www.nyveldt.com/blog/post/Most-Popular-Posts-Extension-and-Widget.aspx). It does what you want in terms of counting. If you're willing to extend BlogEngine.NET, you can fairly easily consume the file his extension produces to display all posts... |
63,321,294 | How can I convert currency string like this `$123,456,78.3` to number like this `12345678.3`
I tried to do using this pattern
```
let str = "$123,456,78.3";
let newStr = str.replace(/\D/g, '');
```
but it replaces `.` too. | 2020/08/09 | [
"https://Stackoverflow.com/questions/63321294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13586013/"
] | ```
var str = "$123,456,78.3";
var newStr = Number(str.replace(/[^0-9.-]+/g,""));
``` | Use a lowercase `d`, and put it into a negated character group along with the `.`.
```js
let str = "$123,456,78.3";
let newStr = str.replace(/[^\d.]/g, '');
console.log(newStr)
``` |
63,321,294 | How can I convert currency string like this `$123,456,78.3` to number like this `12345678.3`
I tried to do using this pattern
```
let str = "$123,456,78.3";
let newStr = str.replace(/\D/g, '');
```
but it replaces `.` too. | 2020/08/09 | [
"https://Stackoverflow.com/questions/63321294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13586013/"
] | ```
var str = "$123,456,78.3";
var newStr = Number(str.replace(/[^0-9.-]+/g,""));
``` | You can use a negative character group:
```js
"$123,456,78.3".replace(/[^\d.]/g, "")
``` |
57,240 | I have the following output:
```
Generalized linear mixed model fit by the Laplace approximation
Formula: aph.remain ~ sMFS2 +sAG2 +sSHDI2 +sbare +season +crop +(1|landscape)
AIC BIC logLik deviance
4062 4093 -2022 4044
Random effects:
Groups Name Variance Std.Dev.
landscape (Intercept) 0.824... | 2013/04/25 | [
"https://stats.stackexchange.com/questions/57240",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/24841/"
] | The "correlation of fixed effects" output doesn't have the intuitive meaning that most would ascribe to it. Specifically, is not about the correlation of the variables (as OP notes). It is in fact about the expected correlation of the regression coefficients. Although this may speak to multicollinearity it does not nec... | If your negative and positive correlations are the same in their value and only their sign differ, you are entering the variable mistakenly. But I don't think this is the case for you as you already seem quite advanced in stats.
The inconsistency you are experiencing can be and is likely caused by multicollinearity. I... |
57,240 | I have the following output:
```
Generalized linear mixed model fit by the Laplace approximation
Formula: aph.remain ~ sMFS2 +sAG2 +sSHDI2 +sbare +season +crop +(1|landscape)
AIC BIC logLik deviance
4062 4093 -2022 4044
Random effects:
Groups Name Variance Std.Dev.
landscape (Intercept) 0.824... | 2013/04/25 | [
"https://stats.stackexchange.com/questions/57240",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/24841/"
] | It can be helpful to show that those correlations between fixed effects are obtained by converting the model's "vcov" to a correlation matrix. If `fit` is your fitted lme4 model, then
```
vc <- vcov(fit)
# diagonal matrix of standard deviations associated with vcov
S <- sqrt(diag(diag(vc), nrow(vc), nrow(vc)))
# con... | If your negative and positive correlations are the same in their value and only their sign differ, you are entering the variable mistakenly. But I don't think this is the case for you as you already seem quite advanced in stats.
The inconsistency you are experiencing can be and is likely caused by multicollinearity. I... |
57,240 | I have the following output:
```
Generalized linear mixed model fit by the Laplace approximation
Formula: aph.remain ~ sMFS2 +sAG2 +sSHDI2 +sbare +season +crop +(1|landscape)
AIC BIC logLik deviance
4062 4093 -2022 4044
Random effects:
Groups Name Variance Std.Dev.
landscape (Intercept) 0.824... | 2013/04/25 | [
"https://stats.stackexchange.com/questions/57240",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/24841/"
] | The "correlation of fixed effects" output doesn't have the intuitive meaning that most would ascribe to it. Specifically, is not about the correlation of the variables (as OP notes). It is in fact about the expected correlation of the regression coefficients. Although this may speak to multicollinearity it does not nec... | It can be helpful to show that those correlations between fixed effects are obtained by converting the model's "vcov" to a correlation matrix. If `fit` is your fitted lme4 model, then
```
vc <- vcov(fit)
# diagonal matrix of standard deviations associated with vcov
S <- sqrt(diag(diag(vc), nrow(vc), nrow(vc)))
# con... |
32,365,209 | I'm trying to implement Ajax functionality. I'm using Angular and I'd like to reuse a lot of Rails partials -- like forms -- that I already have. But from what I've learned from my research, Rails' `render` method cannot be accessed inside JavaScript housed in the asset pipeline.
What I have in mind is, after some eve... | 2015/09/03 | [
"https://Stackoverflow.com/questions/32365209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3048573/"
] | When I first started working with Angular and Rails, I tried to take the approach that you're trying right now. Unfortunately, this never produced acceptable results. The problem - Angular must always know what's going on with your data. When you render erb partials via AJAX, Angular and Rails do not communicate predic... | You can do something like this:
### routes:
```
get '/templates/*template' => 'templates#show'
```
### api controller:
```
class TemplatesController < ApplicationController
layout false
def show
if lookup_context.exists?("templates/#{params[:template]}")
render(template: "templates/#{params[:templat... |
56,971 | I posited this question to my geometry teacher in highschool many years ago, and it stumped her. I've recently brought it up again in conversations with friends and have not gotten any answer that's satisfactory. I have an intuitive feeling of what I expect, but I don't know enough to really back it up with solid reaso... | 2011/08/09 | [
"https://math.stackexchange.com/questions/56971",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/14398/"
] | If you start with two infinitely long lines, which intersect at a point that is a finite distance in front of you, and straighten them so that they are parallel, then the point of intersection will shoot off to infinity in finite time.
This may seem counterintuitive, but stuff like this happens when you have an infin... | If you have to circles intersecting in two points and you move them apart then there is a catastrophe happening at some moment: They will have only one point in common and in the next millisecond none. There is nothing mystical about this. In your case you have two lines, and they intersect in a point. Now you turn one... |
56,971 | I posited this question to my geometry teacher in highschool many years ago, and it stumped her. I've recently brought it up again in conversations with friends and have not gotten any answer that's satisfactory. I have an intuitive feeling of what I expect, but I don't know enough to really back it up with solid reaso... | 2011/08/09 | [
"https://math.stackexchange.com/questions/56971",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/14398/"
] | If you start with two infinitely long lines, which intersect at a point that is a finite distance in front of you, and straighten them so that they are parallel, then the point of intersection will shoot off to infinity in finite time.
This may seem counterintuitive, but stuff like this happens when you have an infin... | One unmentioned point is that there is a way to make precise your notion of the parallel lines intersecting at an angle of zero, but this does not imply that they intersect at a finite distance. That is the crux of the error in reasoning.
Stan Liou mentioned the projective plane in a comment. That is one possible way ... |
56,971 | I posited this question to my geometry teacher in highschool many years ago, and it stumped her. I've recently brought it up again in conversations with friends and have not gotten any answer that's satisfactory. I have an intuitive feeling of what I expect, but I don't know enough to really back it up with solid reaso... | 2011/08/09 | [
"https://math.stackexchange.com/questions/56971",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/14398/"
] | If you start with two infinitely long lines, which intersect at a point that is a finite distance in front of you, and straighten them so that they are parallel, then the point of intersection will shoot off to infinity in finite time.
This may seem counterintuitive, but stuff like this happens when you have an infin... | What might help you to get rid of the discontinuity – the lines seem to intersect, but when they are *really* parallel, they do not, that's a jump – is the notion of [projective geometry](https://en.wikipedia.org/wiki/Projective_geometry). You add a, putting in bluntly, "horizon" to the euclidean plane. Now **all** lin... |
56,971 | I posited this question to my geometry teacher in highschool many years ago, and it stumped her. I've recently brought it up again in conversations with friends and have not gotten any answer that's satisfactory. I have an intuitive feeling of what I expect, but I don't know enough to really back it up with solid reaso... | 2011/08/09 | [
"https://math.stackexchange.com/questions/56971",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/14398/"
] | One unmentioned point is that there is a way to make precise your notion of the parallel lines intersecting at an angle of zero, but this does not imply that they intersect at a finite distance. That is the crux of the error in reasoning.
Stan Liou mentioned the projective plane in a comment. That is one possible way ... | If you have to circles intersecting in two points and you move them apart then there is a catastrophe happening at some moment: They will have only one point in common and in the next millisecond none. There is nothing mystical about this. In your case you have two lines, and they intersect in a point. Now you turn one... |
56,971 | I posited this question to my geometry teacher in highschool many years ago, and it stumped her. I've recently brought it up again in conversations with friends and have not gotten any answer that's satisfactory. I have an intuitive feeling of what I expect, but I don't know enough to really back it up with solid reaso... | 2011/08/09 | [
"https://math.stackexchange.com/questions/56971",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/14398/"
] | One unmentioned point is that there is a way to make precise your notion of the parallel lines intersecting at an angle of zero, but this does not imply that they intersect at a finite distance. That is the crux of the error in reasoning.
Stan Liou mentioned the projective plane in a comment. That is one possible way ... | What might help you to get rid of the discontinuity – the lines seem to intersect, but when they are *really* parallel, they do not, that's a jump – is the notion of [projective geometry](https://en.wikipedia.org/wiki/Projective_geometry). You add a, putting in bluntly, "horizon" to the euclidean plane. Now **all** lin... |
2,884,332 | I'm building a 4 layered ASP.Net web application.
The layers are:
1. Data Layer
2. Entity Layer
3. Business Layer
4. UI Layer
The entity layer has my data model classes and is built from my entity data model (edmx file) in the datalayer using T4 templates (POCO). The entity layer is referenced in all other layers.
M... | 2010/05/21 | [
"https://Stackoverflow.com/questions/2884332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71904/"
] | `query` is lazy evaluated so the data is not retreived from the database until you enumerate it.
If you do:
```
return query.ToList();
```
you will force the query to be executed and avoid the problem.
You are receiving the error message because when the caller enumerates the collection, the ObjectContext (`dmc`) ... | You could call some method on the `query` object, for example
```
return query.AsEnumerable();
```
That should make sure you execute the query, thus making sure you don't need the object context later. |
2,884,332 | I'm building a 4 layered ASP.Net web application.
The layers are:
1. Data Layer
2. Entity Layer
3. Business Layer
4. UI Layer
The entity layer has my data model classes and is built from my entity data model (edmx file) in the datalayer using T4 templates (POCO). The entity layer is referenced in all other layers.
M... | 2010/05/21 | [
"https://Stackoverflow.com/questions/2884332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71904/"
] | `query` is lazy evaluated so the data is not retreived from the database until you enumerate it.
If you do:
```
return query.ToList();
```
you will force the query to be executed and avoid the problem.
You are receiving the error message because when the caller enumerates the collection, the ObjectContext (`dmc`) ... | In my opinion, this scenario has no relevance with AsEnumerable() or AsQueryable(). Try this;
```
public IEnumerable<SourceKey> Get(SourceKey sk, DataModelContainer dmc) {
var query = from SourceKey in dmc.SourceKeys
select SourceKey;
if (sk.sourceKey1 != null)
{
query = from... |
2,884,332 | I'm building a 4 layered ASP.Net web application.
The layers are:
1. Data Layer
2. Entity Layer
3. Business Layer
4. UI Layer
The entity layer has my data model classes and is built from my entity data model (edmx file) in the datalayer using T4 templates (POCO). The entity layer is referenced in all other layers.
M... | 2010/05/21 | [
"https://Stackoverflow.com/questions/2884332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71904/"
] | `query` is lazy evaluated so the data is not retreived from the database until you enumerate it.
If you do:
```
return query.ToList();
```
you will force the query to be executed and avoid the problem.
You are receiving the error message because when the caller enumerates the collection, the ObjectContext (`dmc`) ... | Don't use
```
return query.AsEnumerable();
```
use
```
return query.ToArray();
```
before disposing your context.
Returning AsEnumerable won't execute the foreach until the object is referenced. Converting it to an array ensures the foreach executes before your object is disposed. You may put your context in a ... |
2,884,332 | I'm building a 4 layered ASP.Net web application.
The layers are:
1. Data Layer
2. Entity Layer
3. Business Layer
4. UI Layer
The entity layer has my data model classes and is built from my entity data model (edmx file) in the datalayer using T4 templates (POCO). The entity layer is referenced in all other layers.
M... | 2010/05/21 | [
"https://Stackoverflow.com/questions/2884332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71904/"
] | You could call some method on the `query` object, for example
```
return query.AsEnumerable();
```
That should make sure you execute the query, thus making sure you don't need the object context later. | In my opinion, this scenario has no relevance with AsEnumerable() or AsQueryable(). Try this;
```
public IEnumerable<SourceKey> Get(SourceKey sk, DataModelContainer dmc) {
var query = from SourceKey in dmc.SourceKeys
select SourceKey;
if (sk.sourceKey1 != null)
{
query = from... |
2,884,332 | I'm building a 4 layered ASP.Net web application.
The layers are:
1. Data Layer
2. Entity Layer
3. Business Layer
4. UI Layer
The entity layer has my data model classes and is built from my entity data model (edmx file) in the datalayer using T4 templates (POCO). The entity layer is referenced in all other layers.
M... | 2010/05/21 | [
"https://Stackoverflow.com/questions/2884332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71904/"
] | Don't use
```
return query.AsEnumerable();
```
use
```
return query.ToArray();
```
before disposing your context.
Returning AsEnumerable won't execute the foreach until the object is referenced. Converting it to an array ensures the foreach executes before your object is disposed. You may put your context in a ... | In my opinion, this scenario has no relevance with AsEnumerable() or AsQueryable(). Try this;
```
public IEnumerable<SourceKey> Get(SourceKey sk, DataModelContainer dmc) {
var query = from SourceKey in dmc.SourceKeys
select SourceKey;
if (sk.sourceKey1 != null)
{
query = from... |
46,170,780 | I know only one way of setting localstorage in HTML5
`localStorage.name = "Peter Martin";`
But, in the following discussion I found that there are 2 other ways to set localstorage.
[localStorage - use getItem/setItem functions or access object directly?](https://stackoverflow.com/questions/13092715/localstorage-use... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2685914/"
] | This comes down to basic JavaScript syntax.
When you call `localStorage.setItem(city, "New York");`, you are referring to an identifier, `city`, which is not defined in the current scope. You should either define a variable named `city`, or just use the string `"city"` directly.
The same goes with `localStorage[count... | ```html
<html>
<head></head>
<body>
<button onclick="alpha()">Click Me</button>
<script>
function alpha(){
localStorage.name = "Peter Martin";
localStorage.setItem("city", "New York");
localStorage["country"] = "USA";
}
</script>
</body>
</html>
``` |
46,170,780 | I know only one way of setting localstorage in HTML5
`localStorage.name = "Peter Martin";`
But, in the following discussion I found that there are 2 other ways to set localstorage.
[localStorage - use getItem/setItem functions or access object directly?](https://stackoverflow.com/questions/13092715/localstorage-use... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2685914/"
] | >
> Can someone explain me out if all 3 methods are valid?
>
>
>
Yes they are (ish). localstorage like pretty much everything in Javascript is an object. You can access properties in an object in two ways:
```
object.property
object['property']
```
See [Property accessors in Javascript MDN](https://developer.mo... | ```html
<html>
<head></head>
<body>
<button onclick="alpha()">Click Me</button>
<script>
function alpha(){
localStorage.name = "Peter Martin";
localStorage.setItem("city", "New York");
localStorage["country"] = "USA";
}
</script>
</body>
</html>
``` |
46,170,780 | I know only one way of setting localstorage in HTML5
`localStorage.name = "Peter Martin";`
But, in the following discussion I found that there are 2 other ways to set localstorage.
[localStorage - use getItem/setItem functions or access object directly?](https://stackoverflow.com/questions/13092715/localstorage-use... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2685914/"
] | You can break it down into
1> properties or values
```
localStorage.name = "Peter Martin";
localStorage["name"] = "Peter Martin";
```
The 2nd version allows you to use a JavaScript variable. But is harder to read because one needs to determine what value is in the variable.
IE
```
var tag= "name";
localStorag... | ```html
<html>
<head></head>
<body>
<button onclick="alpha()">Click Me</button>
<script>
function alpha(){
localStorage.name = "Peter Martin";
localStorage.setItem("city", "New York");
localStorage["country"] = "USA";
}
</script>
</body>
</html>
``` |
46,170,780 | I know only one way of setting localstorage in HTML5
`localStorage.name = "Peter Martin";`
But, in the following discussion I found that there are 2 other ways to set localstorage.
[localStorage - use getItem/setItem functions or access object directly?](https://stackoverflow.com/questions/13092715/localstorage-use... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2685914/"
] | This comes down to basic JavaScript syntax.
When you call `localStorage.setItem(city, "New York");`, you are referring to an identifier, `city`, which is not defined in the current scope. You should either define a variable named `city`, or just use the string `"city"` directly.
The same goes with `localStorage[count... | >
> Can someone explain me out if all 3 methods are valid?
>
>
>
Yes they are (ish). localstorage like pretty much everything in Javascript is an object. You can access properties in an object in two ways:
```
object.property
object['property']
```
See [Property accessors in Javascript MDN](https://developer.mo... |
46,170,780 | I know only one way of setting localstorage in HTML5
`localStorage.name = "Peter Martin";`
But, in the following discussion I found that there are 2 other ways to set localstorage.
[localStorage - use getItem/setItem functions or access object directly?](https://stackoverflow.com/questions/13092715/localstorage-use... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2685914/"
] | This comes down to basic JavaScript syntax.
When you call `localStorage.setItem(city, "New York");`, you are referring to an identifier, `city`, which is not defined in the current scope. You should either define a variable named `city`, or just use the string `"city"` directly.
The same goes with `localStorage[count... | You can break it down into
1> properties or values
```
localStorage.name = "Peter Martin";
localStorage["name"] = "Peter Martin";
```
The 2nd version allows you to use a JavaScript variable. But is harder to read because one needs to determine what value is in the variable.
IE
```
var tag= "name";
localStorag... |
46,170,780 | I know only one way of setting localstorage in HTML5
`localStorage.name = "Peter Martin";`
But, in the following discussion I found that there are 2 other ways to set localstorage.
[localStorage - use getItem/setItem functions or access object directly?](https://stackoverflow.com/questions/13092715/localstorage-use... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2685914/"
] | >
> Can someone explain me out if all 3 methods are valid?
>
>
>
Yes they are (ish). localstorage like pretty much everything in Javascript is an object. You can access properties in an object in two ways:
```
object.property
object['property']
```
See [Property accessors in Javascript MDN](https://developer.mo... | You can break it down into
1> properties or values
```
localStorage.name = "Peter Martin";
localStorage["name"] = "Peter Martin";
```
The 2nd version allows you to use a JavaScript variable. But is harder to read because one needs to determine what value is in the variable.
IE
```
var tag= "name";
localStorag... |
53,736,738 | I am trying to scrape the info from this site <http://bepi.mpob.gov.my/index.php/en/summary-2/893-summary-2018.html>
to do some modeling however selenium doesn't seem to be able to get the table and by extension any tags in the table tr/td.
Here is my code
```
from selenium import webdriver
from pandas import DataFra... | 2018/12/12 | [
"https://Stackoverflow.com/questions/53736738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4294327/"
] | To retrieve the tag contents you have to induce *WebDriverWait* for the element with text as **Summary 2018** to be clickable and you can use the following solution:
* Code Block:
```
from selenium import webdriver
from bs4 import BeautifulSoup
from selenium.webdriver.common.by import By
from selenium.webdriver.suppo... | This happens because the source itself does not contain any of the data that you need. The data is probably fetched by `AJAX`, then what you see on the websites is rendered. With selenium, you can use `driver.find_elements_by_xpath()` (or by whatever is provided with selenium) to scrape html element stored in `tr` and ... |
53,736,738 | I am trying to scrape the info from this site <http://bepi.mpob.gov.my/index.php/en/summary-2/893-summary-2018.html>
to do some modeling however selenium doesn't seem to be able to get the table and by extension any tags in the table tr/td.
Here is my code
```
from selenium import webdriver
from pandas import DataFra... | 2018/12/12 | [
"https://Stackoverflow.com/questions/53736738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4294327/"
] | You can do this more quickly by using `requests` to grab the iframe URL and then `pandas` to grab the table at that url
```
import pandas as pd
import requests
from bs4 import BeautifulSoup
res = requests.get('http://bepi.mpob.gov.my/index.php/en/summary-2/893-summary-2018.html')
soup = BeautifulSoup(res.content, 'l... | This happens because the source itself does not contain any of the data that you need. The data is probably fetched by `AJAX`, then what you see on the websites is rendered. With selenium, you can use `driver.find_elements_by_xpath()` (or by whatever is provided with selenium) to scrape html element stored in `tr` and ... |
53,736,738 | I am trying to scrape the info from this site <http://bepi.mpob.gov.my/index.php/en/summary-2/893-summary-2018.html>
to do some modeling however selenium doesn't seem to be able to get the table and by extension any tags in the table tr/td.
Here is my code
```
from selenium import webdriver
from pandas import DataFra... | 2018/12/12 | [
"https://Stackoverflow.com/questions/53736738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4294327/"
] | You can do this more quickly by using `requests` to grab the iframe URL and then `pandas` to grab the table at that url
```
import pandas as pd
import requests
from bs4 import BeautifulSoup
res = requests.get('http://bepi.mpob.gov.my/index.php/en/summary-2/893-summary-2018.html')
soup = BeautifulSoup(res.content, 'l... | To retrieve the tag contents you have to induce *WebDriverWait* for the element with text as **Summary 2018** to be clickable and you can use the following solution:
* Code Block:
```
from selenium import webdriver
from bs4 import BeautifulSoup
from selenium.webdriver.common.by import By
from selenium.webdriver.suppo... |
48,475,312 | I have a list that is being appended in a loop from the different files (file\_1, file\_2, ..) I have.I initiate the list with zero to because I need to create a range that will start with 1:
```
a = [0] #here is the zero value created
a = [0, 8] #here is the list after open file 1
a = [0, 8, 20] #here is the... | 2018/01/27 | [
"https://Stackoverflow.com/questions/48475312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8424167/"
] | How about this:
```
range(sum(a[:-1]), sum(a))
``` | I'm not exactly sure what you mean with "file 1" "file 2" etc. I suppose you mean there's a file called file 1?
```
files = ['file 1', 'file 2', 'file 3']
a = [0, 8, 20, 23]
for i in range(len(a) - 1):
print('{} = {} - {}'.format(files[i], a[i] + 1, a[i + 1]))
``` |
11,447,931 | I have an application which is bascially a TabBar where the tabs are UINavigationControllers which move back and forth between different ViewControllers containing UIWebViews. My problem is that although I can click on the buttons for the UIWebViews, I can't scroll the content when it is larger than the screen.
Am cre... | 2012/07/12 | [
"https://Stackoverflow.com/questions/11447931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1081860/"
] | Fancybox has a callback onClose you can define in its parameters
please try to use:
```
$("#TARGET_ELEMENT").fancybox({
'OTHER_PARAM':'OTHER_PARAM_VALUE',
'onClosed': function() {
alert("FIRED_ON_CLOSE");
}
});
```
Happy coding! | `$("footer").toggleClass("down", 400);` is invalid jQuery code, toggleClass's second parameter must be a boolean <http://api.jquery.com/toggleClass/>. |
11,447,931 | I have an application which is bascially a TabBar where the tabs are UINavigationControllers which move back and forth between different ViewControllers containing UIWebViews. My problem is that although I can click on the buttons for the UIWebViews, I can't scroll the content when it is larger than the screen.
Am cre... | 2012/07/12 | [
"https://Stackoverflow.com/questions/11447931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1081860/"
] | `Fancybox v1` provides API with a `onClosed` method that's called when Fancybox closes.
`Fancybox v2` provides API with a `afterClose` method that's called when Fancybox closes.
The [**Tips & Tricks**](http://fancybox.net/blog) page has the method to use this public callback as seen below:
```
$("#tip5").fancybox(... | `$("footer").toggleClass("down", 400);` is invalid jQuery code, toggleClass's second parameter must be a boolean <http://api.jquery.com/toggleClass/>. |
32,724,344 | Im new to java and currently learning native methods, when I create following files :
**Main.java**:
```
public class Main {
public native int intMethod(int i);
public static void main(String[] args) {
System.loadLibrary("Main");
System.out.println(new Main().intMethod(2));
}
}
```
**Mai... | 2015/09/22 | [
"https://Stackoverflow.com/questions/32724344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5280154/"
] | When you generate the `.h` stub for native methods with `javah` it include the package and class name of the class. This is so you can have the same method name in different classes.
```
Java_Main_intMethod
```
needs to be renamed to
```
Java_troller_intMethod
```
You also have to change the method name if the cl... | I haven't worked on Java's native method and try to guess what could be the issue.
In the second comply and run command
-I${JAVA\_HOME}/include/linux **Main.c**
looks like it should have troller.c instead of Main.c |
32,724,344 | Im new to java and currently learning native methods, when I create following files :
**Main.java**:
```
public class Main {
public native int intMethod(int i);
public static void main(String[] args) {
System.loadLibrary("Main");
System.out.println(new Main().intMethod(2));
}
}
```
**Mai... | 2015/09/22 | [
"https://Stackoverflow.com/questions/32724344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5280154/"
] | When you generate the `.h` stub for native methods with `javah` it include the package and class name of the class. This is so you can have the same method name in different classes.
```
Java_Main_intMethod
```
needs to be renamed to
```
Java_troller_intMethod
```
You also have to change the method name if the cl... | If you want to rename Main to Troller you need to do it consistently. But your native library is still called libMain.so. So when you try to load the library troller, it fails because that's the wrong name.
And since your C file is now called troller.c, your gcc command either shouldn't work or you're compiling the wr... |
32,724,344 | Im new to java and currently learning native methods, when I create following files :
**Main.java**:
```
public class Main {
public native int intMethod(int i);
public static void main(String[] args) {
System.loadLibrary("Main");
System.out.println(new Main().intMethod(2));
}
}
```
**Mai... | 2015/09/22 | [
"https://Stackoverflow.com/questions/32724344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5280154/"
] | If you want to rename Main to Troller you need to do it consistently. But your native library is still called libMain.so. So when you try to load the library troller, it fails because that's the wrong name.
And since your C file is now called troller.c, your gcc command either shouldn't work or you're compiling the wr... | I haven't worked on Java's native method and try to guess what could be the issue.
In the second comply and run command
-I${JAVA\_HOME}/include/linux **Main.c**
looks like it should have troller.c instead of Main.c |
65,722,594 | Edit :: The output is added. I getting the output successfully, but I just don't know why I am getting this error. [](https://i.stack.imgur.com/2wrNM.png)I had already done this before but now I am facing this error. I had tried using "?" and "!!" but ... | 2021/01/14 | [
"https://Stackoverflow.com/questions/65722594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14646054/"
] | Give a `display:flex;` property to `nav` and it will work :) Then you can adjust other CSS accordingly.
You may also set `display:flex;` on `.nav-area`, then you don't need `inline-block` on `.nav-area li's`.
```
.nav-area {
list-style: none;
text-align: center;
display:flex;
align-items:center;
}
``... | I tried like this.
```
nav {
display: flex;
align-items: center;
justify-content: center;
}
```
If you want logo goes to left and nav-menu goes to right, try like this.
```
nav {
display: flex;
align-items: center;
justify-content: space-between;
}
``` |
65,722,594 | Edit :: The output is added. I getting the output successfully, but I just don't know why I am getting this error. [](https://i.stack.imgur.com/2wrNM.png)I had already done this before but now I am facing this error. I had tried using "?" and "!!" but ... | 2021/01/14 | [
"https://Stackoverflow.com/questions/65722594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14646054/"
] | Give a `display:flex;` property to `nav` and it will work :) Then you can adjust other CSS accordingly.
You may also set `display:flex;` on `.nav-area`, then you don't need `inline-block` on `.nav-area li's`.
```
.nav-area {
list-style: none;
text-align: center;
display:flex;
align-items:center;
}
``... | Add the float attribute to the `img` CSS declaration to obtain the desired lay-out.
```
img {
max-width: 100%;
height: auto;
float: left;
}
``` |
58,998,202 | I am trying to learn about concurrency and to do so I have been writing some programs. I have noticed, as I expected, that wall time does generally decrease when adding threads. However, I have also noticed that CPU time *increases* as the number of parallel tasks I run increases.
Is it because when there's only a sin... | 2019/11/22 | [
"https://Stackoverflow.com/questions/58998202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11342925/"
] | The CPU time is the time CPU spends executing instructions. This does not include wait times for I/O. If you have a single processor/core, then the wall time is CPU time plus I/O time.
For multiple cores, CPU time is measured as the total CPU time for all cores. So if you have a program with multiple threads, and if t... | Imagine you were trying to do two things, one at a time. You'd be pretty relaxed as you were doing each thing. But it would take you awhile.
Now imagine that you're trying to do two things at the same time. Presumably, it would take you less total time because sometimes you could make forward progress on both things a... |
921,880 | One thing that bothers me about nHibernate is that it is not 100% compile time tested.
If I rename a column in my database table, and I update the mapping file for that table, when I hit compile I should get errors in all my query code (hql/criteria whatever) of where I referenced that column name and how it is spelle... | 2009/05/28 | [
"https://Stackoverflow.com/questions/921880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | To achieve what you want I think your best solution is to use a combination of [Fluent NHibernate](http://fluentnhibernate.org/) and [nhlambdaextensions](http://code.google.com/p/nhlambdaextensions/). Fluent NHibernate will give you type-safe checking on your mapping files (so if you change a property on your entity, t... | Does NHibernate have the equivalent of the Java version's schema validator? In which case, you could add a step to your build process to build the session factory and run the validator-- building the session factory should also compile named queries, hence validating them too.
Hmm, looks like it supports something lik... |
921,880 | One thing that bothers me about nHibernate is that it is not 100% compile time tested.
If I rename a column in my database table, and I update the mapping file for that table, when I hit compile I should get errors in all my query code (hql/criteria whatever) of where I referenced that column name and how it is spelle... | 2009/05/28 | [
"https://Stackoverflow.com/questions/921880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | You won't get errors providing the Property names haven't changed, as most people use HQL for their queries in NHibernate.However if you do change the Property names and not the HQL you will indeed get broken queries, e.g.:
```
FROM User Where User.Surname = 'bob'
```
Change the Surname property to Lastname and it'l... | Hibernate uses dynamic byte code generation to create the mapping classes, based on the mapping configurations.
The fundamental point of ORM is to enable auto-magical mapping (bridge) between Objects and Relational systems. Thus: ORM. |
921,880 | One thing that bothers me about nHibernate is that it is not 100% compile time tested.
If I rename a column in my database table, and I update the mapping file for that table, when I hit compile I should get errors in all my query code (hql/criteria whatever) of where I referenced that column name and how it is spelle... | 2009/05/28 | [
"https://Stackoverflow.com/questions/921880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | You should look at [Castle ActiveRecord](http://www.castleproject.org/activerecord/index.html). I used this before and it allows you to not worry about the mapping files (.hml) as much. It lets you make your changes at the class level definitions, and the mappings files were generally untouched.
If you are writing bad... | Hibernate uses dynamic byte code generation to create the mapping classes, based on the mapping configurations.
The fundamental point of ORM is to enable auto-magical mapping (bridge) between Objects and Relational systems. Thus: ORM. |
921,880 | One thing that bothers me about nHibernate is that it is not 100% compile time tested.
If I rename a column in my database table, and I update the mapping file for that table, when I hit compile I should get errors in all my query code (hql/criteria whatever) of where I referenced that column name and how it is spelle... | 2009/05/28 | [
"https://Stackoverflow.com/questions/921880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | You won't get errors providing the Property names haven't changed, as most people use HQL for their queries in NHibernate.However if you do change the Property names and not the HQL you will indeed get broken queries, e.g.:
```
FROM User Where User.Surname = 'bob'
```
Change the Surname property to Lastname and it'l... | Does NHibernate have the equivalent of the Java version's schema validator? In which case, you could add a step to your build process to build the session factory and run the validator-- building the session factory should also compile named queries, hence validating them too.
Hmm, looks like it supports something lik... |
921,880 | One thing that bothers me about nHibernate is that it is not 100% compile time tested.
If I rename a column in my database table, and I update the mapping file for that table, when I hit compile I should get errors in all my query code (hql/criteria whatever) of where I referenced that column name and how it is spelle... | 2009/05/28 | [
"https://Stackoverflow.com/questions/921880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | To achieve what you want I think your best solution is to use a combination of [Fluent NHibernate](http://fluentnhibernate.org/) and [nhlambdaextensions](http://code.google.com/p/nhlambdaextensions/). Fluent NHibernate will give you type-safe checking on your mapping files (so if you change a property on your entity, t... | Hibernate uses dynamic byte code generation to create the mapping classes, based on the mapping configurations.
The fundamental point of ORM is to enable auto-magical mapping (bridge) between Objects and Relational systems. Thus: ORM. |
921,880 | One thing that bothers me about nHibernate is that it is not 100% compile time tested.
If I rename a column in my database table, and I update the mapping file for that table, when I hit compile I should get errors in all my query code (hql/criteria whatever) of where I referenced that column name and how it is spelle... | 2009/05/28 | [
"https://Stackoverflow.com/questions/921880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | To achieve what you want I think your best solution is to use a combination of [Fluent NHibernate](http://fluentnhibernate.org/) and [nhlambdaextensions](http://code.google.com/p/nhlambdaextensions/). Fluent NHibernate will give you type-safe checking on your mapping files (so if you change a property on your entity, t... | if you want to strongly type your objects rather than using xml config which can cause alot of runtime issues if not properly tested, I would look into FluentNHibernate which has convention maps that allow you to map your classes to data in code. Made my life alot easier especially when first starting with NHibernate w... |
921,880 | One thing that bothers me about nHibernate is that it is not 100% compile time tested.
If I rename a column in my database table, and I update the mapping file for that table, when I hit compile I should get errors in all my query code (hql/criteria whatever) of where I referenced that column name and how it is spelle... | 2009/05/28 | [
"https://Stackoverflow.com/questions/921880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | To achieve what you want I think your best solution is to use a combination of [Fluent NHibernate](http://fluentnhibernate.org/) and [nhlambdaextensions](http://code.google.com/p/nhlambdaextensions/). Fluent NHibernate will give you type-safe checking on your mapping files (so if you change a property on your entity, t... | You should look at [Castle ActiveRecord](http://www.castleproject.org/activerecord/index.html). I used this before and it allows you to not worry about the mapping files (.hml) as much. It lets you make your changes at the class level definitions, and the mappings files were generally untouched.
If you are writing bad... |
921,880 | One thing that bothers me about nHibernate is that it is not 100% compile time tested.
If I rename a column in my database table, and I update the mapping file for that table, when I hit compile I should get errors in all my query code (hql/criteria whatever) of where I referenced that column name and how it is spelle... | 2009/05/28 | [
"https://Stackoverflow.com/questions/921880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | You should look at [Castle ActiveRecord](http://www.castleproject.org/activerecord/index.html). I used this before and it allows you to not worry about the mapping files (.hml) as much. It lets you make your changes at the class level definitions, and the mappings files were generally untouched.
If you are writing bad... | if you want to strongly type your objects rather than using xml config which can cause alot of runtime issues if not properly tested, I would look into FluentNHibernate which has convention maps that allow you to map your classes to data in code. Made my life alot easier especially when first starting with NHibernate w... |
921,880 | One thing that bothers me about nHibernate is that it is not 100% compile time tested.
If I rename a column in my database table, and I update the mapping file for that table, when I hit compile I should get errors in all my query code (hql/criteria whatever) of where I referenced that column name and how it is spelle... | 2009/05/28 | [
"https://Stackoverflow.com/questions/921880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | To achieve what you want I think your best solution is to use a combination of [Fluent NHibernate](http://fluentnhibernate.org/) and [nhlambdaextensions](http://code.google.com/p/nhlambdaextensions/). Fluent NHibernate will give you type-safe checking on your mapping files (so if you change a property on your entity, t... | You won't get errors providing the Property names haven't changed, as most people use HQL for their queries in NHibernate.However if you do change the Property names and not the HQL you will indeed get broken queries, e.g.:
```
FROM User Where User.Surname = 'bob'
```
Change the Surname property to Lastname and it'l... |
921,880 | One thing that bothers me about nHibernate is that it is not 100% compile time tested.
If I rename a column in my database table, and I update the mapping file for that table, when I hit compile I should get errors in all my query code (hql/criteria whatever) of where I referenced that column name and how it is spelle... | 2009/05/28 | [
"https://Stackoverflow.com/questions/921880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | You should look at [Castle ActiveRecord](http://www.castleproject.org/activerecord/index.html). I used this before and it allows you to not worry about the mapping files (.hml) as much. It lets you make your changes at the class level definitions, and the mappings files were generally untouched.
If you are writing bad... | Does NHibernate have the equivalent of the Java version's schema validator? In which case, you could add a step to your build process to build the session factory and run the validator-- building the session factory should also compile named queries, hence validating them too.
Hmm, looks like it supports something lik... |
27,821,968 | I am uncertain if this is not possible or if I am just unable to find the solution.
I am trying to write a SQL stored procedure that will delete a number of items and return the list of unique identifiers for the deleted items.
By using a temporary table I can add select all the items I want to delete, add the ids ... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27821968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1566520/"
] | Below an example of what you want to achieve:
```
create table your_table
(
id int identity(1, 1) primary key,
value varchar(100)
);
insert into your_table (value) values
('hello'), ('from'), ('Mars'), ('!!!!');
create proc dbo.deleteByChar
(
@char char(1)
) as
begin
delete from your_table
outp... | If you are using trigger, there is `deleted` virtual table where you can find the id-s. Note that in case of `UPDATE` the id-s will exist in `deleted` table again. To detect `UPDATE` you can join `inserted` table. |
32,117,073 | This is the code :
```
QEventLoop eventLoop;
QNetworkAccessManager mgr();
QObject::connect(mgr, SIGNAL(finished(QNetworkReply*)), &eventLoop, SLOT(quit()));
QUrl url(site);
QNetworkRequest req(url);
QNetworkReply *reply = mgr.get(req);
eventLoop.exec();
if (reply->error() == QNetworkReply::NoError) {
cout << "Su... | 2015/08/20 | [
"https://Stackoverflow.com/questions/32117073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4571937/"
] | This is called [most vexing parse](https://en.wikipedia.org/wiki/Most_vexing_parse), the compiler thinks that `mgr` is a function declaration. To fix this, just change
```
QNetworkAccessManager mgr();
```
to
```
QNetworkAccessManager mgr;
```
You also have an error in your `connect`, it should look like this (n... | You have extra brackets. Use:
```
QNetworkAccessManager mgr;
```
`QNetworkAccessManager` does not have constructor without arguments, so parser understands it like function declaration.
Also you probably get warning in second line, like:
```
: warning: empty parentheses interpreted as a function declaration [-Wvexi... |
57,815,278 | Hi All!
=======
I'm currently working on a theming feature for a CSS Framework and have run into some issues that I'm hoping you might be able to help out with.
---
I have created a SASS Map called `$themes`, which contains colors for different themes. I copy-pasted some code from a medium article(who doesn't) and b... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57815278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12027829/"
] | Sass does not allow you to create variables on the fly – why you need to manually declare the variables in the global scope.
```
$themes: (
light: (
'text': dodgerblue,
'back': whitesmoke
),
dark: (
'text': white,
'back': darkviolet
)
);
@mixin themify($themes) {
@ea... | I would use such approach (its looks a bit simplier):
```
$themes-names: (
primary: (
background: $white,
color: $dark-grey,
font-size: 18px,
),
dark: (
background: $dark,
font-size: 10px,
)
);
$primaryName: "primary";
$darkName: "dark";
@function map-deep-get($... |
4,276 | I've the following problem:
>
> Let the camera opening angle be $\frac{3}{4}\pi$ and the window be $15 \times 15$ pixels large.
>
>
> Which pixels does the midpoint algorithm (*without* anti-aliasing) set for the line from $p\_1 = (1, 1, 4)$ to $p\_2 = (2, 1, 1)$, given in **global coordinates**?
>
>
>
My quest... | 2016/11/15 | [
"https://computergraphics.stackexchange.com/questions/4276",
"https://computergraphics.stackexchange.com",
"https://computergraphics.stackexchange.com/users/-1/"
] | When drawing objects that exist in 3D space to a 2D plane (like your monitor or an image), there are a number of spaces that are useful to work in:
* Global Coordinates - Somewhere in your 3D world there is an origin, and objects will be placed relative to that origin. The camera will also be placed somewhere relative... | I think the mention of "global coordinates" is a lead to the next lecture of learning different coordinate systems (object, camera, etc.), so you are kind of jumping a head I suppose (:
The points could indeed be given in local coordinates, which would then require definition of transformation from local to global coo... |
28,792,142 | I have a variable in one of my view
```
def ViewName(request):
simple_variable = request.session['value']
```
in the same views.py file,i have another view
```
def AnotherViewName(request):
--------------------
--------------------
```
now i want to use the variable `simple_variable` in my `AnotherV... | 2015/03/01 | [
"https://Stackoverflow.com/questions/28792142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2971215/"
] | I think you can do this way:
```
simple_variable = initial_value
def ViewName(request):
global simple_variable
simple_variable = value
...
def AnotherViewName(request):
global simple_variable
``` | There is no state shared between views as they probably runs in another thread. So if you want to share data between views you have to use a database, files, message-queues or sessions.
Here is another stackoverflow about this.
[How do you pass or share variables between django views?](https://stackoverflow.com/questi... |
28,792,142 | I have a variable in one of my view
```
def ViewName(request):
simple_variable = request.session['value']
```
in the same views.py file,i have another view
```
def AnotherViewName(request):
--------------------
--------------------
```
now i want to use the variable `simple_variable` in my `AnotherV... | 2015/03/01 | [
"https://Stackoverflow.com/questions/28792142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2971215/"
] | I think you can do this way:
```
simple_variable = initial_value
def ViewName(request):
global simple_variable
simple_variable = value
...
def AnotherViewName(request):
global simple_variable
``` | Or you can use a [session](https://docs.djangoproject.com/en/1.11/topics/http/sessions/#using-sessions-in-views).
```
def ViewName(request):
#retrieve your value
if 'value' in request.session:
simple_variable = request.session['value']
def AnotherViewName(request):
#set your varaible
req... |
28,792,142 | I have a variable in one of my view
```
def ViewName(request):
simple_variable = request.session['value']
```
in the same views.py file,i have another view
```
def AnotherViewName(request):
--------------------
--------------------
```
now i want to use the variable `simple_variable` in my `AnotherV... | 2015/03/01 | [
"https://Stackoverflow.com/questions/28792142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2971215/"
] | There is no state shared between views as they probably runs in another thread. So if you want to share data between views you have to use a database, files, message-queues or sessions.
Here is another stackoverflow about this.
[How do you pass or share variables between django views?](https://stackoverflow.com/questi... | Or you can use a [session](https://docs.djangoproject.com/en/1.11/topics/http/sessions/#using-sessions-in-views).
```
def ViewName(request):
#retrieve your value
if 'value' in request.session:
simple_variable = request.session['value']
def AnotherViewName(request):
#set your varaible
req... |
70,392 | Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM?
I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the fi... | 2008/09/16 | [
"https://Stackoverflow.com/questions/70392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11438/"
] | No free distributed version control system supports this. If you want this feature, you will have to implement it.
You can write off git: they are interested in raw performance for the Linux kernel development use case. It is improbable they would ever accept the performance trade-off in scaling to huge binary files. ... | BUP might be what you're looking for. It was built as an extension of git functionality for doing backups, but that's effectively the same thing. It breaks files into chunks and uses a rolling hash to make the file content addressable/do efficient storage.
* <https://github.com/bup/bup>
* <http://blogs.kde.org/node/44... |
70,392 | Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM?
I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the fi... | 2008/09/16 | [
"https://Stackoverflow.com/questions/70392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11438/"
] | BUP might be what you're looking for. It was built as an extension of git functionality for doing backups, but that's effectively the same thing. It breaks files into chunks and uses a rolling hash to make the file content addressable/do efficient storage.
* <https://github.com/bup/bup>
* <http://blogs.kde.org/node/44... | Does it have to be distributed? Supposedly the one big benefit subversion has to the newer, distributed VCSes is its superior ability to deal with binary files. |
70,392 | Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM?
I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the fi... | 2008/09/16 | [
"https://Stackoverflow.com/questions/70392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11438/"
] | No free distributed version control system supports this. If you want this feature, you will have to implement it.
You can write off git: they are interested in raw performance for the Linux kernel development use case. It is improbable they would ever accept the performance trade-off in scaling to huge binary files. ... | Does it have to be distributed? Supposedly the one big benefit subversion has to the newer, distributed VCSes is its superior ability to deal with binary files. |
70,392 | Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM?
I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the fi... | 2008/09/16 | [
"https://Stackoverflow.com/questions/70392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11438/"
] | I think it would be inefficient to store binary files in any form of version control system.
The better idea would be to store meta-data textfiles in the repository that reference the binary objects. | Does it have to be distributed? Supposedly the one big benefit subversion has to the newer, distributed VCSes is its superior ability to deal with binary files. |
70,392 | Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM?
I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the fi... | 2008/09/16 | [
"https://Stackoverflow.com/questions/70392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11438/"
] | No free distributed version control system supports this. If you want this feature, you will have to implement it.
You can write off git: they are interested in raw performance for the Linux kernel development use case. It is improbable they would ever accept the performance trade-off in scaling to huge binary files. ... | Yes, [Plastic SCM](http://www.plasticscm.com). It's distributed and it manages huge files in blocks of 4Mb so it's not limited by having to load them entirely on mem at any time. Find a tutorial on DVCS here:
<http://codicesoftware.blogspot.com/2010/03/distributed-development-for-windows.html> |
70,392 | Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM?
I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the fi... | 2008/09/16 | [
"https://Stackoverflow.com/questions/70392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11438/"
] | I think it would be inefficient to store binary files in any form of version control system.
The better idea would be to store meta-data textfiles in the repository that reference the binary objects. | I came to the conclusion that the best solution in this case would be to use the ZFS.
Yes ZFS is not a DVCS but:
* You can allocate space for repository via creating new FS
* You can track changes by creating snapshots
* You can send snapshots (commits) to another ZFS dataset |
70,392 | Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM?
I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the fi... | 2008/09/16 | [
"https://Stackoverflow.com/questions/70392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11438/"
] | No free distributed version control system supports this. If you want this feature, you will have to implement it.
You can write off git: they are interested in raw performance for the Linux kernel development use case. It is improbable they would ever accept the performance trade-off in scaling to huge binary files. ... | I came to the conclusion that the best solution in this case would be to use the ZFS.
Yes ZFS is not a DVCS but:
* You can allocate space for repository via creating new FS
* You can track changes by creating snapshots
* You can send snapshots (commits) to another ZFS dataset |
70,392 | Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM?
I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the fi... | 2008/09/16 | [
"https://Stackoverflow.com/questions/70392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11438/"
] | Does it have to be distributed? Supposedly the one big benefit subversion has to the newer, distributed VCSes is its superior ability to deal with binary files. | I came to the conclusion that the best solution in this case would be to use the ZFS.
Yes ZFS is not a DVCS but:
* You can allocate space for repository via creating new FS
* You can track changes by creating snapshots
* You can send snapshots (commits) to another ZFS dataset |
70,392 | Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM?
I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the fi... | 2008/09/16 | [
"https://Stackoverflow.com/questions/70392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11438/"
] | It's been 3 years since I asked this question, but, as of version 2.0 Mercurial includes the [largefiles extension](https://www.mercurial-scm.org/wiki/LargefilesExtension), which accomplishes what I was originally looking for:
>
> The largefiles extension allows for tracking large, incompressible binary files in Merc... | Yes, [Plastic SCM](http://www.plasticscm.com). It's distributed and it manages huge files in blocks of 4Mb so it's not limited by having to load them entirely on mem at any time. Find a tutorial on DVCS here:
<http://codicesoftware.blogspot.com/2010/03/distributed-development-for-windows.html> |
70,392 | Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM?
I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the fi... | 2008/09/16 | [
"https://Stackoverflow.com/questions/70392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11438/"
] | Yes, [Plastic SCM](http://www.plasticscm.com). It's distributed and it manages huge files in blocks of 4Mb so it's not limited by having to load them entirely on mem at any time. Find a tutorial on DVCS here:
<http://codicesoftware.blogspot.com/2010/03/distributed-development-for-windows.html> | I came to the conclusion that the best solution in this case would be to use the ZFS.
Yes ZFS is not a DVCS but:
* You can allocate space for repository via creating new FS
* You can track changes by creating snapshots
* You can send snapshots (commits) to another ZFS dataset |
11,056,088 | The following code basically works as expected. However, to be paranoid, I was wondering, to avoid resource leakage,
1. Do I need to call `HttpURLConnection.disconnect`, after finish its usage?
2. Do I need to call `InputStream.close`?
3. Do I need to call `InputStreamReader.close`?
4. Do I need to have the following ... | 2012/06/15 | [
"https://Stackoverflow.com/questions/11056088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72437/"
] | Yes you need to close the inputstream first and close httpconnection next. As per [javadoc](http://developer.android.com/reference/java/net/HttpURLConnection.html).
>
> Each HttpURLConnection instance is used to make a single request but the underlying network connection to the HTTP server may be transparently shared... | I believe the requirement for calling setDoInput() or setDoOutput() is to make sure they are called before anything is written to or read from a stream on the connection. Beyond that, I'm not sure it matters when those methods are called. |
34,670,433 | I have inconsistent behaviour from `show` in Julia, depending if it is called explicitly or from the REPL. What is the **one** method I can overload such that I always see the same output?
Specifically, I am defining a new type:
```
immutable Rigid3D{T<:Real}
rotation::ImmutableArrays.Matrix3x3{T}
translation... | 2016/01/08 | [
"https://Stackoverflow.com/questions/34670433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1867258/"
] | It seems `showarray` / `show` for arrays has some extra-super-special global variable "goodness" thrown in. One can get the output I want by setting some flags explicitly, as in
```
Base.showarray(io,trans.rotation,header=false,repr=true)
```
Follow up question: is this a good way to go about things? | As far as I understand, `show` is still the correct thing to overload, and indeed you have correctly overloaded `show` for your own type.
What seems to be happening is that `show` is not working correctly (?) for the type from the `ImmutableArrays` package. Since you did not provide working code, I was unable to creat... |
34,670,433 | I have inconsistent behaviour from `show` in Julia, depending if it is called explicitly or from the REPL. What is the **one** method I can overload such that I always see the same output?
Specifically, I am defining a new type:
```
immutable Rigid3D{T<:Real}
rotation::ImmutableArrays.Matrix3x3{T}
translation... | 2016/01/08 | [
"https://Stackoverflow.com/questions/34670433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1867258/"
] | [Section 45.3](http://docs.julialang.org/en/release-0.4/stdlib/io-network/?highlight=multimedia#multimedia-i-o) of Julia Doc contains related topics about Multimedia I/O, Refer to this section, the up most api to create output of an object is `display()` function, so anywhere calling `display()` directly could be a way... | As far as I understand, `show` is still the correct thing to overload, and indeed you have correctly overloaded `show` for your own type.
What seems to be happening is that `show` is not working correctly (?) for the type from the `ImmutableArrays` package. Since you did not provide working code, I was unable to creat... |
107,733 | I am going to Paris for a vacation with a few friends next month. I have my driving license issued in India. Can I drive a car there with this ID? If not, will any other ID let me to legally drive a car there? | 2018/01/03 | [
"https://travel.stackexchange.com/questions/107733",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/70027/"
] | You DO NOT need/want a car to explore Paris and nearby attractions.
Paris is (relatively) small and dense and has a good subway and bus network.
As a tourist, walking and using public transport is the way to go.
Everything is accessible by public transportation, even the major attractions outside Paris, Versailles, ... | Do you have an International Driving Permit? That's basically an official translation of your license, not a permit in its own right.
If so, you should be able to drive a car in France since France recognizes the IDP. |
12,367,986 | i' trying to create simple web-app, which will contain topics and comments.
Topic model:
```
@Entity
@Table(name = "T_TOPIC")
public class Topic {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
@ManyToOne
@JoinColumn(name="USER_ID")
private User author;
@Enumerated(Enum... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12367986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/959321/"
] | I think the simplest way is to extend `Zend\Form\View\Helper\FormElement`, handle your field types in your `render()` method and register your FormElement as default FormElement for your application/module. Assuming that you have your custom TestField that you would like to render:
```
namespace Application\Form\View\... | Seems like we're both running into Form issues with Zend. I think that it could be better integrated with the whole MVC structure.
I think that your approach is sound. What I might think of doing is the following
1. Give your elements a variable named helper like in ZF1.
2. Create the custom form element renderer t... |
12,367,986 | i' trying to create simple web-app, which will contain topics and comments.
Topic model:
```
@Entity
@Table(name = "T_TOPIC")
public class Topic {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
@ManyToOne
@JoinColumn(name="USER_ID")
private User author;
@Enumerated(Enum... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12367986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/959321/"
] | Get your hands on the `FormElement` view helper any way you can and `addType` to overwrite the view helper used. i.e. in view, just before you render your form:
```
<?php $this->plugin('FormElement')->addType('text', 'formcustom'); ?>
```
This will overwrite the view helper used in the `FormRow`,`FormCollection` he... | Seems like we're both running into Form issues with Zend. I think that it could be better integrated with the whole MVC structure.
I think that your approach is sound. What I might think of doing is the following
1. Give your elements a variable named helper like in ZF1.
2. Create the custom form element renderer t... |
12,367,986 | i' trying to create simple web-app, which will contain topics and comments.
Topic model:
```
@Entity
@Table(name = "T_TOPIC")
public class Topic {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
@ManyToOne
@JoinColumn(name="USER_ID")
private User author;
@Enumerated(Enum... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12367986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/959321/"
] | ----custom form element-----
```
namespace App\Form\View\Helper;
use Zend\Form\View\Helper\FormElement as ZendFormElement;
/**
* Description of FormElement
*/
class FormElement
extends ZendFormElement
{
public function addTypes(array $types)
{
foreach ($types as $type => $plugin) {
... | Seems like we're both running into Form issues with Zend. I think that it could be better integrated with the whole MVC structure.
I think that your approach is sound. What I might think of doing is the following
1. Give your elements a variable named helper like in ZF1.
2. Create the custom form element renderer t... |
12,367,986 | i' trying to create simple web-app, which will contain topics and comments.
Topic model:
```
@Entity
@Table(name = "T_TOPIC")
public class Topic {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
@ManyToOne
@JoinColumn(name="USER_ID")
private User author;
@Enumerated(Enum... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12367986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/959321/"
] | The following is what I've done and feels like the right level of keeping things separate and neat.
Given:
* A new element: MyModule\Form\MyElement which extends Zend\Form\Element
* A new view helper class for MyElement: MyModule\Form\View\Helper\FormMyElement which extends Zend\Form\View\Helper\AbstractHelper
Here'... | Seems like we're both running into Form issues with Zend. I think that it could be better integrated with the whole MVC structure.
I think that your approach is sound. What I might think of doing is the following
1. Give your elements a variable named helper like in ZF1.
2. Create the custom form element renderer t... |
12,367,986 | i' trying to create simple web-app, which will contain topics and comments.
Topic model:
```
@Entity
@Table(name = "T_TOPIC")
public class Topic {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
@ManyToOne
@JoinColumn(name="USER_ID")
private User author;
@Enumerated(Enum... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12367986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/959321/"
] | I think the simplest way is to extend `Zend\Form\View\Helper\FormElement`, handle your field types in your `render()` method and register your FormElement as default FormElement for your application/module. Assuming that you have your custom TestField that you would like to render:
```
namespace Application\Form\View\... | Get your hands on the `FormElement` view helper any way you can and `addType` to overwrite the view helper used. i.e. in view, just before you render your form:
```
<?php $this->plugin('FormElement')->addType('text', 'formcustom'); ?>
```
This will overwrite the view helper used in the `FormRow`,`FormCollection` he... |
12,367,986 | i' trying to create simple web-app, which will contain topics and comments.
Topic model:
```
@Entity
@Table(name = "T_TOPIC")
public class Topic {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
@ManyToOne
@JoinColumn(name="USER_ID")
private User author;
@Enumerated(Enum... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12367986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/959321/"
] | I think the simplest way is to extend `Zend\Form\View\Helper\FormElement`, handle your field types in your `render()` method and register your FormElement as default FormElement for your application/module. Assuming that you have your custom TestField that you would like to render:
```
namespace Application\Form\View\... | ----custom form element-----
```
namespace App\Form\View\Helper;
use Zend\Form\View\Helper\FormElement as ZendFormElement;
/**
* Description of FormElement
*/
class FormElement
extends ZendFormElement
{
public function addTypes(array $types)
{
foreach ($types as $type => $plugin) {
... |
12,367,986 | i' trying to create simple web-app, which will contain topics and comments.
Topic model:
```
@Entity
@Table(name = "T_TOPIC")
public class Topic {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
@ManyToOne
@JoinColumn(name="USER_ID")
private User author;
@Enumerated(Enum... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12367986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/959321/"
] | I think the simplest way is to extend `Zend\Form\View\Helper\FormElement`, handle your field types in your `render()` method and register your FormElement as default FormElement for your application/module. Assuming that you have your custom TestField that you would like to render:
```
namespace Application\Form\View\... | The following is what I've done and feels like the right level of keeping things separate and neat.
Given:
* A new element: MyModule\Form\MyElement which extends Zend\Form\Element
* A new view helper class for MyElement: MyModule\Form\View\Helper\FormMyElement which extends Zend\Form\View\Helper\AbstractHelper
Here'... |
31,439,104 | I have three classes that all implement analogues functionality but differ in subtle details. I wanted to create an abstract base class and move the code that is shared up. Now I'm stuck.
Each subclass has a `ListBuffer` that holds objects of another relation, that is a sublclass of some basic type. More concretely:
... | 2015/07/15 | [
"https://Stackoverflow.com/questions/31439104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have always do this on every API:
```
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
```
The first Line hide `ActionBar` and the second one hide `NotificationBar` | You should declare your code before setContentView() method in onCreate() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.