qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
30,739,144
All: Suppose I have two directives( dir1 and dir2) , which are both isolated scope. From some posts, I learnt that I need to use "require" to get scope of the other directive, but there is one question confused me so much: Suppose I use ng-repeat generated a lot of dir1 and dir2, how do I know in certain dir1, which specific dir2's controller scope is required( cos there are many dir2 and in my understanding, all those scopes in dir2 controller are independent to each other)? For example: ``` app.directive("dir1", function(){ var counter = 0; return { restrict:"AE", scope:{}, template: "<button class='dir1_btn'>highlight dir2_"+(couter++)+" </button>", link:function(scope, EL, attrs){ EL.find("button.dir1_btn").on("click", function(){ // How to let according dir2 know this click? }) } } }) app.directive("dir2", function(){ var counter = 0; return { restrict:"AE", scope:{}, template: "<span class='dir2_area'>This is dir2_"+(couter++)+" </span>", link:function(scope, EL, attrs){ // Maybe put something here to listening the event passed from dir1? } } }) ``` And the html like( for simple purpose, I just put 2 of each there, actually it will generated by ng-repeat) : ``` <dir1></dir1> <dir2></dir2> <dir1></dir1> <dir2></dir2> ``` Consider this just like the switch and light, dir1 is the switch to open(by change background-color) according light (dir2). > > In actual project, what I want to do is angularJS directive version > sidemenu and scrollContent, each item in sidemenu is a directive, > click it will make according content(another directive) to auto scroll > to top. > > > I wonder how to do this? I know this is easy in jQuery, just wondering how to hook this into AngularJS data-driven pattern. Thanks
2015/06/09
[ "https://Stackoverflow.com/questions/30739144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1647559/" ]
There's no hard rule, but sometimes you do have to do it. You will also need to do if you inherit from something or need the protocol declaration. In general I would restate the rule as "use forward declarations of @class and @protocol whenever possible."
If `ClassA` depends on `ClassB` such that a consumer of `ClassA` is certainly going to need to import `ClassB` in order to make use of `ClassA`, I would prefer header imports over forward declarations.
30,739,144
All: Suppose I have two directives( dir1 and dir2) , which are both isolated scope. From some posts, I learnt that I need to use "require" to get scope of the other directive, but there is one question confused me so much: Suppose I use ng-repeat generated a lot of dir1 and dir2, how do I know in certain dir1, which specific dir2's controller scope is required( cos there are many dir2 and in my understanding, all those scopes in dir2 controller are independent to each other)? For example: ``` app.directive("dir1", function(){ var counter = 0; return { restrict:"AE", scope:{}, template: "<button class='dir1_btn'>highlight dir2_"+(couter++)+" </button>", link:function(scope, EL, attrs){ EL.find("button.dir1_btn").on("click", function(){ // How to let according dir2 know this click? }) } } }) app.directive("dir2", function(){ var counter = 0; return { restrict:"AE", scope:{}, template: "<span class='dir2_area'>This is dir2_"+(couter++)+" </span>", link:function(scope, EL, attrs){ // Maybe put something here to listening the event passed from dir1? } } }) ``` And the html like( for simple purpose, I just put 2 of each there, actually it will generated by ng-repeat) : ``` <dir1></dir1> <dir2></dir2> <dir1></dir1> <dir2></dir2> ``` Consider this just like the switch and light, dir1 is the switch to open(by change background-color) according light (dir2). > > In actual project, what I want to do is angularJS directive version > sidemenu and scrollContent, each item in sidemenu is a directive, > click it will make according content(another directive) to auto scroll > to top. > > > I wonder how to do this? I know this is easy in jQuery, just wondering how to hook this into AngularJS data-driven pattern. Thanks
2015/06/09
[ "https://Stackoverflow.com/questions/30739144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1647559/" ]
If you've read such a rule, that rule is wrong. You can include (and import, which is just a safer way of include) things into your header, if that's something required for the interface declaration. Otherwise save it for the implementation files.
If `ClassA` depends on `ClassB` such that a consumer of `ClassA` is certainly going to need to import `ClassB` in order to make use of `ClassA`, I would prefer header imports over forward declarations.
11,875,828
I have 3 models, User, Army and Engineer. When a User creates an Army which belongs to them, they can check a checkbox called `siege` that will create an Engineer which belongs to that Army and User. I have a concern about mass assignment though. The Engineer gets created by my method in my Army model: ``` attr_reader :siege after_save :if_siege private def if_siege if self.siege Engineer.create!( :user_id => self.user.id, :army_id => self.id ) end end end ``` But the only way that I know of to have both of the ID's be assigned is to do this in my Engineer model: ``` class Engineer attr_accessible :user_id, :army_id ``` This doesn't seem safe even though engineers can never be created on a form but will automatically be created by a link or checkbox. The ideal is Auto-assign these two attributes like whats done in the controller. e.g. `example = current_user.examples.build(params[:example])` What do you think? Is their an alternative to this design? Mass assignment is a tricky issue for me.....
2012/08/09
[ "https://Stackoverflow.com/questions/11875828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/604023/" ]
What's wrong with: ``` engineer = Engineer.new engineer.user_id = self.user.id engineer.army_id = self.id engineer.save! ``` You could alternatively specify that you don't care about the mass assignment issues here only: ``` params = { :user_id => self.user.id, :army_id => self.id } Engineer.create!(params, without_protection: true) ```
Why do you need to relate the Engineer to the User explicitly? If you related the Engineer to the Army, wouldn't that Engineer get the relationship through Army to the User?
667,056
Here is the code. ``` \documentclass[12pt,letterpaper]{article} \usepackage[left=20mm,top=30mm,bottom=30mm,right=20mm]{geometry} \usepackage[siunitx]{circuitikz} % circuit package and include electrical units in our labels \begin{document} \begin{center} \begin{circuitikz} [american voltages] \draw (5,0) to (5,3) to [V, v<=15<\volt>, a = $V_{source}$] (-1,3) -- (-1,0) -- (1,0) to [pR, l = $Load$, a = 50k$\Omega$] (3,0) -- (5,0) ; \end{circuitikz} \end{center} \end{document} ``` The resistor marked in red box is what I want to achieve. I have tried to use `rotate` and `yscale`, but both of them don't work for me. And how can I adjust the length of the resistor? [![Enter image description here](https://i.stack.imgur.com/r17zC.png)](https://i.stack.imgur.com/r17zC.png)
2022/11/30
[ "https://tex.stackexchange.com/questions/667056", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/206160/" ]
As supplement to @marijn answer: [![enter image description here](https://i.stack.imgur.com/uu5u1.png)](https://i.stack.imgur.com/uu5u1.png) ``` \documentclass[12pt,margin=3mm]{standalone} \usepackage[siunitx]{circuitikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{circuitikz} [american voltages, > = Straight Barb ] \ctikzset{resistors/width=1.6, resistors/zigs=7} \draw (0,0) to [V=15<\volt>, a = $V_{\mathrm{source}}$] ++ (-4,0) -- ++ (0,-3) to [pR, a = Load, l = 50<\kilo\ohm>, mirror, name=R] ++ (4,0) -- (0,0) ; \draw[|<->, transform canvas={yshift=0.5mm}] (R.north west) -- node[fill=white, inner sep=0pt] {$V_{\mathrm{th}}$} (R.wiper); \end{circuitikz} \end{document} ```
The longer resistor is described in the CircuiTikZ [manual](http://mirrors.ctan.org/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf) on page 52: > > For the american style resistors, you can change the number of "zig-zags" by setting the key `resistors/zigs` (default value 3). > > > In the manual this sentence is followed by a code example which I repeated in the MWE below. Switching the labels and annotations can be done using `l_` instead of `l` for a label below the element and `a^` instead of `a` for an annotation above the element. Putting the arrow on the other side can be done using the `mirror` key. Note: since you load the `siunitx` option for `circuitikz` it would make sense to use this not only for Volt but also for kOhm, which improves the spacing a bit. MWE: ``` \documentclass[12pt,letterpaper]{article} \usepackage[left=20mm,top=30mm,bottom=30mm,right=20mm]{geometry} \usepackage[siunitx]{circuitikz} % circuit package and include electrical units in our labels \begin{document} \begin{center} \begin{circuitikz} [american voltages, longpot/.style = {pR, resistors/scale=0.75, resistors/width=1.6, resistors/zigs=6}] \draw (5,0) to (5,3) to [V, v<=15<\volt>, a = $V_{source}$] (-1,3) -- (-1,0) -- (1,0) to [longpot, l_ = $Load$, a^ = \qty{50}{\kohm}, mirror] (3,0) -- (5,0) ; \end{circuitikz} \end{center} \end{document} ``` Result: [![enter image description here](https://i.stack.imgur.com/0gFMz.png)](https://i.stack.imgur.com/0gFMz.png)
248,040
I have interfaced [M25P16](https://www.micron.com/~/media/documents/.../m25p16.pdf) with PIC32MX795F512L. MISO and CS is pulled up to VCC with 10k resistor. I am sending the 0x9f (MSB first) command for reading device ID and after that 20 dummy bytes are transmitted for generating clock for receiving bytes. But I'm getting unexpected noise pulses on MISO pin as shown in image below. [![waveform](https://i.stack.imgur.com/v68dt.jpg)](https://i.stack.imgur.com/v68dt.jpg) I have selected clock mode as 1 (i.e. CPOL = 0 and CPHA = 1). I'm sampling input in middle of clock. One more thing HOLD# and W# are directly connected to VCC(3.3 V). Do I need to make changes in W# and HOLD# states?
2016/07/26
[ "https://electronics.stackexchange.com/questions/248040", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/117832/" ]
I not sure if this problem was solved, I had exactly the same problem as you two days ago and nothing on the internet I found helped, it seems everyone had a unique problem expect yours... After 2 days of debugging I found the solution, its very simple.. the chip 3.3V tolerant (power supply and input signals.. they NOT 5V tolerant!), if your input signals is NOT 3.3v i.e (Input CLOCK, CS, MOSI, MISO) the flash chip will not respond. All I did was use a level translation using a 74HC4050, it is always a good test to make sure communication is 100% by sending a device id request to the chip, then proceeding to working with memory writes and reads. Funny, after two days of exceeding the input signals with a 5V input the chip still works, maybe internally some sort of (undocumented) protection clamp was active. I hope this helps.
It looks like the flash memory is trying to respond to the command, but can't. I would check that there are no conflicts with the MISO pin. Make sure that some other peripheral on your microcontroller isn't using the MISO pin, that the MISO pin is not shorted to another pin, and make sure there is not a problem with any other device on the SPI bus.
21,385,369
I need to check whether the Property contains one of the or all following strings **"C-I", "C-II", "C-III", "C-IV", "C-V"** if not it Errormessage must be **"Invalid Property. Must be blank or C-I, C-II, C-III, C-IV, or C-V.",** i don know which "DataAnnotation Attribute" to use and How? if possible please provide sample.
2014/01/27
[ "https://Stackoverflow.com/questions/21385369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2114018/" ]
You could use the [Regular Expression](http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.regularexpressionattribute%28v=vs.110%29.aspx) data annotation. However, I would recommend implementing `IValidatableObject` on your data class. You can then write your custom logic within the `Validate` method. This way, if/when those valid options change, you would just be modifying a collection, rather then trying to figure out a new valid regex statement.
It can be done using anyone of the follwing Attributes \*\* > > 1.EnumDataTypeAttribute > 2.CustomValidationAttribute > 3. Creating New Custom Attribute. > > > \*\*
1,976,129
Given a regular curve $\gamma \colon I \to \mathbb{R}^n$, if we consider the variable $t \in I \subset \mathbb{R}$ as the time, then we have the usual interpretation of $\gamma'(t)$ as the (instantaneous) velocity vector at the position $\gamma(t)$ and $\lvert\gamma'(t)\rvert$ as the speed (or scalar velocity). From this point of view, we know from differential geometry (very classical examples, indeed) that there are curves that "go through infinite length in a bounded amount of time". Of course, at these examples, the speed of these curves increase infinitely ("goes to infinity"). I have very rough ideas concerning Relativity Theory (I'm a mathematician, not a physicist) but I know that, for example, the speed a object can reach is bounded by the speed of light, and that mass, lengths and even the time are distorted at very high speed (near the speed of light). As I said, I'm not an expert on this subject, so maybe my question even make sense, but what axioms do I insert to my models in order to get such results, from a purely mathematical/axiomatic point of view? Is the answer to this "the Einstein postulates"? I want to know also if there is an area which study this kind of "differential geometry + relativity" (or even a "Riemannian geometry + relativity"). Would the answer to this question be simply "Relativity"? (as I said, I don't have a deep knowledge on that). (Is there) Do you recommend any references at this subject?
2016/10/19
[ "https://math.stackexchange.com/questions/1976129", "https://math.stackexchange.com", "https://math.stackexchange.com/users/177211/" ]
In (special) relativity $\mathbb{R}^n$ comes with a different metric, with signature $(-,+, \ldots +)$. The mathematical study of manifolds with a Lorentzian metric is called lorentzian geometry, or pseudo-Riemannian geometry or semi-Riemannian geometry (the latter are more general as it refers to any metric which is not definite positive). A generic Lorentzian manifold is still not a spacetime model in General Relativity, for that you also need it to satisfy Einstein equations $G=8\pi T$. Mathematical references are O'Neill "Semi-Riemannian Geometry With Applications to Relativity" Beem, Ehrlich "Global Lorentzian geometry"
Initially ignore the effects of spacetime curvature (general relativity). Consider a homogeneous (flat) real four-dimensional space. If the distance between a pair of points is given by a definite (Euclidean) quadratic form, the symmetries of space include the usual orthogonal symmetry group $\mathrm{O}(4)$ and translations (producing the [Euclidean group](https://en.wikipedia.org/wiki/Euclidean_group) $\mathrm{E}(4)$). The only difference in going to special relativity is that the quadratic form is indefinite (Lorentzian), which results in the indefinite orthogonal symmetry group $\mathrm{O}(1,3)$ and translations (producing the [Poincaré group](https://en.wikipedia.org/wiki/Poincar%C3%A9_group)). Rotations just behave a little differently, but should still be thought of as a symmetry group of four dimensional space. Everything about parameterization of curves and velocities follows directly from this - indeed, all of the geometry of special relativity follows. A pitfall to avoid is thinking of time as universal; it is specific to the coordinate system. If you extend this local picture to differential manifolds, and you add Einstein's equation that relates the curvature of spacetime to its content (specifically the stress-energy tensor), you have general relativity. As an aside, just as dropping the parallel postulate of Euclidean geometry produces elliptic and hyperbolic geometries, Einstein's postulates for special relativity allow for "non-flat" (de Sitter and anti-de Sitter) geometries, with symmetry groups $\mathrm{O}(1,4)$ and $\mathrm{O}(2,3)$ respectively.
1,976,129
Given a regular curve $\gamma \colon I \to \mathbb{R}^n$, if we consider the variable $t \in I \subset \mathbb{R}$ as the time, then we have the usual interpretation of $\gamma'(t)$ as the (instantaneous) velocity vector at the position $\gamma(t)$ and $\lvert\gamma'(t)\rvert$ as the speed (or scalar velocity). From this point of view, we know from differential geometry (very classical examples, indeed) that there are curves that "go through infinite length in a bounded amount of time". Of course, at these examples, the speed of these curves increase infinitely ("goes to infinity"). I have very rough ideas concerning Relativity Theory (I'm a mathematician, not a physicist) but I know that, for example, the speed a object can reach is bounded by the speed of light, and that mass, lengths and even the time are distorted at very high speed (near the speed of light). As I said, I'm not an expert on this subject, so maybe my question even make sense, but what axioms do I insert to my models in order to get such results, from a purely mathematical/axiomatic point of view? Is the answer to this "the Einstein postulates"? I want to know also if there is an area which study this kind of "differential geometry + relativity" (or even a "Riemannian geometry + relativity"). Would the answer to this question be simply "Relativity"? (as I said, I don't have a deep knowledge on that). (Is there) Do you recommend any references at this subject?
2016/10/19
[ "https://math.stackexchange.com/questions/1976129", "https://math.stackexchange.com", "https://math.stackexchange.com/users/177211/" ]
In (special) relativity $\mathbb{R}^n$ comes with a different metric, with signature $(-,+, \ldots +)$. The mathematical study of manifolds with a Lorentzian metric is called lorentzian geometry, or pseudo-Riemannian geometry or semi-Riemannian geometry (the latter are more general as it refers to any metric which is not definite positive). A generic Lorentzian manifold is still not a spacetime model in General Relativity, for that you also need it to satisfy Einstein equations $G=8\pi T$. Mathematical references are O'Neill "Semi-Riemannian Geometry With Applications to Relativity" Beem, Ehrlich "Global Lorentzian geometry"
This question is more about physics than about math, so I hope you will bear with a physicist for posting an answer. The OP expressed the following doubt: > > ...Of course, at these examples, the speed of these curves increase infinitely ("goes to infinity"). ... what axioms do I insert to my models in order to get such results, from a purely mathematical/axiomatic point of view? Is the answer to this "the Einstein postulates"? > > > or, in other words, is there an extra requirement that space-time manifolds ought to satisfy, as compared to generic manifolds with the same signature as the Lorenzian metric, in order to prevent the existence of superluminal motions? If this is indeed your worry, then no, there are no other requirements which distinguish a space-time manifold from another manifold (with the same signature): it is a matter of *interpretation*. Since the metric is not positive-definite, there will be geodesics with $ds^2 = 0$, $ds^2 > 0$, $ds^2 < 0$. The geodesics with $ds^2 = 0$ (called *null* geodesics) describe the motion of photons. An interval $ds^2 < 0$ can always be rewritten, thru a change of coordinates, as $-dt^2 < 0$, which shows the separation to be *time-like*, and intervals with $ds^2 > 0$ can likewise always be expressed as $dx^2 > 0$, which shows the interval to be *space-like*. Now, the superluminal curves you refer to do exist in a space-time manifold: they are the curves on which, at least somewhere, $ds^2 > 0$, but they are not interpreted as the space-time motion of any physical observer, exactly because they are superluminal. Only time-like geodesics, *i.e.* those with $ds^2 < 0$, are possible paths for physical, subluminal observers. A graphical way to represent this is to consider the bundle of null geodesics (both future-oriented and past-oriented) going thru a given space-time point $P$. This bundle is composed of two hypercones (the future-oriented null geodesics, and the past-oriented null geodesics) with vertices joining at $P$. All points within the cones may be joined to $P$ by a time-like (hence, subluminal) curve, thus providing a nice, coordinate independent characterization of the past and future of $P$. Points lying outside both cones are not causally related to $P$,because they require superluminal motions to be connected to it. But they do play an important role in physics: a 3-dimensional hypersurface thru $P$ but lying otherwise wholly outside the null cones **of all of its points** provides an adequate surface for setting up boundary conditions for a time-dependent problem (like the evolution of the Universe) for obvious reasons of causality. **EDIT**: As for reading suggestions, there are at least two books by physicists which I consider eminently suitable to mathematicians: first, [The large scale structure of spacetime](http://rads.stackoverflow.com/amzn/click/0521099064) by Hawking and Ellis, and then [General Relativity](http://rads.stackoverflow.com/amzn/click/0226870332) by R. Wald. Both are classic texts; that by H&E focuses on on the study of singularities, while the one by Wald is wider in scope. But H&E also contains very interesting discussions about the properties of special solutions (like Taub-NUT space, or Godel's rotating Universe) which will at some point enjoy a comeback, IMHO. Basically the two, which have a large amount of material in common, complement each other very well in the remaining parts.
1,976,129
Given a regular curve $\gamma \colon I \to \mathbb{R}^n$, if we consider the variable $t \in I \subset \mathbb{R}$ as the time, then we have the usual interpretation of $\gamma'(t)$ as the (instantaneous) velocity vector at the position $\gamma(t)$ and $\lvert\gamma'(t)\rvert$ as the speed (or scalar velocity). From this point of view, we know from differential geometry (very classical examples, indeed) that there are curves that "go through infinite length in a bounded amount of time". Of course, at these examples, the speed of these curves increase infinitely ("goes to infinity"). I have very rough ideas concerning Relativity Theory (I'm a mathematician, not a physicist) but I know that, for example, the speed a object can reach is bounded by the speed of light, and that mass, lengths and even the time are distorted at very high speed (near the speed of light). As I said, I'm not an expert on this subject, so maybe my question even make sense, but what axioms do I insert to my models in order to get such results, from a purely mathematical/axiomatic point of view? Is the answer to this "the Einstein postulates"? I want to know also if there is an area which study this kind of "differential geometry + relativity" (or even a "Riemannian geometry + relativity"). Would the answer to this question be simply "Relativity"? (as I said, I don't have a deep knowledge on that). (Is there) Do you recommend any references at this subject?
2016/10/19
[ "https://math.stackexchange.com/questions/1976129", "https://math.stackexchange.com", "https://math.stackexchange.com/users/177211/" ]
Initially ignore the effects of spacetime curvature (general relativity). Consider a homogeneous (flat) real four-dimensional space. If the distance between a pair of points is given by a definite (Euclidean) quadratic form, the symmetries of space include the usual orthogonal symmetry group $\mathrm{O}(4)$ and translations (producing the [Euclidean group](https://en.wikipedia.org/wiki/Euclidean_group) $\mathrm{E}(4)$). The only difference in going to special relativity is that the quadratic form is indefinite (Lorentzian), which results in the indefinite orthogonal symmetry group $\mathrm{O}(1,3)$ and translations (producing the [Poincaré group](https://en.wikipedia.org/wiki/Poincar%C3%A9_group)). Rotations just behave a little differently, but should still be thought of as a symmetry group of four dimensional space. Everything about parameterization of curves and velocities follows directly from this - indeed, all of the geometry of special relativity follows. A pitfall to avoid is thinking of time as universal; it is specific to the coordinate system. If you extend this local picture to differential manifolds, and you add Einstein's equation that relates the curvature of spacetime to its content (specifically the stress-energy tensor), you have general relativity. As an aside, just as dropping the parallel postulate of Euclidean geometry produces elliptic and hyperbolic geometries, Einstein's postulates for special relativity allow for "non-flat" (de Sitter and anti-de Sitter) geometries, with symmetry groups $\mathrm{O}(1,4)$ and $\mathrm{O}(2,3)$ respectively.
This question is more about physics than about math, so I hope you will bear with a physicist for posting an answer. The OP expressed the following doubt: > > ...Of course, at these examples, the speed of these curves increase infinitely ("goes to infinity"). ... what axioms do I insert to my models in order to get such results, from a purely mathematical/axiomatic point of view? Is the answer to this "the Einstein postulates"? > > > or, in other words, is there an extra requirement that space-time manifolds ought to satisfy, as compared to generic manifolds with the same signature as the Lorenzian metric, in order to prevent the existence of superluminal motions? If this is indeed your worry, then no, there are no other requirements which distinguish a space-time manifold from another manifold (with the same signature): it is a matter of *interpretation*. Since the metric is not positive-definite, there will be geodesics with $ds^2 = 0$, $ds^2 > 0$, $ds^2 < 0$. The geodesics with $ds^2 = 0$ (called *null* geodesics) describe the motion of photons. An interval $ds^2 < 0$ can always be rewritten, thru a change of coordinates, as $-dt^2 < 0$, which shows the separation to be *time-like*, and intervals with $ds^2 > 0$ can likewise always be expressed as $dx^2 > 0$, which shows the interval to be *space-like*. Now, the superluminal curves you refer to do exist in a space-time manifold: they are the curves on which, at least somewhere, $ds^2 > 0$, but they are not interpreted as the space-time motion of any physical observer, exactly because they are superluminal. Only time-like geodesics, *i.e.* those with $ds^2 < 0$, are possible paths for physical, subluminal observers. A graphical way to represent this is to consider the bundle of null geodesics (both future-oriented and past-oriented) going thru a given space-time point $P$. This bundle is composed of two hypercones (the future-oriented null geodesics, and the past-oriented null geodesics) with vertices joining at $P$. All points within the cones may be joined to $P$ by a time-like (hence, subluminal) curve, thus providing a nice, coordinate independent characterization of the past and future of $P$. Points lying outside both cones are not causally related to $P$,because they require superluminal motions to be connected to it. But they do play an important role in physics: a 3-dimensional hypersurface thru $P$ but lying otherwise wholly outside the null cones **of all of its points** provides an adequate surface for setting up boundary conditions for a time-dependent problem (like the evolution of the Universe) for obvious reasons of causality. **EDIT**: As for reading suggestions, there are at least two books by physicists which I consider eminently suitable to mathematicians: first, [The large scale structure of spacetime](http://rads.stackoverflow.com/amzn/click/0521099064) by Hawking and Ellis, and then [General Relativity](http://rads.stackoverflow.com/amzn/click/0226870332) by R. Wald. Both are classic texts; that by H&E focuses on on the study of singularities, while the one by Wald is wider in scope. But H&E also contains very interesting discussions about the properties of special solutions (like Taub-NUT space, or Godel's rotating Universe) which will at some point enjoy a comeback, IMHO. Basically the two, which have a large amount of material in common, complement each other very well in the remaining parts.
41,653,013
I have several versions of Java on my Gentoo: ``` $ java-config --list-available-vms The following VMs are available for generation-2: 1) IcedTea JDK 7.2.6.7 [icedtea-bin-7] 2) IcedTea JDK 3.1.0 [icedtea-bin-8] 3) Oracle JDK 1.8.0.112 [oracle-jdk-bin-1.8] ``` When I have settings like this, my Android Studio doesn't even starts.Shows these messages: ``` android-studio Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0 Looking in classpath from com.intellij.util.lang.UrlClassLoader@736e9adb for /com/sun/jna/linux-x86-64/libjnidispatch.so Found library resource at jar:file:/opt/android-studio/lib/jna.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so Trying /home/user/.AndroidStudio2.2/system/tmp/jna6767094858258384499.tmp Found jnidispatch at /home/user/.AndroidStudio2.2/system/tmp/jna6767094858258384499.tmp [ 277] ERROR - llij.ide.plugins.PluginManager - sun.font.FreetypeFontScaler.initIDs(Ljava/lang/Class;)V java.lang.UnsatisfiedLinkError: sun.font.FreetypeFontScaler.initIDs(Ljava/lang/Class;)V at sun.font.FreetypeFontScaler.initIDs(Native Method) at sun.font.FreetypeFontScaler.<clinit>(FreetypeFontScaler.java:50) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at sun.font.FontScaler.<clinit>(FontScaler.java:98) at sun.font.TrueTypeFont.getScaler(TrueTypeFont.java:1298) at sun.font.FileFontStrike.<init>(FileFontStrike.java:179) at sun.font.FileFont.createStrike(FileFont.java:95) at sun.font.Font2D.getStrike(Font2D.java:359) at sun.font.Font2D.getStrike(Font2D.java:308) at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:78) at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:93) at sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:359) at sun.font.FontDesignMetrics.<init>(FontDesignMetrics.java:350) at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:302) at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1113) at javax.swing.JComponent.getFontMetrics(JComponent.java:1626) at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:372) at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:345) at javax.swing.plaf.basic.BasicLabelUI.paint(BasicLabelUI.java:163) at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161) at javax.swing.JComponent.paintComponent(JComponent.java:780) at com.intellij.ui.Splash$1.paintComponent(Splash.java:78) at javax.swing.JComponent.paint(JComponent.java:1056) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JLayeredPane.paint(JLayeredPane.java:586) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5217) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579) at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502) at javax.swing.RepaintManager.paint(RepaintManager.java:1272) at javax.swing.JComponent.paint(JComponent.java:1042) at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39) at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:79) at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:116) at java.awt.Container.paint(Container.java:1975) at java.awt.Window.paint(Window.java:3904) at javax.swing.RepaintManager$4.run(RepaintManager.java:842) at javax.swing.RepaintManager$4.run(RepaintManager.java:814) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789) at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738) at javax.swing.RepaintManager.access$1200(RepaintManager.java:64) at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [ 282] ERROR - llij.ide.plugins.PluginManager - Android Studio 2.2.2 Build #AI-145.3360264 [ 282] ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_112 [ 282] ERROR - llij.ide.plugins.PluginManager - VM: Java HotSpot(TM) 64-Bit Server VM [ 282] ERROR - llij.ide.plugins.PluginManager - Vendor: Oracle Corporation [ 282] ERROR - llij.ide.plugins.PluginManager - OS: Linux Start Failed: Internal Error. Please report to https://code.google.com/p/android/issues java.lang.UnsatisfiedLinkError: sun.font.FreetypeFontScaler.initIDs(Ljava/lang/Class;)V at sun.font.FreetypeFontScaler.initIDs(Native Method) at sun.font.FreetypeFontScaler.<clinit>(FreetypeFontScaler.java:50) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at sun.font.FontScaler.<clinit>(FontScaler.java:98) at sun.font.TrueTypeFont.getScaler(TrueTypeFont.java:1298) at sun.font.FileFontStrike.<init>(FileFontStrike.java:179) at sun.font.FileFont.createStrike(FileFont.java:95) at sun.font.Font2D.getStrike(Font2D.java:359) at sun.font.Font2D.getStrike(Font2D.java:308) at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:78) at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:93) at sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:359) at sun.font.FontDesignMetrics.<init>(FontDesignMetrics.java:350) at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:302) at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1113) at javax.swing.JComponent.getFontMetrics(JComponent.java:1626) at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:372) at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:345) at javax.swing.plaf.basic.BasicLabelUI.paint(BasicLabelUI.java:163) at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161) at javax.swing.JComponent.paintComponent(JComponent.java:780) at com.intellij.ui.Splash$1.paintComponent(Splash.java:78) at javax.swing.JComponent.paint(JComponent.java:1056) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JLayeredPane.paint(JLayeredPane.java:586) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5217) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579) at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502) at javax.swing.RepaintManager.paint(RepaintManager.java:1272) at javax.swing.JComponent.paint(JComponent.java:1042) at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39) at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:79) at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:116) at java.awt.Container.paint(Container.java:1975) at java.awt.Window.paint(Window.java:3904) at javax.swing.RepaintManager$4.run(RepaintManager.java:842) at javax.swing.RepaintManager$4.run(RepaintManager.java:814) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789) at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738) at javax.swing.RepaintManager.access$1200(RepaintManager.java:64) at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) Also, an UI exception occurred on attempt to show above message: java.lang.NoClassDefFoundError: Could not initialize class sun.font.FontScaler at sun.font.TrueTypeFont.getScaler(TrueTypeFont.java:1298) at sun.font.FileFontStrike.<init>(FileFontStrike.java:179) at sun.font.FileFont.createStrike(FileFont.java:95) at sun.font.Font2D.getStrike(Font2D.java:359) at sun.font.Font2D.getStrike(Font2D.java:308) at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:78) at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:93) at sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:359) at sun.font.FontDesignMetrics.<init>(FontDesignMetrics.java:350) at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:302) at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1113) at javax.swing.JComponent.getFontMetrics(JComponent.java:1626) at javax.swing.text.GlyphPainter1.sync(GlyphPainter1.java:226) at javax.swing.text.GlyphPainter1.getSpan(GlyphPainter1.java:59) at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:592) at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:732) at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:233) at javax.swing.text.ParagraphView.calculateMinorAxisRequirements(ParagraphView.java:717) at javax.swing.text.BoxView.checkRequests(BoxView.java:935) at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:568) at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:903) at javax.swing.text.BoxView.checkRequests(BoxView.java:935) at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:343) at javax.swing.text.BoxView.layout(BoxView.java:708) at javax.swing.text.BoxView.setSize(BoxView.java:397) at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1722) at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:917) at javax.swing.JComponent.getPreferredSize(JComponent.java:1662) at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:1333) at javax.swing.text.JTextComponent.getPreferredScrollableViewportSize(JTextComponent.java:1937) at javax.swing.ViewportLayout.preferredLayoutSize(ViewportLayout.java:93) at java.awt.Container.preferredSize(Container.java:1796) at java.awt.Container.getPreferredSize(Container.java:1780) at javax.swing.JComponent.getPreferredSize(JComponent.java:1664) at javax.swing.ScrollPaneLayout.preferredLayoutSize(ScrollPaneLayout.java:492) at java.awt.Container.preferredSize(Container.java:1796) at java.awt.Container.getPreferredSize(Container.java:1780) at javax.swing.JComponent.getPreferredSize(JComponent.java:1664) at com.intellij.idea.Main.showMessage(Main.java:370) at com.intellij.idea.Main.showMessage(Main.java:335) at com.intellij.idea.Main.showMessage(Main.java:314) at com.intellij.ide.plugins.PluginManager.processException(PluginManager.java:141) at com.intellij.ide.IdeEventQueue.processException(IdeEventQueue.java:407) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:369) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) ``` It works only with IcedTea version. But when I'm trying to use lambda expressions in IcedTea Java, I have an error message: ``` Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details. ``` In order to allow JDK 1.8 I added to Gradle: ``` compileOptions { sourceCompatibility 1.8 } ``` Can somebody help me with this Android Studio configuration?
2017/01/14
[ "https://Stackoverflow.com/questions/41653013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5940806/" ]
I have tried bunch of different solution (f.e. calculating view direction with PageTransformer and so on.) but they usually doesn't work very well. You may get wrong direction if you are on first/last tab. You may not get any direction if the page is moved by viewpager itself instead of user's swipe ... In the end there is really simple solution which is absolutely "bug-proof" :) . ``` new ViewPager.OnPageChangeListener() { private float lastPositionAndOffsetSum = 0f; @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { if (position + positionOffset == lastPositionAndOffsetSum) { //IT'S NOT MOVING } else if (position + positionOffset > lastPositionAndOffsetSum) { //RIGHT TO LEFT } else { //LEFT TO RIGTH } lastPositionAndOffsetSum = position + positionOffset } @Override public void onPageSelected(int position) {} @Override public void onPageScrollStateChanged(int state) {} }); ``` Please let me know if you have any questions.
Set setOnPageChangeListener to your ViewPager. ``` viewpager.addOnPageChangeListener( new OnPageChangeListener(){ @Override public void onPageSelected(int arg0) { if(lastPage>arg0) {//User Move to left} else(lastPage<arg0) {//User Move to right} lastPage=arg0 } }); ``` Look at the onPageSelected(int position) method of ViewPager.OnPageChangeListener. The position gives the index of newly selected page. If you keep a track of the last page index, then you can compare it against the position of current page index you can get the left/right direction of viewpager.
2,207,519
What solutions exist to persist data, *without* requiring a full-blown enterprise server? I am fairly new to Java. At uni the whole curriculum was based on Java, so I coded a bit already. But it never went into depth with the available frameworks. The only way we actually touched on persistens was using "vanilla" JDBC connections. I've done some digging around and came across the typical solutions. Most prominently "JAXB", "JPA", "Hibernate" and "TopLink". As far as I can tell, the last two are actually implementing "JPA", which is just a spec. Am I right here? All the tutorials I have found so far explained these fairly well, and I have to say that I like JPA quite a lot. But all the tutorials I have seen, explained it all using web-pages. I am looking for a **swing** based solution however. Without webstart or the likes. I'd like to create a stand-alone Java desktop app. Given the target audience and the requirements, I don't need a client/server architecture anyways. Now, there is also the topic of Beans Binding. Which, to me, looks like fun. Even considering that you have to fire you "PropertyChanged" events manually. Honestly, I don't care about the few added lines. So... for creating a stand-alone desktop app, saving (and reading) data from **already existing** legacy databases: What are your recommendations of frameworks/libraries/specs? * JPA? * JDBC? * Beans Binding? One more important thing: The primary database I would be writing the app against contains Mutliple Table Inheritance and Slowly Changing Dimensions. I've been doodling around with TopLink already, and the results are fine. But I want to get rid of the application server. ... oh, and... would it be feasible to use Beans Binding in conjunction with Entities? Making the properties read/writable?
2010/02/05
[ "https://Stackoverflow.com/questions/2207519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/160665/" ]
I recommend JPA -- while it's a standard, it is completely separate from the whole Java EE spec. You don't need a enterprise application server to use it. In fact, Sun has a ["Using JPA in Desktop Applications"](http://java.sun.com/developer/technicalArticles/J2SE/Desktop/persistenceapi/) article.
JPA + Hibernate, Derby in memory java database, Swing destop App. After annotating my Model classes and specifying the derby driver and such trivia in XML files, persistency was all automagic.
2,055,999
Currently I'm working on creating a view of displaying a entire school database in the form of a graphical view. 1. School; 2. Classes; 3. Teachers; and 4. Students I display an Image for each of the above mentioned ones. I need a plugin/tool (freeware) to use to create the links between them. My default view would be a School Image, either on click of Image / Zoom-In (Zoom-out) I want to display Classes. When I select a click by clicking it or mouse over a particular class and zoom-in, I want to display the teachers and students. Could some-one suggest me a tool that would help me do the same. **P.S.** I've tried SpringGraph, but it lacks on a lot of features.
2010/01/13
[ "https://Stackoverflow.com/questions/2055999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/185412/" ]
I would check out [Flare](http://flare.prefuse.org/). Check out the [demo](http://flare.prefuse.org/demo). I think you will be most interested in the Layouts section.
Check the "tour de flex" <http://www.adobe.com/devnet/flex/tourdeflex/> It's a big demo of what you can do with flex. Check the Data Visualisation part, it's contains some very nice exemple But i doubs that you will find exactly what your are looking for, why not just code it. * A image for the scool. * a list of image for classes. * a list of teacher and student images for each classes. * OnClick + transition event No ?
2,055,999
Currently I'm working on creating a view of displaying a entire school database in the form of a graphical view. 1. School; 2. Classes; 3. Teachers; and 4. Students I display an Image for each of the above mentioned ones. I need a plugin/tool (freeware) to use to create the links between them. My default view would be a School Image, either on click of Image / Zoom-In (Zoom-out) I want to display Classes. When I select a click by clicking it or mouse over a particular class and zoom-in, I want to display the teachers and students. Could some-one suggest me a tool that would help me do the same. **P.S.** I've tried SpringGraph, but it lacks on a lot of features.
2010/01/13
[ "https://Stackoverflow.com/questions/2055999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/185412/" ]
Another option would be the [RaVis](http://code.google.com/p/birdeye/wiki/RaVis) portion of the BirdEye project. The graphs it generates are pretty customizable (i.e. controlling the image used for each node), as seen in [this demo](http://birdeye.googlecode.com/svn/trunk/ravis/RaVisExamples/example-binaries/RaVisExplorer.html#). The default interactivity (double-click to navigate, information on mouse-over) is solid as well.
Check the "tour de flex" <http://www.adobe.com/devnet/flex/tourdeflex/> It's a big demo of what you can do with flex. Check the Data Visualisation part, it's contains some very nice exemple But i doubs that you will find exactly what your are looking for, why not just code it. * A image for the scool. * a list of image for classes. * a list of teacher and student images for each classes. * OnClick + transition event No ?
4,538,392
I am using RHEL 6 with 64 bit OS. For one of my application I had installed “jre-6u23-linux-x64.bin”. When I execute my application I am getting the below ERROR: ``` # A fatal error has been detected by the Java Runtime Environment: # SIGSEGV (0xb) at pc=0x0000003222414d70, pid=4977, tid=140076581496592 # JRE version: 6.0_23-b05 # Java VM: Java HotSpot(TM) 64-Bit Server VM (19.0-b09 mixed mode linux-amd64 compressed oops) # Problematic frame:** # C [ld-linux-x86-64.so.2+0x14d70] # An error report file with more information is saved as # /root/Desktop/Madhu/SELVIEW10.0-B4/Linux/hs_err_pid4977.log # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. ``` Can anyone have solution for this?
2010/12/27
[ "https://Stackoverflow.com/questions/4538392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/554909/" ]
Between > > The crash happened outside the Java Virtual Machine in native code. > > > and > > An error report file with more information is saved as > /root/Desktop/Madhu/SELVIEW10.0-B4/Linux/hs\_err\_pid4977.log > > > it looks like you're dealing with a defective native library. Have a look at that hs\_err dump (it's plain text), it should point to the problem. Another thing to try: the Compressed OOPS optimization was added to the JVM fairly recently, try disabling that (pass `-XX:-UseCompressedOops` on the command line) and see if the problem persists.
This issue is also discussed here: [community.oracle.com thread](https://community.oracle.com/thread/2561823) The suggested solution is to set LD\_BIND\_NOW=1: ``` export LD_BIND_NOW=1 $JAVA_HOME/bin/java -jar yourapp.jar ```
4,232,144
This is actually from Zurich's book (chapter on Integration). > > **Definition.** A set $E\subset \mathbb{R}$ *has measure zero* or *is of measure zero* (in the sense of Lebesgue) if for every number > $\epsilon>0$ there exists a covering of the set $E$ by an at most > countable system $\{I\_k\}$ of intervals, the sum of whose lengths > $\sum \limits\_{k=1}|I\_k|$ is at most $\epsilon$. > > > **Lemma.** *The union of a finite or countable number of sets of measure zero is a set of measure zero.* > > > *Proof:* Suppose that $E=\cup\_{n=1}^{\infty}E\_n$ and each $E\_n$ has measure zero. Suppose $\epsilon>0$ be given. For each $n\in \mathbb{N}$ by definition we can find an at most countable system $\{I\_{n,k}\}\_{k\geq 1}$ of intervals such that $\sum \limits\_{k=1}^{\infty}|I\_{n,k}|<\dfrac{\epsilon}{2^n}$. Then we see that $\{I\_{n,k}: n,k\geq 1\}$ be a countable system of intervals covering $E$. How formally to show that total length of these $I\_{n,k}$ is less than $\epsilon$? Because if we want to compute its total length then we need to deal with the double sum $\sum \limits\_{n,k\geq 1}$ or $\sum \limits\_{n\geq 1} \sum \limits\_{k\geq 1} $ (btw I don't know the difference between them). I would be very thankful if someone can show the formal proof of it please!
2021/08/24
[ "https://math.stackexchange.com/questions/4232144", "https://math.stackexchange.com", "https://math.stackexchange.com/users/99694/" ]
I don't think Zorich is super clear on this point. The closest he comes to an explanation is this: > > The order of summation $\sum\_{n,k} |I^n\_k|$ on the indices $n$ and $k$ is of no importance, since the series converges to the same sum for any order of summation if it converges in even one ordering. [Zorich is referring to Proposition 4, page 270.] Such is the case here, since any partial terms of the sum are bounded above by $\varepsilon$. > > > I would explain this this way. Let $a\_n = \sum\_{k} |I^n\_k| < \frac{\varepsilon}{2^n}$. Now let $A = \sum\_{j=1}^J |I^{n\_j}\_{k\_j}|$ be any partial sum of the series $\sum\_{n,k} |I^n\_k|$ arranged in an arbitrary order. If we let $N = \max\_j n\_j$, then $A \leq \sum\_{n = 1}^N a\_n \leq \sum\_{n = 1}^{+\infty} a\_n$. Since any partial sum of the series $\sum\_{n,k} |I^n\_k|$ is $\leq \sum\_{n = 1}^{+\infty} a\_n$, we have $$ \sum\_{n,k} |I^n\_k| \leq \sum\_{n = 1}^{+\infty} a\_n < \varepsilon. $$ It's true there are theorems about double series that would make the original claim obvious, but you can get by without them.
The point here is that you don't actually need to compute it. What you do is for your first set, $E\_1$, choose a covering so that the total measure is less than $\frac \epsilon 2$. The second set you choose one whose total is less than $\frac \epsilon 4$, then $n'th$ one a cover whose total length is less than $\frac \epsilon {2^n}$. Now, taking the union and all you have is the simple geometric series $\frac \epsilon {2^n}$, which adds up to $\epsilon$ Edited to add complicated notation: For Set $E\_1$ choose a covering $E\_{1,k}$ such that $\sum\_{k\geq 1}E\_{1,k}<\frac \epsilon 2$. Similarly, for each set $E\_n$ choose a covering so that $\sum\_{k\geq 1}E\_{n,k}<\frac \epsilon {2^n}$ Now, $\bigcup\_{n\geq 1}E\_n $is covered by $\bigcup\_{n\geq 1}\bigcup\_{k\geq 1}E\_{n,k}$, and taking the sum of the lengths, we have the union is less than $$\sum\_{n\geq 1}\sum\_{k\geq 1}E\_{n,k}=\sum\_{n\geq 1}\left(\sum\_{k\geq 1}E\_{n,k}\right)=\sum\_{n\geq 1}\frac \epsilon {2^n}=\epsilon $$
1,215,928
In the latest release of ASP.NET MVC 2 they have launched the concept of areas as supported by MS. However to perform this areas concept one has to create multiple separate projects. One project per area. In ASP.NET MVC 1 there were many other ways out there to support areas where you would still be working within the same project. This post is not about [whether areas are important or not](https://stackoverflow.com/questions/462458/asp-net-mvc-areas-are-they-important-to-a-large-application) but what a proper implementation would be. What is your preference for working with areas and why? What do you think of this new multi-project way of performing areas? Here were the pre 2.0 ways to implement areas: <http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx> <http://blog.codeville.net/2008/11/05/app-areas-in-aspnet-mvc-take-2/> <http://devlicio.us/blogs/billy_mccafferty/archive/2009/01/22/mvc-quot-areas-quot-as-hierarchical-subfolders-under-views.aspx> I am about to start working on a very large ASP.NET MVC project (and can't wait to dig into the 2.0 preview) and am wondering if I should use this new areas implementation or what we have already proved to work.
2009/08/01
[ "https://Stackoverflow.com/questions/1215928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83889/" ]
fixed it ``` $pagefixed = str_replace("href=\"/","href=\"http://www.domain.com/","$page"); ``` Thanks all
You'll either need to use a regular expression (preg\_replace) or 2 str\_replaces since quotes vary.
10,976,548
I want to do something like this: click a Link (a URL of apk) 1. If the apk didn't install before, so the apk will be downloaded. 2. If the apk have installed the apk before, the apk will be open. So is it possible to open the apk by URL link?
2012/06/11
[ "https://Stackoverflow.com/questions/10976548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1448441/" ]
You can use [PackageManager](http://developer.android.com/reference/android/content/pm/PackageManager.html) class to search for a package, the one that you want to start downloading, if the package is present you can call to its launch intent. Some examples here. [How to get a list of installed android applications and pick one to run](https://stackoverflow.com/questions/2695746/how-to-get-a-list-of-installed-android-applications-and-pick-one-to-run)
Look at [this example](https://testflightapp.com/androidsplash/) and TestFlight's webpage. There's a link `Already Installed? Launch the App` -- a simple `<a>` tag with `href` set to `testflightapp://com.testflightapp.androidapp?scheme=http&amp;host=testflightapp.com&amp;path=m/builds`. It works partially, like you want -- it runs installed application. However, I don't know if this kind of href / protocol supported only by installed Test Flight application (seems so) or general in Android system. So, it seems, that your own application -- the one, that you want to install or run via link, must itself register and handle private protocol, as in this example.
69,077,614
Trying to print the value in y for the number of times that shows in x. How should I modify the following syntax to achieve the expected output? ``` x = 5 y = ['a', 'b'] z = [] for num in list(range(x)): for idx, num1 in enumerate(y): z.append(num1) ``` Output based on above: ``` ['a', 'b', 'a', 'b', 'a', 'b', 'a', 'b', 'a', 'b'] ``` Expected output: ``` ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'b'] ```
2021/09/06
[ "https://Stackoverflow.com/questions/69077614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16803074/" ]
The first reduce is working as intended. As it is already reduced it will not perform anything. To be more explicit, the callback you pass to the `reduce()` method will be called on each element of the array, but as your array is empty, there it will not be called. See <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce>.
As mentioned in the docs: > > The reduce() method executes a user-supplied “reducer” callback function on each element of the array > > > If there are no elements the callback won't run <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce>
69,077,614
Trying to print the value in y for the number of times that shows in x. How should I modify the following syntax to achieve the expected output? ``` x = 5 y = ['a', 'b'] z = [] for num in list(range(x)): for idx, num1 in enumerate(y): z.append(num1) ``` Output based on above: ``` ['a', 'b', 'a', 'b', 'a', 'b', 'a', 'b', 'a', 'b'] ``` Expected output: ``` ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'b'] ```
2021/09/06
[ "https://Stackoverflow.com/questions/69077614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16803074/" ]
An empty array have no element, so it dose not run reduce function. But [null] array has one element 'null'. So this array run reduce function.
As mentioned in the docs: > > The reduce() method executes a user-supplied “reducer” callback function on each element of the array > > > If there are no elements the callback won't run <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce>
2,476,690
We've noticed that when checking in updates, our `.DFM` files have added `ExplicitWidth` and `ExplicitHeight` properties - but we don't know why. My questions are: * What are these properties for? * Why are they automatically added by Delphi? Below is an example showing the added `ExplicitWidth` property: ``` object Splitter2: TcxSplitter Left = 0 Top = 292 Width = 566 Height = 8 Cursor = crVSplit HotZoneClassName = 'TcxXPTaskBarStyle' AlignSplitter = salBottom Control = BottomPanel Color = clBtnFace ExplicitWidth = 8 end ```
2010/03/19
[ "https://Stackoverflow.com/questions/2476690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17461/" ]
From Googling.... [Original article can be found here.](http://jedqc.blogspot.com/2006/02/d2006-what-on-earth-are-these-explicit.html) > > The Explicit properties remember the > previous bounds of a control before > the Align or Anchor properties are > changed from their defaults. > > > The only time the Explicit properties > are not written is when the Align > property is set back to its default > value of alNone. > > > This is when the Explicit properties > are actually used by the control to > reset its bounds to what it was > previously. > > >
Delphi adds value of published properties to DFM file only when its value different from default. For example: ``` property ExplicitWidth: Integer read FExplicitWidth write FExplicitWidth default 1; ``` If ExplicitWidth value is not 1 then it will be written to the DFM. When the "default" is not defined then any value will be written to the DFM. TcxSplitter is not standard Delphi component, you'd better ask its author about the purpose of the properties.
2,476,690
We've noticed that when checking in updates, our `.DFM` files have added `ExplicitWidth` and `ExplicitHeight` properties - but we don't know why. My questions are: * What are these properties for? * Why are they automatically added by Delphi? Below is an example showing the added `ExplicitWidth` property: ``` object Splitter2: TcxSplitter Left = 0 Top = 292 Width = 566 Height = 8 Cursor = crVSplit HotZoneClassName = 'TcxXPTaskBarStyle' AlignSplitter = salBottom Control = BottomPanel Color = clBtnFace ExplicitWidth = 8 end ```
2010/03/19
[ "https://Stackoverflow.com/questions/2476690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17461/" ]
With DDevExtensions you can disable storing these properties in the dfm: <http://andy.jgknet.de/blog/?page_id=10> > > Adds Explicit\* property remover to keep DFM files compatible to older Delphi versions > > >
Delphi adds value of published properties to DFM file only when its value different from default. For example: ``` property ExplicitWidth: Integer read FExplicitWidth write FExplicitWidth default 1; ``` If ExplicitWidth value is not 1 then it will be written to the DFM. When the "default" is not defined then any value will be written to the DFM. TcxSplitter is not standard Delphi component, you'd better ask its author about the purpose of the properties.
2,476,690
We've noticed that when checking in updates, our `.DFM` files have added `ExplicitWidth` and `ExplicitHeight` properties - but we don't know why. My questions are: * What are these properties for? * Why are they automatically added by Delphi? Below is an example showing the added `ExplicitWidth` property: ``` object Splitter2: TcxSplitter Left = 0 Top = 292 Width = 566 Height = 8 Cursor = crVSplit HotZoneClassName = 'TcxXPTaskBarStyle' AlignSplitter = salBottom Control = BottomPanel Color = clBtnFace ExplicitWidth = 8 end ```
2010/03/19
[ "https://Stackoverflow.com/questions/2476690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17461/" ]
From Googling.... [Original article can be found here.](http://jedqc.blogspot.com/2006/02/d2006-what-on-earth-are-these-explicit.html) > > The Explicit properties remember the > previous bounds of a control before > the Align or Anchor properties are > changed from their defaults. > > > The only time the Explicit properties > are not written is when the Align > property is set back to its default > value of alNone. > > > This is when the Explicit properties > are actually used by the control to > reset its bounds to what it was > previously. > > >
With DDevExtensions you can disable storing these properties in the dfm: <http://andy.jgknet.de/blog/?page_id=10> > > Adds Explicit\* property remover to keep DFM files compatible to older Delphi versions > > >
2,476,690
We've noticed that when checking in updates, our `.DFM` files have added `ExplicitWidth` and `ExplicitHeight` properties - but we don't know why. My questions are: * What are these properties for? * Why are they automatically added by Delphi? Below is an example showing the added `ExplicitWidth` property: ``` object Splitter2: TcxSplitter Left = 0 Top = 292 Width = 566 Height = 8 Cursor = crVSplit HotZoneClassName = 'TcxXPTaskBarStyle' AlignSplitter = salBottom Control = BottomPanel Color = clBtnFace ExplicitWidth = 8 end ```
2010/03/19
[ "https://Stackoverflow.com/questions/2476690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17461/" ]
From Googling.... [Original article can be found here.](http://jedqc.blogspot.com/2006/02/d2006-what-on-earth-are-these-explicit.html) > > The Explicit properties remember the > previous bounds of a control before > the Align or Anchor properties are > changed from their defaults. > > > The only time the Explicit properties > are not written is when the Align > property is set back to its default > value of alNone. > > > This is when the Explicit properties > are actually used by the control to > reset its bounds to what it was > previously. > > >
I encounter a lot of noise from random (dis)appearances of these: ``` ExplicitLeft = 0 ExplicitTop = 0 ExplicitWidth = 0 ExplicitHeight = 0 ``` So I wrote a tool that removes only these (all 4 exist and are 0) from DFM files: <https://github.com/gonutz/dfm_clear_explicit_zeros>
2,476,690
We've noticed that when checking in updates, our `.DFM` files have added `ExplicitWidth` and `ExplicitHeight` properties - but we don't know why. My questions are: * What are these properties for? * Why are they automatically added by Delphi? Below is an example showing the added `ExplicitWidth` property: ``` object Splitter2: TcxSplitter Left = 0 Top = 292 Width = 566 Height = 8 Cursor = crVSplit HotZoneClassName = 'TcxXPTaskBarStyle' AlignSplitter = salBottom Control = BottomPanel Color = clBtnFace ExplicitWidth = 8 end ```
2010/03/19
[ "https://Stackoverflow.com/questions/2476690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17461/" ]
With DDevExtensions you can disable storing these properties in the dfm: <http://andy.jgknet.de/blog/?page_id=10> > > Adds Explicit\* property remover to keep DFM files compatible to older Delphi versions > > >
I encounter a lot of noise from random (dis)appearances of these: ``` ExplicitLeft = 0 ExplicitTop = 0 ExplicitWidth = 0 ExplicitHeight = 0 ``` So I wrote a tool that removes only these (all 4 exist and are 0) from DFM files: <https://github.com/gonutz/dfm_clear_explicit_zeros>
5,737
In the new version of Google Docs is it possible to view/compare revision differences as you used to be able to do to see the changes highlighted. I know you can view previous versions but what I want is to see the individual changes highlighted by the user that made them.
2010/08/16
[ "https://webapps.stackexchange.com/questions/5737", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/3447/" ]
This method will create a new document with the changes as suggestions. 1. In the updated document: 1. Select the menu item: **File/Version History/See Version History** 2. Find the version upon which you wish to base the compare/diff. 3. Click the vertical ellipsis, and select "Make a Copy" 2. In this new copy of the document: 1. Select the menu item: **Tools/Compare Document** 2. For **Select the comparison document**: 1. Click My Drive 2. Select the original document 3. Click **Open** 3. For **Attribute difference to:**, select: **<< your user >>** 4. Click **Compare** 5. After a few moments, the Dialog "Comparison is ready is shown" 6. Click **Open** 3. The document will show the diff/changes as suggestions.
If you have access to Adobe Acrobat, you can print the two documents to PDF files using Docs Print/Save As PDF command, then compare them using Adobe Acrobat's Compare Documents feature.
5,737
In the new version of Google Docs is it possible to view/compare revision differences as you used to be able to do to see the changes highlighted. I know you can view previous versions but what I want is to see the individual changes highlighted by the user that made them.
2010/08/16
[ "https://webapps.stackexchange.com/questions/5737", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/3447/" ]
The best way I found is to use named version. You can set names for each versions and you can compare current named version with previous named version. So the step is 1. Set names to two versions you want to compare with. 2. Turn on "Only show named versions". Then you can see the difference between specific versions. In order to be able to visually see the highlights and strikethroughs, you need to check the *Show Changes* box at the bottom of the right-hand column, then click on the named version you wish to view.
If you have access to Adobe Acrobat, you can print the two documents to PDF files using Docs Print/Save As PDF command, then compare them using Adobe Acrobat's Compare Documents feature.
5,737
In the new version of Google Docs is it possible to view/compare revision differences as you used to be able to do to see the changes highlighted. I know you can view previous versions but what I want is to see the individual changes highlighted by the user that made them.
2010/08/16
[ "https://webapps.stackexchange.com/questions/5737", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/3447/" ]
The best way I found is to use named version. You can set names for each versions and you can compare current named version with previous named version. So the step is 1. Set names to two versions you want to compare with. 2. Turn on "Only show named versions". Then you can see the difference between specific versions. In order to be able to visually see the highlights and strikethroughs, you need to check the *Show Changes* box at the bottom of the right-hand column, then click on the named version you wish to view.
This method will create a new document with the changes as suggestions. 1. In the updated document: 1. Select the menu item: **File/Version History/See Version History** 2. Find the version upon which you wish to base the compare/diff. 3. Click the vertical ellipsis, and select "Make a Copy" 2. In this new copy of the document: 1. Select the menu item: **Tools/Compare Document** 2. For **Select the comparison document**: 1. Click My Drive 2. Select the original document 3. Click **Open** 3. For **Attribute difference to:**, select: **<< your user >>** 4. Click **Compare** 5. After a few moments, the Dialog "Comparison is ready is shown" 6. Click **Open** 3. The document will show the diff/changes as suggestions.
5,737
In the new version of Google Docs is it possible to view/compare revision differences as you used to be able to do to see the changes highlighted. I know you can view previous versions but what I want is to see the individual changes highlighted by the user that made them.
2010/08/16
[ "https://webapps.stackexchange.com/questions/5737", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/3447/" ]
The best way I found is to use named version. You can set names for each versions and you can compare current named version with previous named version. So the step is 1. Set names to two versions you want to compare with. 2. Turn on "Only show named versions". Then you can see the difference between specific versions. In order to be able to visually see the highlights and strikethroughs, you need to check the *Show Changes* box at the bottom of the right-hand column, then click on the named version you wish to view.
This is no longer possible in the latest version of Google Docs. Please, see other answers instead. --- **It previously worked this way:** 1. Open the document in Google Docs 2. Click the [File] menu item 3. Click the [See revision history] option 4. Check the box for the newest revision you want to compare. 5. Scroll down the list and check the box for the oldest revision you want to compare. 6. Click the [Compare checked] button to see the changes between the old and new revision entries you checked. Added content will be block highlighted. Deleted content will have a line through it. Both will be in the color of the editor that made the changes. Update: As discovered by [DEFusion](https://webapps.stackexchange.com/users/3447/defusion), old documents, which I had used to write the above process, are unaffected by the new "feature" (or deletion of a feature, apparently). I failed to actually create a new document to test the process. Indeed, new documents created in Google Docs do not provide a diff function. Only browsing between newer and older versions is currently possible. So, unfortunately, it looks like for now no diff-ing is possible.
5,737
In the new version of Google Docs is it possible to view/compare revision differences as you used to be able to do to see the changes highlighted. I know you can view previous versions but what I want is to see the individual changes highlighted by the user that made them.
2010/08/16
[ "https://webapps.stackexchange.com/questions/5737", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/3447/" ]
You can use <https://github.com/larsks/gitdriver> to create a git repository mirroring a google doc. In the repository is only one file stored and there is a commit for each Google Drive revision. Then, you can use commands like `git log` of `git diff` or graphical tools for showing the diff as described here: <https://stackoverflow.com/questions/255202/how-do-i-view-git-diff-output-with-a-visual-diff-program>. It is a shame that people must invent such tools for Google's inability to accomodate user's workflow.
This method will create a new document with the changes as suggestions. 1. In the updated document: 1. Select the menu item: **File/Version History/See Version History** 2. Find the version upon which you wish to base the compare/diff. 3. Click the vertical ellipsis, and select "Make a Copy" 2. In this new copy of the document: 1. Select the menu item: **Tools/Compare Document** 2. For **Select the comparison document**: 1. Click My Drive 2. Select the original document 3. Click **Open** 3. For **Attribute difference to:**, select: **<< your user >>** 4. Click **Compare** 5. After a few moments, the Dialog "Comparison is ready is shown" 6. Click **Open** 3. The document will show the diff/changes as suggestions.
5,737
In the new version of Google Docs is it possible to view/compare revision differences as you used to be able to do to see the changes highlighted. I know you can view previous versions but what I want is to see the individual changes highlighted by the user that made them.
2010/08/16
[ "https://webapps.stackexchange.com/questions/5737", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/3447/" ]
This is no longer possible in the latest version of Google Docs. Please, see other answers instead. --- **It previously worked this way:** 1. Open the document in Google Docs 2. Click the [File] menu item 3. Click the [See revision history] option 4. Check the box for the newest revision you want to compare. 5. Scroll down the list and check the box for the oldest revision you want to compare. 6. Click the [Compare checked] button to see the changes between the old and new revision entries you checked. Added content will be block highlighted. Deleted content will have a line through it. Both will be in the color of the editor that made the changes. Update: As discovered by [DEFusion](https://webapps.stackexchange.com/users/3447/defusion), old documents, which I had used to write the above process, are unaffected by the new "feature" (or deletion of a feature, apparently). I failed to actually create a new document to test the process. Indeed, new documents created in Google Docs do not provide a diff function. Only browsing between newer and older versions is currently possible. So, unfortunately, it looks like for now no diff-ing is possible.
If you have access to Adobe Acrobat, you can print the two documents to PDF files using Docs Print/Save As PDF command, then compare them using Adobe Acrobat's Compare Documents feature.
5,737
In the new version of Google Docs is it possible to view/compare revision differences as you used to be able to do to see the changes highlighted. I know you can view previous versions but what I want is to see the individual changes highlighted by the user that made them.
2010/08/16
[ "https://webapps.stackexchange.com/questions/5737", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/3447/" ]
The best way I found is to use named version. You can set names for each versions and you can compare current named version with previous named version. So the step is 1. Set names to two versions you want to compare with. 2. Turn on "Only show named versions". Then you can see the difference between specific versions. In order to be able to visually see the highlights and strikethroughs, you need to check the *Show Changes* box at the bottom of the right-hand column, then click on the named version you wish to view.
Docs has "Tools -> Compare documents". This can be used. For each (from/to) version, create a new document, and then compare these documents. This creates 3 documents (two source documents and the comparison result), that you then may want to delete afterwards. But it is possible.
5,737
In the new version of Google Docs is it possible to view/compare revision differences as you used to be able to do to see the changes highlighted. I know you can view previous versions but what I want is to see the individual changes highlighted by the user that made them.
2010/08/16
[ "https://webapps.stackexchange.com/questions/5737", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/3447/" ]
This method will create a new document with the changes as suggestions. 1. In the updated document: 1. Select the menu item: **File/Version History/See Version History** 2. Find the version upon which you wish to base the compare/diff. 3. Click the vertical ellipsis, and select "Make a Copy" 2. In this new copy of the document: 1. Select the menu item: **Tools/Compare Document** 2. For **Select the comparison document**: 1. Click My Drive 2. Select the original document 3. Click **Open** 3. For **Attribute difference to:**, select: **<< your user >>** 4. Click **Compare** 5. After a few moments, the Dialog "Comparison is ready is shown" 6. Click **Open** 3. The document will show the diff/changes as suggestions.
Docs has "Tools -> Compare documents". This can be used. For each (from/to) version, create a new document, and then compare these documents. This creates 3 documents (two source documents and the comparison result), that you then may want to delete afterwards. But it is possible.
5,737
In the new version of Google Docs is it possible to view/compare revision differences as you used to be able to do to see the changes highlighted. I know you can view previous versions but what I want is to see the individual changes highlighted by the user that made them.
2010/08/16
[ "https://webapps.stackexchange.com/questions/5737", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/3447/" ]
You can use <https://github.com/larsks/gitdriver> to create a git repository mirroring a google doc. In the repository is only one file stored and there is a commit for each Google Drive revision. Then, you can use commands like `git log` of `git diff` or graphical tools for showing the diff as described here: <https://stackoverflow.com/questions/255202/how-do-i-view-git-diff-output-with-a-visual-diff-program>. It is a shame that people must invent such tools for Google's inability to accomodate user's workflow.
If you have access to Adobe Acrobat, you can print the two documents to PDF files using Docs Print/Save As PDF command, then compare them using Adobe Acrobat's Compare Documents feature.
5,737
In the new version of Google Docs is it possible to view/compare revision differences as you used to be able to do to see the changes highlighted. I know you can view previous versions but what I want is to see the individual changes highlighted by the user that made them.
2010/08/16
[ "https://webapps.stackexchange.com/questions/5737", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/3447/" ]
You can see differences between named and unnamed versions. Go to File->Version history->See version history On the right hand side, you'll see the versions. If you click on one of them, you will see above your document, on the right hand side [![Total: X edits](https://i.stack.imgur.com/VBuKP.png)](https://i.stack.imgur.com/VBuKP.png) The total shown is the number of changes between the version you highlight and the previous one shown. There are two arrows to the right of the total for taking you from one change to the next. When only named versions are shown, you see the difference to the previous named version. When both are shown, you can click on the little triangle to the left of a version to show also unnnamed version. In that case you'll see differences between one unnamed version and another. You can name and "remove name" for versions with the menu to the right of the version name to see differences between further away versions. All this worked June 4, 2019.
Docs has "Tools -> Compare documents". This can be used. For each (from/to) version, create a new document, and then compare these documents. This creates 3 documents (two source documents and the comparison result), that you then may want to delete afterwards. But it is possible.
27,016
I was wondering if there were any space probe systems that were actually launched as part of a larger satellite bus. As in, one rocket launch from earth releases 6 different satellites on a singular mission at different points on the main-buses trajectory. I did a mission [earlier on KSP](https://imgur.com/gallery/NSQ1ITw) and was wondering if there was a real-world equivalent yet. Like something that has hundreds of small satellites that it can just spew out along it's orbital path, then the satellites use small propulsion systems to change their subsequent orbit. I know about the up-coming satellite system SpaceX plans to launch, but don't really know of any other single launches that propelled multiple probes to different locations (I could just be poorly wording my searches).
2018/05/01
[ "https://space.stackexchange.com/questions/27016", "https://space.stackexchange.com", "https://space.stackexchange.com/users/25224/" ]
The [Pioneer Venus Multiprobe](https://en.wikipedia.org/wiki/Pioneer_Venus_Multiprobe) seems to fit the bill. It had one Large Probe and three smaller ones. [![enter image description here](https://i.stack.imgur.com/kcHPP.jpg)](https://i.stack.imgur.com/kcHPP.jpg) I don't think the different probes had propulsion though. I think they were just released at different times to hit different targets. [![enter image description here](https://i.stack.imgur.com/yxtBOm.png)](https://i.stack.imgur.com/yxtBOm.png) The bus itself was also instrumented and returned upper atmospheric data during its entry. I always thought this mission was pretty awesome and wonder why it isn't more famous. One of the small probes even survived its landing and transmitted data from the surface!
Magnetosphere missions such as NASA's MMS <https://mms.gsfc.nasa.gov/> consist of four spacecraft flying in formation in order to obtain a three dimensional view of what is happening between them. SpaceX is planning to launch the NASA/DFZ Grace Follow On mission next month, which is comprised of two spacecraft. One spacecraft will orbit behind the other, and the distance between the two spacecraft will be precisely measured in order to determine how their relative velocity changes as they pass over different locations on Earth. From that data, the gravity of Earth will be able to be precisely mapped. A previous mission called Grace did the same thing. <https://www.nasa.gov/press-release/twin-spacecraft-to-weigh-in-on-earths-changing-water> The ESA/JAXA BepiColumbo mission launching later this year consists of three spacecraft that will separate from each other after after arrival at Mercury. <http://sci.esa.int/bepicolombo/> Multi-probe missions are relatively common.
152,916
At the beginning of the winter season my boiler wasn't turning on, but I got it to work by turning on the inlet valve and just letting it feed water until the gas burners kicked in. The sight glass completely (over)filled with water to the point I couldn't see any air in the top. I was happy because my heat was working. Now, the boiler is not engaging again. I was going to try the same tactic, but without knowing anything about boilers, let alone the kind I have, I'm afraid I might damage it. So, I just drained the water (from the rear at the inlet valve) until the low water light came on (the water in the sight glass was near the bottom). I then let in new water until the sight glass showed 4/5 full. Still no engagement of the gas burners. The pressure is floored, too. The gas pilot is burning, too. I'm pretty sure if I just let the inlet valve feed water to the unit things will start to work again, but then what's the point of the sight glass? I don't want to try that until I know for sure it's the right move. I'm attaching some photos of the boiler and it's readings, and I hope you can help figure out why I have no heat. **Boiler Front** [![Boiler Front](https://i.stack.imgur.com/pmkOL.jpg)](https://i.stack.imgur.com/pmkOL.jpg) **Boiler Right Side** [![Boiler Right Side](https://i.stack.imgur.com/Dtt6p.jpg)](https://i.stack.imgur.com/Dtt6p.jpg) **Boiler Info Sticker** [![Boiler Info Sticker](https://i.stack.imgur.com/wW0Ty.jpg)](https://i.stack.imgur.com/wW0Ty.jpg) **Sight Glass** [![Sight Glass](https://i.stack.imgur.com/alUyX.jpg)](https://i.stack.imgur.com/alUyX.jpg) **Water Pressure Gauge** [![Water Pressure Gauge](https://i.stack.imgur.com/K27FA.jpg)](https://i.stack.imgur.com/K27FA.jpg) **Water Pressure Cutoff Switch** [![Water Pressure Cutoff Switch](https://i.stack.imgur.com/aNvol.jpg)](https://i.stack.imgur.com/aNvol.jpg) **Inlet From Hot Water Heater** [![Inlet From Hot Water Heater](https://i.stack.imgur.com/S0Kev.jpg)](https://i.stack.imgur.com/S0Kev.jpg) [![Inlet From Hot Water Heater](https://i.stack.imgur.com/vVNIx.jpg)](https://i.stack.imgur.com/vVNIx.jpg) [![enter image description here](https://i.stack.imgur.com/m50ua.jpg)](https://i.stack.imgur.com/m50ua.jpg)
2018/12/18
[ "https://diy.stackexchange.com/questions/152916", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/84517/" ]
If this steam boiler has not been serviced in a while I would recommend that you have this done to insure safe operation this winter. Using this boiler with too little or too much water in it can damage it and can be very dangerous. Without knowing more about how the boiler is connected into the heating system and what type steam system it is, it is hard for anyone to give a further explanation of how to fix your problem. I can say however that some of the return piping looks wrong. It does not have a "Hartford loop" in the the return at the boiler. That doesn't mean that it will not work and heat your place. Also, post a picture of a typical radiator or baseboard installed in your home so the piping in and out can be seen. Also, send a picture of the return piping that can be seen in the next to last picture or the one before the radiator so I can see how the return is piped. One last thing, the piping that is connected to the pressure control and the low water cut out needs to be removed and cleaned. They both could keep the boiler from firing.
Here are some facts that may help: You have a steam boiler. All steam boilers have what is called a low water cut-off. This devise makes sure that the boiler never fires dry or without water covering the cast iron exchanger. This would destroy your boiler in short order. The Mfg's install literature will tell you how high the water should indicate in the sight glass to protect the boiler. Mark the side of the boiler jacket with a magic marker. You don't want to overfill the boiler because empty space at the top of the boiler is required to allow the steam to shed excess moisture before heading out to the house. We want dry steam going to the house. Now the low water cut-off should be adjusted to hold the water in the boiler at the point indicated in the sight glass. Good Luck.
33,404,576
Let's say I have these values in a table ``` | Start Date | End date |Other Value --------------------------------------------------------------------- | 2015-01-07 01:00:00.000 | 2015-01-08 04:00:00.000 | Yes | 2015-01-08 10:00:00.000 | 2015-01-10 20:00:00.000 | No ``` I want to write a select statement that should give me results like: ``` |Date | Start Date | End date |Other Value ----------------------------------------------------------- |2015-01-07 | 01:00:00.000 | | Yes |2015-01-08 | | 04:00:00.000 | Yes |2015-01-08 | 10:00:00.000 | | No |2015-01-10 | | 20:00:00.000 | No ``` Is there a way to do it in T-SQL? I am using SQL Server 2008 R2.
2015/10/29
[ "https://Stackoverflow.com/questions/33404576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5283587/" ]
Actually I was using Hibernate 5 jars . But the tutorial is actually for Hibernate 4. When I used Hibernate 4 jars everything seems to working fine.
May be you don't need `<mapping resource="com/simpleprogrammer/User.hbm.xml" />`. Instead, try `<mapping resource="User.hbm.xml" />`
28,982,551
*I know that for Android it's possible to use Chrome://inspect to view the phone screen on your desktop. Clicking there is equal to tapping on the phone.* It's fine for browsers and after 4.4 - for apps that have some special lines of code inserted. Whether it's possible for iPhone / iPad? i.e. I have a REAL device with latest OS installed, which screen I'd like to be shown on MAC + clicking on the items on the screen will be equal to tappping on the phone.
2015/03/11
[ "https://Stackoverflow.com/questions/28982551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2878233/" ]
For C, gdb's "expression language" is just ordinary C expressions, with a few handy extensions for debugging. This is less true for C++, primarily because C++ is just much more difficult to parse, so there expression language tends to be a subset of C++ plus some gdb extensions. So, the short answer is you can just type: ``` (gdb) print sizeof(mystruct) ``` However, there are caveats. First, gdb's current language matters. You can find this with `show language`. In the case of a `struct` type, in C++ there is an automatic typedef, but in C there is not. So if you are using the `auto` language (and you usually should), and are stopped in a C frame, you will need to use the keyword: ``` (gdb) print sizeof(struct mystruct) ``` Now, this still may not work. The usual reason at this point is that the structure isn't used in your program, and so doesn't show up in the debug info. The debug info can be optimized out even if you think it ought to have been available, because it is up to the compiler. For example, I think if a `struct` is only used in `sizeof` expressions (and no variable is ever defined of that type), then I think (hard to remember for sure) that GCC won't emit DWARF for it. You can check to see if the type is available using `readelf` or `dwgrep`, like: ``` $ readelf -wi myexecutableorlibrary | grep mystruct ``` (Though in real life I usually use `less` and then examine the DWARF DIEs carefully. You will need to know a little DWARF to make sense of this.) Sometimes in gdb it's handy to use the "filename" extension to specify exactly which entity you mean. Like: ``` (gdb) print 'myfile.c'::variable ``` Not sure if that works for types, and anyway it shouldn't usually be necessary for them.
In C/C++, you have the `sizeof` function which will give you the size of any type (including `struct`) or variable. I'm not sure if you can apply this while debugging but you could simply have a test program with the same headers (type definitions) tell you what the size of your types is.
155,507
I am using SSH to connect to a CentOS server and I want to get the file in mb of some files and folders, how can I do it?
2010/06/22
[ "https://superuser.com/questions/155507", "https://superuser.com", "https://superuser.com/users/40705/" ]
use the du command ``` du -m filename ```
`du` is the primary tool for this, but if you're looking for something more interactive, I quite like `ncdu` [![ncdu_screenshot](https://i.stack.imgur.com/mtQMJ.jpg)](https://i.stack.imgur.com/mtQMJ.jpg)
155,507
I am using SSH to connect to a CentOS server and I want to get the file in mb of some files and folders, how can I do it?
2010/06/22
[ "https://superuser.com/questions/155507", "https://superuser.com", "https://superuser.com/users/40705/" ]
use the du command ``` du -m filename ```
``` du -msh FolderName ``` will get the size with units. Unlike using -h, this will show a single size, while -h shows all the individual files within the folder. e.g. ``` 349M FolderName ```
155,507
I am using SSH to connect to a CentOS server and I want to get the file in mb of some files and folders, how can I do it?
2010/06/22
[ "https://superuser.com/questions/155507", "https://superuser.com", "https://superuser.com/users/40705/" ]
``` du -msh FolderName ``` will get the size with units. Unlike using -h, this will show a single size, while -h shows all the individual files within the folder. e.g. ``` 349M FolderName ```
`du` is the primary tool for this, but if you're looking for something more interactive, I quite like `ncdu` [![ncdu_screenshot](https://i.stack.imgur.com/mtQMJ.jpg)](https://i.stack.imgur.com/mtQMJ.jpg)
66,450,581
Below is the code sample I tried coding it out in Angular but it's not something that I want. ``` <table> <th >No.</th> <th >Merchant </th> <th >Last Order Grand Total </th> <th >Last Order Date </th> <hr> <tr *ngFor="let item of topFiveActiveMerchant; index as i;"> <td>{{i+1}}</td> <td>{{item.merchant_name}}</td> <td>{{item.merchant_name}}</td> <td>{{item.created_date | date:'dd/MM/yyyy h:mm a'}}</td> </tr> </table> ``` I want it to be something like this [![Want this design](https://i.stack.imgur.com/8foa3.png)](https://i.stack.imgur.com/8foa3.png) but i ended up with [![Ended up with this](https://i.stack.imgur.com/Yf1rj.png)](https://i.stack.imgur.com/Yf1rj.png)
2021/03/03
[ "https://Stackoverflow.com/questions/66450581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15048815/" ]
One oversight (remove the heads): `printf("\n\n--- TOTAL COUNT ---\n", heads);` you may also want to remove `getch();` inside `flip()` and fix the indentation of the overall file if that matters.
1. NO need to define function signature above the main and implement later. You can do this in one way. 2. Need to return 0 in your main function(last line in your main function). 3. Don't use unnecessary header unless you use their function/value.
61,399
[Devarim 1:23](http://www.chabad.org/library/bible_cdo/aid/9965#showrashi=true) reads: > > וַיִּיטַב בְּעֵינַי הַדָּבָר וָאֶקַּח מִכֶּם שְׁנֵים עָשָׂר אֲנָשִׁים > אִישׁ אֶחָד לַשָּׁבֶט׃ > > > And the matter pleased me; so I took twelve men from you, one man for > each tribe. > > > Rashi: > > שנים עשר אנשים איש אחד לשבט: מגיד שלא היה שבט לוי עמהם׃ > > > twelve men… one man for each tribe: **[This] tells [us] that the tribe > of Levi was not with them.** (Sifrei). > > > My question is: What is Rashi explaining/clarifying here and why do we need a special limud (exegesis) for this? In Parshat Shelach ([Bamidbar 13:4-15](http://www.chabad.org/library/bible_cdo/aid/9941/jewish/Chapter-13.htm)) all the the spies are named one-by-one and clearly there is no mention of a representative from the tribe of Levi!
2015/07/21
[ "https://judaism.stackexchange.com/questions/61399", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/1863/" ]
Sifsei Chachamim brings this question from Rabi Elazar Mizrachi who left it as a question. The Sifsei Chachamim goes on to suggest that this limud is to tell us that Shevet Levi was not even involved in the council to send spies. He quotes Rashi, who's words are now clearer, who says Levi was not with them, but did not say Levi did not *go* with them.
The [Gur Aryeh](http://www.hebrewbooks.org/pdfpager.aspx?req=42848&st=&pgnum=39) explains this Rashi. He cites the question of Rabbi Eliyahu Mizrachi ([the Re'em](https://he.wikipedia.org/wiki/%D7%90%D7%9C%D7%99%D7%94%D7%95_%D7%9E%D7%96%D7%A8%D7%97%D7%99)) > > והקשה הרא״ם, דכבר כתיב בפרשת שלח (במדבר יג, ל-טו) שנים עשר אנשים, כל > אחד בשמו, ולא נכתב כלל אחד משבט לוי עמהם, > > > and then answers: > > ואין זה קשיא, דהאי ׳מגיד׳, פירושו, מה שהוצרך משה רבנו עליו השלום > לומר לישראל ״שנים עשר אנשים״, כדי לומר משה לישראל שלא היה באותו פעם > שבט לוי , דהא מה שאמר ״איש אחד לשבט״ , גם כן כתב למעלה (ר במדבר > יג, ב), ומשה היה חוזר להם בתוכחה הדברים הראשונים. וכך פירושו, מגיד > משה לישראל ואמר להם בקשתם דבר שלא כהוגן, שאין ראוי ל כ שר לבקש שלוח > מרגלים, שהרי שבט לוי הכשרים לא בקשו כלל. > > > So according to the Gur Aryeh, Rashi is to be understood as follows: The seemingly unnecessary words > > שְׁנֵים עָשָׂר אֲנָשִׁים - twelve men > > > are there to stress that: > > the tribe of Levi was not with them > > > ie - As apposed to the other tribes who approached Moshe to spy out the land - the tribe of Levi was not in favor of this idea at all. **By stressing this, Moshe is rebuking the people for wanting to send the spies even though they saw that the tribe of Levi (who were more virtuous people) were not in favor.** So the point here is not that from among the spies there was no representative from the tribe of Levi, but rather that the tribe of Levi as a whole was against the idea of sending spies - which made the decision by the rest of the people to send spies wrongful. This would then be a *continuation* of Moshe alluding to incidents where the people angered Hashem.
4,859,774
I have one table with 2 columns that i essentially want to split into 2 tables: table A columns: user\_id, col1, col2 New tables: B: user\_id, col1 C: user\_id, col2 I want to do: ``` INSERT INTO B (user_id, col1) SELECT user_id,col1 from A; INSERT INTO C (user_id,col2) SELECT user_id, col2 from A; ``` But i want to do it in one statement. The table is big, so i just want to do it in one pass. Is there a way to do this? Thx.
2011/02/01
[ "https://Stackoverflow.com/questions/4859774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277332/" ]
No, you can't insert into more than one table at the same time. `INSERT` syntax allows only a single table name. <http://dev.mysql.com/doc/refman/5.5/en/insert.html> > > INSERT [LOW\_PRIORITY | DELAYED | > HIGH\_PRIORITY] [IGNORE] [INTO] > **tbl\_name** [... > > >
Write a stored procedure to encapsulate the two inserts and protect the transaction.
4,859,774
I have one table with 2 columns that i essentially want to split into 2 tables: table A columns: user\_id, col1, col2 New tables: B: user\_id, col1 C: user\_id, col2 I want to do: ``` INSERT INTO B (user_id, col1) SELECT user_id,col1 from A; INSERT INTO C (user_id,col2) SELECT user_id, col2 from A; ``` But i want to do it in one statement. The table is big, so i just want to do it in one pass. Is there a way to do this? Thx.
2011/02/01
[ "https://Stackoverflow.com/questions/4859774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277332/" ]
No, you can't insert into more than one table at the same time. `INSERT` syntax allows only a single table name. <http://dev.mysql.com/doc/refman/5.5/en/insert.html> > > INSERT [LOW\_PRIORITY | DELAYED | > HIGH\_PRIORITY] [IGNORE] [INTO] > **tbl\_name** [... > > >
If by "in one statement", you mean "atomically" - so that it can never happen that it's inserted into one table but not the other - then transactions are what you're looking for: ``` START TRANSACTION; INSERT INTO B (user_id, col1) SELECT user_id,col1 from A; INSERT INTO C (user_id,col2) SELECT user_id, col2 from A; COMMIT; ``` If you need to actually do this in a single statement, you could create these as a stored procedure and call that, as [@lexu](https://stackoverflow.com/questions/4859774/mysql-is-there-a-way-to-do-a-insert-into-2-tables/4859806#4859806) suggests. See the manual for reference: <http://dev.mysql.com/doc/refman/5.0/en/commit.html> Caveat: this will not work with MyISAM tables (no transaction support), they need to be InnoDB.
4,859,774
I have one table with 2 columns that i essentially want to split into 2 tables: table A columns: user\_id, col1, col2 New tables: B: user\_id, col1 C: user\_id, col2 I want to do: ``` INSERT INTO B (user_id, col1) SELECT user_id,col1 from A; INSERT INTO C (user_id,col2) SELECT user_id, col2 from A; ``` But i want to do it in one statement. The table is big, so i just want to do it in one pass. Is there a way to do this? Thx.
2011/02/01
[ "https://Stackoverflow.com/questions/4859774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277332/" ]
No, you can't insert into more than one table at the same time. `INSERT` syntax allows only a single table name. <http://dev.mysql.com/doc/refman/5.5/en/insert.html> > > INSERT [LOW\_PRIORITY | DELAYED | > HIGH\_PRIORITY] [IGNORE] [INTO] > **tbl\_name** [... > > >
Unless your tables are spread over multiple physical disks, then the speed of the select/insert is likely to be IO bound. Trying to insert into two tables at once (even if it were possible) is likely to increase the total insert time as the disk will have to thrash more writing to your tables.
4,859,774
I have one table with 2 columns that i essentially want to split into 2 tables: table A columns: user\_id, col1, col2 New tables: B: user\_id, col1 C: user\_id, col2 I want to do: ``` INSERT INTO B (user_id, col1) SELECT user_id,col1 from A; INSERT INTO C (user_id,col2) SELECT user_id, col2 from A; ``` But i want to do it in one statement. The table is big, so i just want to do it in one pass. Is there a way to do this? Thx.
2011/02/01
[ "https://Stackoverflow.com/questions/4859774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277332/" ]
Write a stored procedure to encapsulate the two inserts and protect the transaction.
Unless your tables are spread over multiple physical disks, then the speed of the select/insert is likely to be IO bound. Trying to insert into two tables at once (even if it were possible) is likely to increase the total insert time as the disk will have to thrash more writing to your tables.
4,859,774
I have one table with 2 columns that i essentially want to split into 2 tables: table A columns: user\_id, col1, col2 New tables: B: user\_id, col1 C: user\_id, col2 I want to do: ``` INSERT INTO B (user_id, col1) SELECT user_id,col1 from A; INSERT INTO C (user_id,col2) SELECT user_id, col2 from A; ``` But i want to do it in one statement. The table is big, so i just want to do it in one pass. Is there a way to do this? Thx.
2011/02/01
[ "https://Stackoverflow.com/questions/4859774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277332/" ]
If by "in one statement", you mean "atomically" - so that it can never happen that it's inserted into one table but not the other - then transactions are what you're looking for: ``` START TRANSACTION; INSERT INTO B (user_id, col1) SELECT user_id,col1 from A; INSERT INTO C (user_id,col2) SELECT user_id, col2 from A; COMMIT; ``` If you need to actually do this in a single statement, you could create these as a stored procedure and call that, as [@lexu](https://stackoverflow.com/questions/4859774/mysql-is-there-a-way-to-do-a-insert-into-2-tables/4859806#4859806) suggests. See the manual for reference: <http://dev.mysql.com/doc/refman/5.0/en/commit.html> Caveat: this will not work with MyISAM tables (no transaction support), they need to be InnoDB.
Unless your tables are spread over multiple physical disks, then the speed of the select/insert is likely to be IO bound. Trying to insert into two tables at once (even if it were possible) is likely to increase the total insert time as the disk will have to thrash more writing to your tables.
34,432,977
I am currently learming Go. I am readging the book *An Introduction to programming in go* I am at the concurrency section and form what I understand I can see two way to define an infinite loop a go program. ``` func pinger(c chan string) { for i := 0; ; i++ { c <- "ping" } } func printer(c chan string) { for { msg := <- c fmt.Println(msg) time.Sleep(time.Second * 1) } } ``` I am wondering what is the use of the i variable in the pinger function. What is the best "go" way to declare an infinite loop ? I would say the the one in the printer function is better but as I am new to I might miss something with the declaration in the pinger function. Thanks for all people who will help.
2015/12/23
[ "https://Stackoverflow.com/questions/34432977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1440666/" ]
The `i` in the first loop is redundant; it's always best to get rid of unused variables therefore You should use a `for{}` in the pinger() function as well. Here is a working example: ``` package main import( "time" "fmt" ) func main() { c := make(chan string) go printer(c) go pinger(c) time.Sleep(time.Second * 60) } func pinger(c chan string) { for{ c <- "ping" } } func printer(c chan string) { for { msg := <- c fmt.Println(msg) time.Sleep(time.Second * 1) } } ``` [Run on playground](https://play.golang.org/p/szhdFGbiLl)
The "best" way is to write code that is easy to read and maintain. Your variable `i` in `func pinger` serves no purpose and someone stumbling upon that code later on will have a hard time understand what it's for. I would just do ``` func pinger(c chan string) { for { c <- "ping" } } ```
4,323,802
I am learning C++ and I am not clear about the destructor of a class. For example: ``` class A: { public: int valueA; private: int valueB; }; A:~A() { delete valueA; delete valueB; } ``` So, basically is it right to delete every declarations in the public and private?
2010/12/01
[ "https://Stackoverflow.com/questions/4323802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/413174/" ]
No, you only need to `delete` that which has been allocated using `new`. Simple value types like `int`s never need to be deleted. If your class *did* include data dynamically allocated using `new` either by the constructor or later by some other method then the destructor should typically de-allocate all of it, regardless of wether the data is public or private. I might add that having publically visible dynamically allocated pointer members might not be the best design, though.
You can't delete ints only pointers. Your destructor will have access to private members though so yes it could delete them if they were actually pointers (as well as the public ones). Also just because a member of your class is a pointer, it doesn't mean your destructor is meant to delete it. C++ has a concept of "ownership". The owner is usually but not always the same as the creator (where new was called). Note that for arrays where you use new T[x] you must use delete[]. There are automatic objects that will call delete for you. These are called smart pointers, and you should use them most of the time in preference to doing the delete manually. A destructor may do other things other than just delete pointers. For example, if your class has attached itself to some kind of graph on creation, your destructor can automatically remove itself from that graph.
4,323,802
I am learning C++ and I am not clear about the destructor of a class. For example: ``` class A: { public: int valueA; private: int valueB; }; A:~A() { delete valueA; delete valueB; } ``` So, basically is it right to delete every declarations in the public and private?
2010/12/01
[ "https://Stackoverflow.com/questions/4323802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/413174/" ]
No, you only need to `delete` that which has been allocated using `new`. Simple value types like `int`s never need to be deleted. If your class *did* include data dynamically allocated using `new` either by the constructor or later by some other method then the destructor should typically de-allocate all of it, regardless of wether the data is public or private. I might add that having publically visible dynamically allocated pointer members might not be the best design, though.
`delete` is only intended for pointers. In the general sense, yes, you should delete all public and private variables for which memory you own (you've reserved inside your class and it's your responsibility to delete).
4,323,802
I am learning C++ and I am not clear about the destructor of a class. For example: ``` class A: { public: int valueA; private: int valueB; }; A:~A() { delete valueA; delete valueB; } ``` So, basically is it right to delete every declarations in the public and private?
2010/12/01
[ "https://Stackoverflow.com/questions/4323802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/413174/" ]
No, you only need to `delete` that which has been allocated using `new`. Simple value types like `int`s never need to be deleted. If your class *did* include data dynamically allocated using `new` either by the constructor or later by some other method then the destructor should typically de-allocate all of it, regardless of wether the data is public or private. I might add that having publically visible dynamically allocated pointer members might not be the best design, though.
No,just delete some pointers that are constructed in your class.
4,323,802
I am learning C++ and I am not clear about the destructor of a class. For example: ``` class A: { public: int valueA; private: int valueB; }; A:~A() { delete valueA; delete valueB; } ``` So, basically is it right to delete every declarations in the public and private?
2010/12/01
[ "https://Stackoverflow.com/questions/4323802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/413174/" ]
You can't delete ints only pointers. Your destructor will have access to private members though so yes it could delete them if they were actually pointers (as well as the public ones). Also just because a member of your class is a pointer, it doesn't mean your destructor is meant to delete it. C++ has a concept of "ownership". The owner is usually but not always the same as the creator (where new was called). Note that for arrays where you use new T[x] you must use delete[]. There are automatic objects that will call delete for you. These are called smart pointers, and you should use them most of the time in preference to doing the delete manually. A destructor may do other things other than just delete pointers. For example, if your class has attached itself to some kind of graph on creation, your destructor can automatically remove itself from that graph.
No,just delete some pointers that are constructed in your class.
4,323,802
I am learning C++ and I am not clear about the destructor of a class. For example: ``` class A: { public: int valueA; private: int valueB; }; A:~A() { delete valueA; delete valueB; } ``` So, basically is it right to delete every declarations in the public and private?
2010/12/01
[ "https://Stackoverflow.com/questions/4323802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/413174/" ]
`delete` is only intended for pointers. In the general sense, yes, you should delete all public and private variables for which memory you own (you've reserved inside your class and it's your responsibility to delete).
No,just delete some pointers that are constructed in your class.
1,285,756
I'm working on a Drupal 6 module where I use jquery (and more specifically, the $.ajax method) to retrieve a RSS feed from Yahoo's weather API. I decided against using the JFeed library because I need access to the elements with "yweather" prefix (and I couldn't find a way of accessing them via JFeed). I decided to use the $.ajax method and parse the XML response instead. The JavaScript code below works fine in Firefox and IE but does not work in Safari (or Chrome FWIW): ``` function parseXml(xml) { var atmosphere = xml.getElementsByTagName("yweather:atmosphere"); var humidity = atmosphere[0].getAttribute("humidity"); $('#weatherFeed').html("Humidity: " + humidity); $('#weatherFeed').append( "<div style=\"text-align: center;margin-left: auto; margin-right: auto;\">" + city + ", " + state + "</div>"); } function getData(){ $.ajax({ type: 'GET', url: 'proxy.php?url=http://weather.yahooapis.com/forecastrss&p=94041', dataType: 'xml', success: function(xml) { parseXml(xml); } }); } if(Drupal.jsEnabled) { $(function() { getData(); setInterval("getData()", 30000); }); } ``` When I check the error console in Safari I see the following error message: `TypeError: Result of expression 'atmosphere[0]' [undefined] is not an object.` Is there an issue with using getElementsByTagName in Safari? Should I be accessing the object that's returned by getElementsByTagName differently?
2009/08/17
[ "https://Stackoverflow.com/questions/1285756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17640/" ]
Maybe just treating the the XML as data and using jQuery selectors to pull out what you want would work. `$(xml).find("yweather:atmosphere").attr("humidity")` - you might need to use filter instead of find - what do you think?
Have you tried atmosphere[1] instead of 0 for Chrome and Safari?
1,285,756
I'm working on a Drupal 6 module where I use jquery (and more specifically, the $.ajax method) to retrieve a RSS feed from Yahoo's weather API. I decided against using the JFeed library because I need access to the elements with "yweather" prefix (and I couldn't find a way of accessing them via JFeed). I decided to use the $.ajax method and parse the XML response instead. The JavaScript code below works fine in Firefox and IE but does not work in Safari (or Chrome FWIW): ``` function parseXml(xml) { var atmosphere = xml.getElementsByTagName("yweather:atmosphere"); var humidity = atmosphere[0].getAttribute("humidity"); $('#weatherFeed').html("Humidity: " + humidity); $('#weatherFeed').append( "<div style=\"text-align: center;margin-left: auto; margin-right: auto;\">" + city + ", " + state + "</div>"); } function getData(){ $.ajax({ type: 'GET', url: 'proxy.php?url=http://weather.yahooapis.com/forecastrss&p=94041', dataType: 'xml', success: function(xml) { parseXml(xml); } }); } if(Drupal.jsEnabled) { $(function() { getData(); setInterval("getData()", 30000); }); } ``` When I check the error console in Safari I see the following error message: `TypeError: Result of expression 'atmosphere[0]' [undefined] is not an object.` Is there an issue with using getElementsByTagName in Safari? Should I be accessing the object that's returned by getElementsByTagName differently?
2009/08/17
[ "https://Stackoverflow.com/questions/1285756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17640/" ]
I had the exact same problem, but came across the answer here: <http://reference.sitepoint.com/javascript/Document/getElementsByTagName> It has to do with the yweather namespace. Use getElementByTagNameNS function instead. `var atmosphere = xml.getElementsByTagName("yweather:atmosphere");` becomes `var atmosphere = xml.getElementsByTagNameNS("http://xml.weather.yahoo.com/ns/rss/1.0","atmosphere");` function reference: <http://reference.sitepoint.com/javascript/Document/getElementsByTagNameNS>
Have you tried atmosphere[1] instead of 0 for Chrome and Safari?
52,865
I have custom module, where after form\_submit, i do some calculations, and get result of those calculations in a variable. After i hit "submit", i can output those calculations with **drupal\_set\_message** , but i would like to format results (array), and print it bellow the submit button. How can i output resulting variable bellow the form or in the form, after submission ? ``` function mymodule_form_submit($form, &$form_state) { $a=$b+$c; // on submit, i would like to print/format $a on the reloaded form page } ``` Thanks!
2012/12/11
[ "https://drupal.stackexchange.com/questions/52865", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/5970/" ]
What you want to do is use something like `$form_state['temporary']` in your `myMod_submit` function. Set `$form_state['temporary'] = $someValue` and rebuild your form. You also want your `myMod_form` function to have a place holder for your data. When the form is loaded, simply check to see if your temp holder is populated. if it is then you know you have a result and display it. See code below. ``` function myMod_form($form, &$form_state) { ... if(!empty($form_state['temporary'])) { $form['results'] = array( '#type' => 'item', '#markup' => $form_state['temporary'], ); } return $form; } function myMod_submit($form_id, &$form_state) { ... $results = callSomeFunctionToGetResults(); $form_state['temporary'] = $results; $form_state['rebuild'] = TRUE; ... } ``` i omitted all my code that would populated `$results` but this should get you to where you need to go. ***quick addition here.*** I just realized that you wanted it to go to another page and not the same page. I believe in your `myMod_submit` function you can use `drupal_goto()`. pass it a url and also pass it some options. you can then parse out the options as your values in the other page. See [drupal\_goto](http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_goto/7). however, i haven't tested this option out.
If its a node form you can add an extra form submit handler to get the values Printed if not you probably have a submit function try [`print_r`](http://php.net/manual/en/function.print-r.php) As its a form submit you should try [`exit`](http://php.net/manual/en/function.exit.php) OR [`die`](http://php.net/manual/en/function.die.php) ``` function my_module_my_form_submit($form, &$form_state) { //drupal_set_message(t('The form has been submitted.')); //drupal_set_message('<pre>'.print_r($form_state, 1).'</pre>'); print_r($form_state, 1); die('Check the die !'); } ``` [Basic form with submit handler](http://drupal.org/node/717740) [How do I add an additional submit handler](https://drupal.stackexchange.com/questions/9436/how-do-i-add-an-additional-submit-handler)
52,865
I have custom module, where after form\_submit, i do some calculations, and get result of those calculations in a variable. After i hit "submit", i can output those calculations with **drupal\_set\_message** , but i would like to format results (array), and print it bellow the submit button. How can i output resulting variable bellow the form or in the form, after submission ? ``` function mymodule_form_submit($form, &$form_state) { $a=$b+$c; // on submit, i would like to print/format $a on the reloaded form page } ``` Thanks!
2012/12/11
[ "https://drupal.stackexchange.com/questions/52865", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/5970/" ]
What you want to do is use something like `$form_state['temporary']` in your `myMod_submit` function. Set `$form_state['temporary'] = $someValue` and rebuild your form. You also want your `myMod_form` function to have a place holder for your data. When the form is loaded, simply check to see if your temp holder is populated. if it is then you know you have a result and display it. See code below. ``` function myMod_form($form, &$form_state) { ... if(!empty($form_state['temporary'])) { $form['results'] = array( '#type' => 'item', '#markup' => $form_state['temporary'], ); } return $form; } function myMod_submit($form_id, &$form_state) { ... $results = callSomeFunctionToGetResults(); $form_state['temporary'] = $results; $form_state['rebuild'] = TRUE; ... } ``` i omitted all my code that would populated `$results` but this should get you to where you need to go. ***quick addition here.*** I just realized that you wanted it to go to another page and not the same page. I believe in your `myMod_submit` function you can use `drupal_goto()`. pass it a url and also pass it some options. you can then parse out the options as your values in the other page. See [drupal\_goto](http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_goto/7). however, i haven't tested this option out.
A simple solution to access variables outside the function in other function is to make the scope of the variable as [global](http://php.net/manual/en/language.variables.scope.php#language.variables.scope.global). ``` function mymodule_form_submit($form, &$form_state) { global $a; $a=$b+$c; } ``` And on submit, in other function you can access this variable by something like: ``` function some_page_load_function() { global $a; //print/format $a according to requirement. } ``` I've written the function name to be `some_page_load_function`, as I'm not sure about the function you're wishing to access the value; as you also mentioned that this module might be a part of admin region.
40,064,239
Today a very weird bug (or so I believe) started occurring. Here is the piece of code: ``` let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd" let dateObj = dateFormatter.dateFromString(serviceDate) dateFormatter.dateFormat = "dd/MM/yyyy" let serviceDateBr = dateFormatter.stringFromDate(dateObj!) ``` Now comes the strange part. When I set serviceDate = "2016-10-15", for example, it works: ``` let serviceDate = "2016-10-15" ... print("dateSQL: \(serviceDate), dateBR: \(serviceDateBr)") -------- Answer = dateSQL: 2016-10-15, dateBR: 15/10/2016 ``` On the other hand, when I just change serviceDate to "2016-10-16" it crashes. Not on day 17, 18 or any other. Just 16. ``` let serviceDate = "2016-10-16" ... print("dateSQL: \(serviceDate), dateBR: \(serviceDateBr)") -------- Answer = fatal error: unexpectedly found nil while unwrapping an Optional value ``` I already know that this fatal error occurs when the first formatting fails, returns nil and then I try to force unwrap it on stringFromDate(). But I can't see why it fails in first place. Can anyone help me? If it is relevant, I am using Xcode 7.3.1. This bug occurs on device and simulator. Many thanks.
2016/10/15
[ "https://Stackoverflow.com/questions/40064239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6071143/" ]
I suppose you are living in Brasil. On October 16, 2016 the daylight saving time changes and there is no 0:00.
I have tried on Xcode 7.3 and it seems work fine and the results ``` dateSQL: 2016-10-15, dateBR: 15/10/2016 ``` cloud you provide more info?
972,077
we know that view state is easily get abused, but asp.net webform are heavily depending on this feature. I want to know whether you disable viewstate by default, and ONLY add it wehn it's needed. Or you take the visual studio default, which actually enables viewstate by default.
2009/06/09
[ "https://Stackoverflow.com/questions/972077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35829/" ]
I tend to take the default of having it on when doing web.forms. But when writing my own user controls I disable it until I need it, or I find something doesn't work. I also monitor the size of the view state and when/if it gets too big I look at what the page is doing and change what I'm doing on the page. I.e. bind to data objects containing only the data that is needed and no more... stuff like that.
Personnaly, no. Eventually, to have it disabled will be the behaviour that you will want but most of the time, no. Also, I would do a manual ViewState optimization pass and disabled controls' ViewState that wouldn't need it if really necessary. It's better not to have the ViewState to worry about while you are in heavy development imo. I'm not saying here that you shouldn't care about the ViewState at all but to put EnableViewState aside until you feel the need to lighten the trips to the server.
972,077
we know that view state is easily get abused, but asp.net webform are heavily depending on this feature. I want to know whether you disable viewstate by default, and ONLY add it wehn it's needed. Or you take the visual studio default, which actually enables viewstate by default.
2009/06/09
[ "https://Stackoverflow.com/questions/972077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35829/" ]
I tend to take the default of having it on when doing web.forms. But when writing my own user controls I disable it until I need it, or I find something doesn't work. I also monitor the size of the view state and when/if it gets too big I look at what the page is doing and change what I'm doing on the page. I.e. bind to data objects containing only the data that is needed and no more... stuff like that.
I go one step further, I've created a class that inherits from the Page class and override 2 functions ``` protected override void SavePageStateToPersistenceMedium(object viewState) { } protected override object LoadPageStateFromPersistenceMedium() { return null; } ``` Then have my page that requires the viewstate to be disabled inherit from this. Works very well.
972,077
we know that view state is easily get abused, but asp.net webform are heavily depending on this feature. I want to know whether you disable viewstate by default, and ONLY add it wehn it's needed. Or you take the visual studio default, which actually enables viewstate by default.
2009/06/09
[ "https://Stackoverflow.com/questions/972077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35829/" ]
I tend to take the default of having it on when doing web.forms. But when writing my own user controls I disable it until I need it, or I find something doesn't work. I also monitor the size of the view state and when/if it gets too big I look at what the page is doing and change what I'm doing on the page. I.e. bind to data objects containing only the data that is needed and no more... stuff like that.
As others have said, unless we are talking about a fairly static page, I tend to leave the ViewState on while developing, and begin selectively disabling it when the page works. That way, it's one less thing to worry about upfront. You may find this interesting, in ASP.NET 4.0, we will have more efficient control over disabling the ViewState: <http://www.asp.net/learn/whitepapers/aspnet40/#_Toc223325478>
972,077
we know that view state is easily get abused, but asp.net webform are heavily depending on this feature. I want to know whether you disable viewstate by default, and ONLY add it wehn it's needed. Or you take the visual studio default, which actually enables viewstate by default.
2009/06/09
[ "https://Stackoverflow.com/questions/972077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35829/" ]
I tend to take the default of having it on when doing web.forms. But when writing my own user controls I disable it until I need it, or I find something doesn't work. I also monitor the size of the view state and when/if it gets too big I look at what the page is doing and change what I'm doing on the page. I.e. bind to data objects containing only the data that is needed and no more... stuff like that.
Turn off the ViewState by default by using a `<page>` element in the web.config. Using `EnableViewState="true"` in the `@Page` directive will no longer work once you disable the ViewState in the web.config. If you decide later that you need the ViewState for a specific page, you can turn it back on for just that page using a `<location>` element. ``` <configuration> <system.web> <pages enableViewState="false" /> </system.web> <location path="MyFolder/MyPage.aspx"> <system.web> <pages enableViewState="true" /> </system.web> </location> <location path="Site.master"> <system.web> <pages enableViewState="true" /> </system.web> </location> </configuration> ``` You need to do the same for any master pages that your ViewState enabled page uses.
972,077
we know that view state is easily get abused, but asp.net webform are heavily depending on this feature. I want to know whether you disable viewstate by default, and ONLY add it wehn it's needed. Or you take the visual studio default, which actually enables viewstate by default.
2009/06/09
[ "https://Stackoverflow.com/questions/972077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35829/" ]
Personnaly, no. Eventually, to have it disabled will be the behaviour that you will want but most of the time, no. Also, I would do a manual ViewState optimization pass and disabled controls' ViewState that wouldn't need it if really necessary. It's better not to have the ViewState to worry about while you are in heavy development imo. I'm not saying here that you shouldn't care about the ViewState at all but to put EnableViewState aside until you feel the need to lighten the trips to the server.
I go one step further, I've created a class that inherits from the Page class and override 2 functions ``` protected override void SavePageStateToPersistenceMedium(object viewState) { } protected override object LoadPageStateFromPersistenceMedium() { return null; } ``` Then have my page that requires the viewstate to be disabled inherit from this. Works very well.
972,077
we know that view state is easily get abused, but asp.net webform are heavily depending on this feature. I want to know whether you disable viewstate by default, and ONLY add it wehn it's needed. Or you take the visual studio default, which actually enables viewstate by default.
2009/06/09
[ "https://Stackoverflow.com/questions/972077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35829/" ]
As others have said, unless we are talking about a fairly static page, I tend to leave the ViewState on while developing, and begin selectively disabling it when the page works. That way, it's one less thing to worry about upfront. You may find this interesting, in ASP.NET 4.0, we will have more efficient control over disabling the ViewState: <http://www.asp.net/learn/whitepapers/aspnet40/#_Toc223325478>
Personnaly, no. Eventually, to have it disabled will be the behaviour that you will want but most of the time, no. Also, I would do a manual ViewState optimization pass and disabled controls' ViewState that wouldn't need it if really necessary. It's better not to have the ViewState to worry about while you are in heavy development imo. I'm not saying here that you shouldn't care about the ViewState at all but to put EnableViewState aside until you feel the need to lighten the trips to the server.
972,077
we know that view state is easily get abused, but asp.net webform are heavily depending on this feature. I want to know whether you disable viewstate by default, and ONLY add it wehn it's needed. Or you take the visual studio default, which actually enables viewstate by default.
2009/06/09
[ "https://Stackoverflow.com/questions/972077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35829/" ]
As others have said, unless we are talking about a fairly static page, I tend to leave the ViewState on while developing, and begin selectively disabling it when the page works. That way, it's one less thing to worry about upfront. You may find this interesting, in ASP.NET 4.0, we will have more efficient control over disabling the ViewState: <http://www.asp.net/learn/whitepapers/aspnet40/#_Toc223325478>
I go one step further, I've created a class that inherits from the Page class and override 2 functions ``` protected override void SavePageStateToPersistenceMedium(object viewState) { } protected override object LoadPageStateFromPersistenceMedium() { return null; } ``` Then have my page that requires the viewstate to be disabled inherit from this. Works very well.
972,077
we know that view state is easily get abused, but asp.net webform are heavily depending on this feature. I want to know whether you disable viewstate by default, and ONLY add it wehn it's needed. Or you take the visual studio default, which actually enables viewstate by default.
2009/06/09
[ "https://Stackoverflow.com/questions/972077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35829/" ]
Turn off the ViewState by default by using a `<page>` element in the web.config. Using `EnableViewState="true"` in the `@Page` directive will no longer work once you disable the ViewState in the web.config. If you decide later that you need the ViewState for a specific page, you can turn it back on for just that page using a `<location>` element. ``` <configuration> <system.web> <pages enableViewState="false" /> </system.web> <location path="MyFolder/MyPage.aspx"> <system.web> <pages enableViewState="true" /> </system.web> </location> <location path="Site.master"> <system.web> <pages enableViewState="true" /> </system.web> </location> </configuration> ``` You need to do the same for any master pages that your ViewState enabled page uses.
I go one step further, I've created a class that inherits from the Page class and override 2 functions ``` protected override void SavePageStateToPersistenceMedium(object viewState) { } protected override object LoadPageStateFromPersistenceMedium() { return null; } ``` Then have my page that requires the viewstate to be disabled inherit from this. Works very well.
972,077
we know that view state is easily get abused, but asp.net webform are heavily depending on this feature. I want to know whether you disable viewstate by default, and ONLY add it wehn it's needed. Or you take the visual studio default, which actually enables viewstate by default.
2009/06/09
[ "https://Stackoverflow.com/questions/972077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35829/" ]
As others have said, unless we are talking about a fairly static page, I tend to leave the ViewState on while developing, and begin selectively disabling it when the page works. That way, it's one less thing to worry about upfront. You may find this interesting, in ASP.NET 4.0, we will have more efficient control over disabling the ViewState: <http://www.asp.net/learn/whitepapers/aspnet40/#_Toc223325478>
Turn off the ViewState by default by using a `<page>` element in the web.config. Using `EnableViewState="true"` in the `@Page` directive will no longer work once you disable the ViewState in the web.config. If you decide later that you need the ViewState for a specific page, you can turn it back on for just that page using a `<location>` element. ``` <configuration> <system.web> <pages enableViewState="false" /> </system.web> <location path="MyFolder/MyPage.aspx"> <system.web> <pages enableViewState="true" /> </system.web> </location> <location path="Site.master"> <system.web> <pages enableViewState="true" /> </system.web> </location> </configuration> ``` You need to do the same for any master pages that your ViewState enabled page uses.
319,781
This is my dmesg error: ``` [10678.069113] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 [10678.069119] ata1.00: irq_stat 0x40000001 [10678.069124] ata1.00: failed command: FLUSH CACHE EXT [10678.069134] ata1.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 0 [10678.069136] res 51/04:00:34:cf:f3/00:00:00:00:00/a3 Emask 0x1 (device error) [10678.069141] ata1.00: status: { DRDY ERR } [10678.069145] ata1.00: error: { ABRT } [10678.076036] ata1.00: configured for UDMA/100 [10678.076046] ata1: EH complete ``` And this is my lspci, <http://pastebin.com/XbMPSV26> . How can I fix this? This happens randomly, and lasts a few seconds, and is extremely annoying.
2011/10/08
[ "https://serverfault.com/questions/319781", "https://serverfault.com", "https://serverfault.com/users/74468/" ]
Your system is momentarily hanging because a (most likely) disk fault is causing all kinds of interrupt errors and ATA errors. You *could* investigate further but if i were you, i'd just double check all the connections of that storage unit (which seems to be using an IDE 40pin or IDE 44pin flat cable) and if they're not visibly damaged, just replace the hard drive.
This error is most likely related to spread centrum clocking (SSC) out of boundery on the sata bus. there are far too many dwords accumulated during the slow period to practically buffer for release in the fast periods. However sata supports downspreading, there should be an option in your BIOS to turn SSC off and drives like those from WD have a SSC disable jumper (normaly open), try tweaking see if it helps. It helped me out to get rid of those { DRDY ERR } and { ABRT } errors once.
319,781
This is my dmesg error: ``` [10678.069113] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 [10678.069119] ata1.00: irq_stat 0x40000001 [10678.069124] ata1.00: failed command: FLUSH CACHE EXT [10678.069134] ata1.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 0 [10678.069136] res 51/04:00:34:cf:f3/00:00:00:00:00/a3 Emask 0x1 (device error) [10678.069141] ata1.00: status: { DRDY ERR } [10678.069145] ata1.00: error: { ABRT } [10678.076036] ata1.00: configured for UDMA/100 [10678.076046] ata1: EH complete ``` And this is my lspci, <http://pastebin.com/XbMPSV26> . How can I fix this? This happens randomly, and lasts a few seconds, and is extremely annoying.
2011/10/08
[ "https://serverfault.com/questions/319781", "https://serverfault.com", "https://serverfault.com/users/74468/" ]
I recently went through another scenario causing these problems: After a server crash I had to replace some pieces of my hardware. After setting up the new HW, some of my disks, which worked perfectly well before, threw those messages. Since I did not want to believe that all my disks failed at once, I digged a bit deeper into this and discovered the reason for my problem: My previous raid controller had activated a low-level security feature and locked the disks (although I was using mdadm software raid) rendering them unusable without this controller. It was a 3ware controller, which locked the disk by setting the password `3wareUserPassword` (including 15 spaces). After realizing this, I was able to recover by running ``` hdparm --security-unlock "3wareUserPassword " /dev/sdX hdparm --security-disable "3wareUserPassword " /dev/sdX hdparm --security-set-pass NULL /dev/sdX ``` with sdX being the device file of the drive. Here is the source of this helpful wisdom: <http://blog.chr.istoph.de/tag/hdpam/>
This error is most likely related to spread centrum clocking (SSC) out of boundery on the sata bus. there are far too many dwords accumulated during the slow period to practically buffer for release in the fast periods. However sata supports downspreading, there should be an option in your BIOS to turn SSC off and drives like those from WD have a SSC disable jumper (normaly open), try tweaking see if it helps. It helped me out to get rid of those { DRDY ERR } and { ABRT } errors once.
5,145,143
I have a result table with one row and some columns: ``` column1 column2 column3 column4 column5 column6 column7 column8 column9 ------------------------------------------------------------------------------------ 1.4 2.2 3.4 6.57 5.6 9.7 67.6 3.4 5.9 ``` I have a table like: ``` DECLARE @TTable TABLE( ID INT, Name VARCHAR(100), value FLOAT ) ``` I want to have something like ``` ID Name value ---------------------- 1 column1 1.4 2 column2 2.2 3 column3 3.4 4 column4 6.57 5 column5 5.6 6 column6 9.7 7 column7 67.6 8 column8 3.4 9 column9 5.9 ``` So I am doing something like: ``` INSERT @TTable SELECT [id] = ORDINAL_POSITION, [Name] = COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ORIGINALTABLE' ORDER BY id ``` this results with 2 fields '`id`', and '`Name`' of column, but How would you add the `value` field? If I add a `SELECT` to the query: ``` INSERT @TTable SELECT [id] = ORDINAL_POSITION, [Name] = COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ORIGINALTABLE' ORDER BY id, [value] = ... ```
2011/02/28
[ "https://Stackoverflow.com/questions/5145143", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265519/" ]
If you are using SQL Server 2008, the you can use `UNPIVOT` and dynamic SQL so you don't have to write every column on your own (Before using dynamic SQL take a look at this [link](http://www.sommarskog.se/dynamic_sql.html)). Try this: **UPDATED after comments** ``` DECLARE @Columns NVARCHAR(MAX)='', @Query NVARCHAR(MAX)='' DECLARE @CastColumns NVARCHAR(MAX)='' SELECT @Columns = @Columns + QUOTENAME(COLUMN_NAME) + ',', @CastColumns = @CastColumns+CASE WHEN data_type <> 'float' THEN 'CAST('+QUOTENAME(COLUMN_NAME)+' AS FLOAT) AS '+QUOTENAME(COLUMN_NAME) ELSE QUOTENAME(COLUMN_NAME) END+',' FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'YourTable' ORDER BY ORDINAL_POSITION SET @Columns = LEFT(@Columns,LEN(@Columns)-1) SET @CastColumns = LEFT(@CastColumns,LEN(@CastColumns)-1) SET @Query = ' SELECT ROW_NUMBER() OVER(ORDER BY CO.Ordinal_Position) Id, ColumnName, Value FROM (SELECT '+@CastColumns+' FROM YourTable) AS P UNPIVOT(value FOR ColumnName IN ('+@Columns+')) AS UC JOIN (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ''YourTable'') CO ON ColumnName = CO.COLUMN_NAME ' INSERT INTO @TTABLE EXEC sp_executesql @Query ``` Ok, now I changed the query so it does a `CAST` to FLOAT over the columns that are not already FLOAT. Let me know how it goes.
You need to do a cross-tab query to transform from a row with many columns to a number of rows with a couple of columns, good example [in this article](http://www.simple-talk.com/sql/t-sql-programming/creating-cross-tab-queries-and-pivot-tables-in-sql/). Or in [Celko's fantastic Sql For Smarties Book](http://books.google.co.uk/books?id=Hi9fMnOoRtAC&pg=PA542&lpg=PA542&dq=cross+tab+query+celko&source=bl&ots=tsdV-aV7Tr&sig=Rd-qUNm8pCzPq_VCOCU9vhHKCJM&hl=en&ei=W9lrTeelB82BhQebif3xDg&sa=X&oi=book_result&ct=result&resnum=6&ved=0CEAQ6AEwBQ#v=onepage&q&f=false) Basically you do a series of case statements that transform the table by pivoting it on an axis.
27,737,104
I have been working Augmented Reality for quite a few months. I have used third party tools like Unity/Vuforia to create augmented reality applications for android. I would like to create my own framework in which I will create my own AR apps. Can someone guide me to right tutorials/links to achieve my target. On a higher level, my plan is to create an application which can recognize multiple markers and match it with cloud stored models.
2015/01/02
[ "https://Stackoverflow.com/questions/27737104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4311444/" ]
You can get `administrator`'s SID by doing this: ``` wmic useraccount where name='administrator' get sid ``` This returns a result similar to this: ``` SID S-1-5-21-4067126559-1921051348-1512596144-500 ```
Thanks to well known SIDs we know that an admin account is always going to start with S-1-5- and ends with -500 (<http://blogs.technet.com/b/heyscriptingguy/archive/2005/07/22/how-can-i-determine-if-the-local-administrator-account-has-been-renamed-on-a-computer.aspx>). This also ensures you are getting the admin account even if somebody renamed it from administrator ``` wmic useraccount where "SID like 'S-1-5-%-500'" get sid ```
11,900,991
I have a normal HTTP page where in top header section I have a Sign in Link. On click of sign in link a twitter style Flyout sign in window appears, which should be a secured signin section. Can any one suggest me how could I achieve loading a HTTPS page or section in a HTTP page. Thanks
2012/08/10
[ "https://Stackoverflow.com/questions/11900991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1590130/" ]
Your statement is false. Any number of synchronized blocks can execute in parallel as long as they don't contend for the same lock. But if your question is about blocks contending for the same lock, then it is wrong to ask "why is it so" because that is the purpose of the whole concept. Programmers **need** a mutual exclusion mechanism and they get it from Java through `synchronized`. Finally, you may be asking "Why would we ever need to mutually exclude code segments from executing in parallel". The answer to that would be that there are many data structures that only make sense when they are organized in a certain way and when a thread updates the structure, it necessarily does it part by part, so the structure is in a "broken" state while it's doing the update. If another thread were to come along at that point and try to read the structure, or even worse, update it on its own, the whole thing would fall apart. EDIT ==== I saw your example and your comments and now it's obvious what is troubling you: the semantics of the `synchronized` modifier of a method. That means that the method will contend for a lock on `this`'s monitor. All `synchronized` methods of the same object will contend for the same lock.
Two Threads can execute synchronized blocks simultaneously till the point they are not locking the same object. In case the blocks are synchronized on different object... they can execute simultaneously. ``` synchronized(object1){ ... } synchronized(object2){ ... } ``` **EDIT:** `Please reason the output for http://pastebin.com/tcJT009i` **In your example when you are invoking synchronized methods the lock is acquired over the same object. Try creating two objects and see.**
11,900,991
I have a normal HTTP page where in top header section I have a Sign in Link. On click of sign in link a twitter style Flyout sign in window appears, which should be a secured signin section. Can any one suggest me how could I achieve loading a HTTPS page or section in a HTTP page. Thanks
2012/08/10
[ "https://Stackoverflow.com/questions/11900991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1590130/" ]
Your statement is false. Any number of synchronized blocks can execute in parallel as long as they don't contend for the same lock. But if your question is about blocks contending for the same lock, then it is wrong to ask "why is it so" because that is the purpose of the whole concept. Programmers **need** a mutual exclusion mechanism and they get it from Java through `synchronized`. Finally, you may be asking "Why would we ever need to mutually exclude code segments from executing in parallel". The answer to that would be that there are many data structures that only make sense when they are organized in a certain way and when a thread updates the structure, it necessarily does it part by part, so the structure is in a "broken" state while it's doing the update. If another thread were to come along at that point and try to read the structure, or even worse, update it on its own, the whole thing would fall apart. EDIT ==== I saw your example and your comments and now it's obvious what is troubling you: the semantics of the `synchronized` modifier of a method. That means that the method will contend for a lock on `this`'s monitor. All `synchronized` methods of the same object will contend for the same lock.
That is the whole concept of synchronization, if you are taking a lock on an object (or a class), none of the other threads can access any synchronized blocks. Example ``` Class A{ public void method1() { synchronized(this)//Block 1 taking lock on Object { //do something } } public void method2() { synchronized(this)//Block 2 taking lock on Object { //do something } } } ``` If one thread of an Object enters any of the synchronized blocks, all others threads **of the same object** will have to wait for that thread to come out of the synchronized block to enter any of the synchronized blocks. If there are N number of such blocks, only one thread of the Object can access only one block at a time. Please note my emphasis on **Threads of same Object**. The concept will not apply if we are dealing with threads from different objects. Let me also add that if you are taking a lock on **class**, the above concept will get expanded to any object of the class. So if instead of saying `synchronized(this)`, I would have used `synchronized(A.class)`, code will instruct JVM, that irrespective of the Object that thread belongs to, make it wait for other thread to finish the synchronized block execution. Edit: Please understand that when you are taking a lock (by using synchronized keyword), you are not just taking lock on one block. You are taking lock on the object. That means you are telling JVM "hey, this thread is doing some **critical work** which might change the state of the object (or class), so don't let any other thread do any other **critical work**" . Critical work, here refers to all the code in synchronized blocks which take lock on that particular Object (or class), and not only in one synchronized block.
11,900,991
I have a normal HTTP page where in top header section I have a Sign in Link. On click of sign in link a twitter style Flyout sign in window appears, which should be a secured signin section. Can any one suggest me how could I achieve loading a HTTPS page or section in a HTTP page. Thanks
2012/08/10
[ "https://Stackoverflow.com/questions/11900991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1590130/" ]
Your statement is false. Any number of synchronized blocks can execute in parallel as long as they don't contend for the same lock. But if your question is about blocks contending for the same lock, then it is wrong to ask "why is it so" because that is the purpose of the whole concept. Programmers **need** a mutual exclusion mechanism and they get it from Java through `synchronized`. Finally, you may be asking "Why would we ever need to mutually exclude code segments from executing in parallel". The answer to that would be that there are many data structures that only make sense when they are organized in a certain way and when a thread updates the structure, it necessarily does it part by part, so the structure is in a "broken" state while it's doing the update. If another thread were to come along at that point and try to read the structure, or even worse, update it on its own, the whole thing would fall apart. EDIT ==== I saw your example and your comments and now it's obvious what is troubling you: the semantics of the `synchronized` modifier of a method. That means that the method will contend for a lock on `this`'s monitor. All `synchronized` methods of the same object will contend for the same lock.
This is not absolutely true. If you are dealing with locks on different objects then multiple threads can execute those blocks. ``` synchronized(obj1){ //your code here } synchronized(obj2){ //your code here } ``` In above case one thread can execute first and second can execute second block , the point is here threads are working with different locks. Your statement is correct if threads are dealing with same `lock`.Every object is associated with only one lock in java if one thread has acquired the lock and executing then other thread has to wait until first thread release that `lock`.Lock can be acquired by `synchronized` block or method.
11,900,991
I have a normal HTTP page where in top header section I have a Sign in Link. On click of sign in link a twitter style Flyout sign in window appears, which should be a secured signin section. Can any one suggest me how could I achieve loading a HTTPS page or section in a HTTP page. Thanks
2012/08/10
[ "https://Stackoverflow.com/questions/11900991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1590130/" ]
That is the whole concept of synchronization, if you are taking a lock on an object (or a class), none of the other threads can access any synchronized blocks. Example ``` Class A{ public void method1() { synchronized(this)//Block 1 taking lock on Object { //do something } } public void method2() { synchronized(this)//Block 2 taking lock on Object { //do something } } } ``` If one thread of an Object enters any of the synchronized blocks, all others threads **of the same object** will have to wait for that thread to come out of the synchronized block to enter any of the synchronized blocks. If there are N number of such blocks, only one thread of the Object can access only one block at a time. Please note my emphasis on **Threads of same Object**. The concept will not apply if we are dealing with threads from different objects. Let me also add that if you are taking a lock on **class**, the above concept will get expanded to any object of the class. So if instead of saying `synchronized(this)`, I would have used `synchronized(A.class)`, code will instruct JVM, that irrespective of the Object that thread belongs to, make it wait for other thread to finish the synchronized block execution. Edit: Please understand that when you are taking a lock (by using synchronized keyword), you are not just taking lock on one block. You are taking lock on the object. That means you are telling JVM "hey, this thread is doing some **critical work** which might change the state of the object (or class), so don't let any other thread do any other **critical work**" . Critical work, here refers to all the code in synchronized blocks which take lock on that particular Object (or class), and not only in one synchronized block.
Two Threads can execute synchronized blocks simultaneously till the point they are not locking the same object. In case the blocks are synchronized on different object... they can execute simultaneously. ``` synchronized(object1){ ... } synchronized(object2){ ... } ``` **EDIT:** `Please reason the output for http://pastebin.com/tcJT009i` **In your example when you are invoking synchronized methods the lock is acquired over the same object. Try creating two objects and see.**
11,900,991
I have a normal HTTP page where in top header section I have a Sign in Link. On click of sign in link a twitter style Flyout sign in window appears, which should be a secured signin section. Can any one suggest me how could I achieve loading a HTTPS page or section in a HTTP page. Thanks
2012/08/10
[ "https://Stackoverflow.com/questions/11900991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1590130/" ]
That is the whole concept of synchronization, if you are taking a lock on an object (or a class), none of the other threads can access any synchronized blocks. Example ``` Class A{ public void method1() { synchronized(this)//Block 1 taking lock on Object { //do something } } public void method2() { synchronized(this)//Block 2 taking lock on Object { //do something } } } ``` If one thread of an Object enters any of the synchronized blocks, all others threads **of the same object** will have to wait for that thread to come out of the synchronized block to enter any of the synchronized blocks. If there are N number of such blocks, only one thread of the Object can access only one block at a time. Please note my emphasis on **Threads of same Object**. The concept will not apply if we are dealing with threads from different objects. Let me also add that if you are taking a lock on **class**, the above concept will get expanded to any object of the class. So if instead of saying `synchronized(this)`, I would have used `synchronized(A.class)`, code will instruct JVM, that irrespective of the Object that thread belongs to, make it wait for other thread to finish the synchronized block execution. Edit: Please understand that when you are taking a lock (by using synchronized keyword), you are not just taking lock on one block. You are taking lock on the object. That means you are telling JVM "hey, this thread is doing some **critical work** which might change the state of the object (or class), so don't let any other thread do any other **critical work**" . Critical work, here refers to all the code in synchronized blocks which take lock on that particular Object (or class), and not only in one synchronized block.
This is not absolutely true. If you are dealing with locks on different objects then multiple threads can execute those blocks. ``` synchronized(obj1){ //your code here } synchronized(obj2){ //your code here } ``` In above case one thread can execute first and second can execute second block , the point is here threads are working with different locks. Your statement is correct if threads are dealing with same `lock`.Every object is associated with only one lock in java if one thread has acquired the lock and executing then other thread has to wait until first thread release that `lock`.Lock can be acquired by `synchronized` block or method.
12,207
Well, 2016 is finally over. It's been a long year and our first regularly scheduled Bridge Movie Night season. [Can you believe that it's been two years](https://gaming.meta.stackexchange.com/questions/10160/bridge-movie-night)? Putting aside how old I'm making you all feeling, it's time to begin another year of Bridge Movie Nights! Popcorn, the silver screen, exciting stories, and our wonderful Arqade community! Let's have another great year of movie-watching. A new addition I'm making to our Movie Nights is the introduction of a Google Calendar. I'll post it both here and in the canonical [So You Want to Attend Movie Night](https://gaming.meta.stackexchange.com/questions/11441/so-you-want-to-attend-movie-night) post when it's ready. [Scheduling votes will be taken here](http://www.strawpoll.me/12069621) and votes will be tallied and a decision will be made by the end of this month (January).
2017/01/09
[ "https://gaming.meta.stackexchange.com/questions/12207", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/27975/" ]
Hell or High Water ================== This is different from the movies we normally watch, but it looks good, and the critical reception was been positive. Essentially, in order to protect his family ranch and provide for his son a man teams up with his brother (who's an ex-con) to rob a bank. Summary courtesy of IMBD: > > A divorced father and his ex-con older brother resort to a desperate scheme in order to save their family's ranch in West Texas. > > > [![enter image description here](http://t1.gstatic.com/images?q=tbn:ANd9GcRYPGO1eXsOXccVk-YmuR5XBUsr9Cjf7PrrAdc-KngRAptlynNl)](http://t1.gstatic.com/images?q=tbn:ANd9GcRYPGO1eXsOXccVk-YmuR5XBUsr9Cjf7PrrAdc-KngRAptlynNl) [IMDB](http://www.imdb.com/title/tt2582782/) | [Rotten Tomatoes 98%](https://www.rottentomatoes.com/m/hell_or_high_water/) | [Trailer](https://www.youtube.com/watch?v=JQoqsKoJVDw)
Idiocracy ========= Relevant. > > Private Joe Bauers, the definition of "average American", is selected by the Pentagon to be the guinea pig for a top-secret hibernation program. Forgotten, he awakes five centuries in the future. He discovers a society so incredibly dumbed down that he's easily the most intelligent person alive. > > > [![enter image description here](https://www.thestoryoftexas.com/upload/images/events/movies/idiocracy-poster.jpg?1458770757)](https://www.thestoryoftexas.com/upload/images/events/movies/idiocracy-poster.jpg?1458770757) [IMDB](http://www.imdb.com/title/tt0387808/) | [Rotten Tomatoes 74%](https://www.rottentomatoes.com/m/idiocracy/) | [Trailer](https://www.youtube.com/watch?v=BBvIweCIgwk)
12,207
Well, 2016 is finally over. It's been a long year and our first regularly scheduled Bridge Movie Night season. [Can you believe that it's been two years](https://gaming.meta.stackexchange.com/questions/10160/bridge-movie-night)? Putting aside how old I'm making you all feeling, it's time to begin another year of Bridge Movie Nights! Popcorn, the silver screen, exciting stories, and our wonderful Arqade community! Let's have another great year of movie-watching. A new addition I'm making to our Movie Nights is the introduction of a Google Calendar. I'll post it both here and in the canonical [So You Want to Attend Movie Night](https://gaming.meta.stackexchange.com/questions/11441/so-you-want-to-attend-movie-night) post when it's ready. [Scheduling votes will be taken here](http://www.strawpoll.me/12069621) and votes will be tallied and a decision will be made by the end of this month (January).
2017/01/09
[ "https://gaming.meta.stackexchange.com/questions/12207", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/27975/" ]
Kubo and the Two Strings ======================== This looks like a fun little movie good for the whole family, with some pretty solid animation. The critical reception to the movie was been really positive as well. Summary courtesy of google is: > > Young Kubo's peaceful existence comes crashing down when he accidentally summons a vengeful spirit from the past. Now on the run, Kubo joins forces with Monkey and Beetle to unlock a secret legacy. Armed with a magical instrument, Kubo must battle the Moon King and other gods and monsters to save his family and solve the mystery of his fallen father, the greatest samurai warrior the world has ever known. > > > [![enter image description here](http://t2.gstatic.com/images?q=tbn:ANd9GcRQeUx8alN89H9qOSbfZY9sKwIOECZSYcz2LA3auB3bldJI-hmE)](http://t2.gstatic.com/images?q=tbn:ANd9GcRQeUx8alN89H9qOSbfZY9sKwIOECZSYcz2LA3auB3bldJI-hmE) [IMDB](http://www.imdb.com/title/tt4302938/) | [Rotten Tomatoes 97%](https://www.rottentomatoes.com/m/kubo_and_the_two_strings_2016/) | [Trailer](https://www.youtube.com/watch?v=FfApAsZKKcg)
District 9 ========== I see GnomeSlice's relevance, and raise more relevant. Idea shamelessly stolen. Sue me. In addition to being relevant, this is also a good movie. > > An extraterrestrial race forced to live in slum-like conditions on Earth suddenly finds a kindred spirit in a government agent who is exposed to their biotechnology. > > > [![District 9 movie poster](https://images-na.ssl-images-amazon.com/images/M/MV5BMTM4OTI1OTM5NF5BMl5BanBnXkFtZTcwMzk5MTU1Mg@@._V1_SY1000_CR0,0,675,1000_AL_.jpg)](https://images-na.ssl-images-amazon.com/images/M/MV5BMTM4OTI1OTM5NF5BMl5BanBnXkFtZTcwMzk5MTU1Mg@@._V1_SY1000_CR0,0,675,1000_AL_.jpg) [IMDB](http://www.imdb.com/title/tt1136608/) | [Rotten Tomatoes 90%](https://www.rottentomatoes.com/m/district_9) | [Trailer](https://www.youtube.com/watch?v=DyLUwOcR5pk) | [Content Advisory (rated R)](http://www.imdb.com/title/tt1136608/parentalguide?ref_=tt_stry_pg)
12,207
Well, 2016 is finally over. It's been a long year and our first regularly scheduled Bridge Movie Night season. [Can you believe that it's been two years](https://gaming.meta.stackexchange.com/questions/10160/bridge-movie-night)? Putting aside how old I'm making you all feeling, it's time to begin another year of Bridge Movie Nights! Popcorn, the silver screen, exciting stories, and our wonderful Arqade community! Let's have another great year of movie-watching. A new addition I'm making to our Movie Nights is the introduction of a Google Calendar. I'll post it both here and in the canonical [So You Want to Attend Movie Night](https://gaming.meta.stackexchange.com/questions/11441/so-you-want-to-attend-movie-night) post when it's ready. [Scheduling votes will be taken here](http://www.strawpoll.me/12069621) and votes will be tallied and a decision will be made by the end of this month (January).
2017/01/09
[ "https://gaming.meta.stackexchange.com/questions/12207", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/27975/" ]
Kubo and the Two Strings ======================== This looks like a fun little movie good for the whole family, with some pretty solid animation. The critical reception to the movie was been really positive as well. Summary courtesy of google is: > > Young Kubo's peaceful existence comes crashing down when he accidentally summons a vengeful spirit from the past. Now on the run, Kubo joins forces with Monkey and Beetle to unlock a secret legacy. Armed with a magical instrument, Kubo must battle the Moon King and other gods and monsters to save his family and solve the mystery of his fallen father, the greatest samurai warrior the world has ever known. > > > [![enter image description here](http://t2.gstatic.com/images?q=tbn:ANd9GcRQeUx8alN89H9qOSbfZY9sKwIOECZSYcz2LA3auB3bldJI-hmE)](http://t2.gstatic.com/images?q=tbn:ANd9GcRQeUx8alN89H9qOSbfZY9sKwIOECZSYcz2LA3auB3bldJI-hmE) [IMDB](http://www.imdb.com/title/tt4302938/) | [Rotten Tomatoes 97%](https://www.rottentomatoes.com/m/kubo_and_the_two_strings_2016/) | [Trailer](https://www.youtube.com/watch?v=FfApAsZKKcg)
Idiocracy ========= Relevant. > > Private Joe Bauers, the definition of "average American", is selected by the Pentagon to be the guinea pig for a top-secret hibernation program. Forgotten, he awakes five centuries in the future. He discovers a society so incredibly dumbed down that he's easily the most intelligent person alive. > > > [![enter image description here](https://www.thestoryoftexas.com/upload/images/events/movies/idiocracy-poster.jpg?1458770757)](https://www.thestoryoftexas.com/upload/images/events/movies/idiocracy-poster.jpg?1458770757) [IMDB](http://www.imdb.com/title/tt0387808/) | [Rotten Tomatoes 74%](https://www.rottentomatoes.com/m/idiocracy/) | [Trailer](https://www.youtube.com/watch?v=BBvIweCIgwk)
12,207
Well, 2016 is finally over. It's been a long year and our first regularly scheduled Bridge Movie Night season. [Can you believe that it's been two years](https://gaming.meta.stackexchange.com/questions/10160/bridge-movie-night)? Putting aside how old I'm making you all feeling, it's time to begin another year of Bridge Movie Nights! Popcorn, the silver screen, exciting stories, and our wonderful Arqade community! Let's have another great year of movie-watching. A new addition I'm making to our Movie Nights is the introduction of a Google Calendar. I'll post it both here and in the canonical [So You Want to Attend Movie Night](https://gaming.meta.stackexchange.com/questions/11441/so-you-want-to-attend-movie-night) post when it's ready. [Scheduling votes will be taken here](http://www.strawpoll.me/12069621) and votes will be tallied and a decision will be made by the end of this month (January).
2017/01/09
[ "https://gaming.meta.stackexchange.com/questions/12207", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/27975/" ]
Hell or High Water ================== This is different from the movies we normally watch, but it looks good, and the critical reception was been positive. Essentially, in order to protect his family ranch and provide for his son a man teams up with his brother (who's an ex-con) to rob a bank. Summary courtesy of IMBD: > > A divorced father and his ex-con older brother resort to a desperate scheme in order to save their family's ranch in West Texas. > > > [![enter image description here](http://t1.gstatic.com/images?q=tbn:ANd9GcRYPGO1eXsOXccVk-YmuR5XBUsr9Cjf7PrrAdc-KngRAptlynNl)](http://t1.gstatic.com/images?q=tbn:ANd9GcRYPGO1eXsOXccVk-YmuR5XBUsr9Cjf7PrrAdc-KngRAptlynNl) [IMDB](http://www.imdb.com/title/tt2582782/) | [Rotten Tomatoes 98%](https://www.rottentomatoes.com/m/hell_or_high_water/) | [Trailer](https://www.youtube.com/watch?v=JQoqsKoJVDw)
District 9 ========== I see GnomeSlice's relevance, and raise more relevant. Idea shamelessly stolen. Sue me. In addition to being relevant, this is also a good movie. > > An extraterrestrial race forced to live in slum-like conditions on Earth suddenly finds a kindred spirit in a government agent who is exposed to their biotechnology. > > > [![District 9 movie poster](https://images-na.ssl-images-amazon.com/images/M/MV5BMTM4OTI1OTM5NF5BMl5BanBnXkFtZTcwMzk5MTU1Mg@@._V1_SY1000_CR0,0,675,1000_AL_.jpg)](https://images-na.ssl-images-amazon.com/images/M/MV5BMTM4OTI1OTM5NF5BMl5BanBnXkFtZTcwMzk5MTU1Mg@@._V1_SY1000_CR0,0,675,1000_AL_.jpg) [IMDB](http://www.imdb.com/title/tt1136608/) | [Rotten Tomatoes 90%](https://www.rottentomatoes.com/m/district_9) | [Trailer](https://www.youtube.com/watch?v=DyLUwOcR5pk) | [Content Advisory (rated R)](http://www.imdb.com/title/tt1136608/parentalguide?ref_=tt_stry_pg)
12,207
Well, 2016 is finally over. It's been a long year and our first regularly scheduled Bridge Movie Night season. [Can you believe that it's been two years](https://gaming.meta.stackexchange.com/questions/10160/bridge-movie-night)? Putting aside how old I'm making you all feeling, it's time to begin another year of Bridge Movie Nights! Popcorn, the silver screen, exciting stories, and our wonderful Arqade community! Let's have another great year of movie-watching. A new addition I'm making to our Movie Nights is the introduction of a Google Calendar. I'll post it both here and in the canonical [So You Want to Attend Movie Night](https://gaming.meta.stackexchange.com/questions/11441/so-you-want-to-attend-movie-night) post when it's ready. [Scheduling votes will be taken here](http://www.strawpoll.me/12069621) and votes will be tallied and a decision will be made by the end of this month (January).
2017/01/09
[ "https://gaming.meta.stackexchange.com/questions/12207", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/27975/" ]
Kubo and the Two Strings ======================== This looks like a fun little movie good for the whole family, with some pretty solid animation. The critical reception to the movie was been really positive as well. Summary courtesy of google is: > > Young Kubo's peaceful existence comes crashing down when he accidentally summons a vengeful spirit from the past. Now on the run, Kubo joins forces with Monkey and Beetle to unlock a secret legacy. Armed with a magical instrument, Kubo must battle the Moon King and other gods and monsters to save his family and solve the mystery of his fallen father, the greatest samurai warrior the world has ever known. > > > [![enter image description here](http://t2.gstatic.com/images?q=tbn:ANd9GcRQeUx8alN89H9qOSbfZY9sKwIOECZSYcz2LA3auB3bldJI-hmE)](http://t2.gstatic.com/images?q=tbn:ANd9GcRQeUx8alN89H9qOSbfZY9sKwIOECZSYcz2LA3auB3bldJI-hmE) [IMDB](http://www.imdb.com/title/tt4302938/) | [Rotten Tomatoes 97%](https://www.rottentomatoes.com/m/kubo_and_the_two_strings_2016/) | [Trailer](https://www.youtube.com/watch?v=FfApAsZKKcg)
Viva Amiga ========== I'm not sure if documentaries are up for consideration, but this one covers the rise and fall of the Commodore Amiga and the culture that developed around it, which I think would be interesting to people here. From IMDB: > > In a world of green on black, they dared to dream in color. 1985: An upstart team of Silicon Valley mavericks created a miracle: the Amiga computer. A machine made for creativity. For games, for art, for expression. Breaking from the mold set by IBM and Apple, this was something new. Something to change what people believed computers could do. 2016: The future they saw isn't the one we live in now. Or is it? From the creation of the world's first multimedia digital art powerhouse, to a bankrupt shell sold and resold into obscurity, to a post-punk spark revitalized by determined fans. Viva Amiga is a look at a digital dream and the freaks, geeks and geniuses who brought it to life. And the Amiga is still alive. > > > [![enter image description here](https://images-na.ssl-images-amazon.com/images/M/MV5BMmFiYjlmNmMtZDgxOC00MTVlLTg3ODEtNTYwZTIwMDg3MDVhL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyMTI3NDg2NzU@._V1_.jpg)](https://images-na.ssl-images-amazon.com/images/M/MV5BMmFiYjlmNmMtZDgxOC00MTVlLTg3ODEtNTYwZTIwMDg3MDVhL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyMTI3NDg2NzU@._V1_.jpg) [IMDB](http://www.imdb.com/title/tt6398570/) | [Trailer](https://www.youtube.com/watch?v=NHCxvZJW1S8)
12,207
Well, 2016 is finally over. It's been a long year and our first regularly scheduled Bridge Movie Night season. [Can you believe that it's been two years](https://gaming.meta.stackexchange.com/questions/10160/bridge-movie-night)? Putting aside how old I'm making you all feeling, it's time to begin another year of Bridge Movie Nights! Popcorn, the silver screen, exciting stories, and our wonderful Arqade community! Let's have another great year of movie-watching. A new addition I'm making to our Movie Nights is the introduction of a Google Calendar. I'll post it both here and in the canonical [So You Want to Attend Movie Night](https://gaming.meta.stackexchange.com/questions/11441/so-you-want-to-attend-movie-night) post when it's ready. [Scheduling votes will be taken here](http://www.strawpoll.me/12069621) and votes will be tallied and a decision will be made by the end of this month (January).
2017/01/09
[ "https://gaming.meta.stackexchange.com/questions/12207", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/27975/" ]
Hell or High Water ================== This is different from the movies we normally watch, but it looks good, and the critical reception was been positive. Essentially, in order to protect his family ranch and provide for his son a man teams up with his brother (who's an ex-con) to rob a bank. Summary courtesy of IMBD: > > A divorced father and his ex-con older brother resort to a desperate scheme in order to save their family's ranch in West Texas. > > > [![enter image description here](http://t1.gstatic.com/images?q=tbn:ANd9GcRYPGO1eXsOXccVk-YmuR5XBUsr9Cjf7PrrAdc-KngRAptlynNl)](http://t1.gstatic.com/images?q=tbn:ANd9GcRYPGO1eXsOXccVk-YmuR5XBUsr9Cjf7PrrAdc-KngRAptlynNl) [IMDB](http://www.imdb.com/title/tt2582782/) | [Rotten Tomatoes 98%](https://www.rottentomatoes.com/m/hell_or_high_water/) | [Trailer](https://www.youtube.com/watch?v=JQoqsKoJVDw)
Viva Amiga ========== I'm not sure if documentaries are up for consideration, but this one covers the rise and fall of the Commodore Amiga and the culture that developed around it, which I think would be interesting to people here. From IMDB: > > In a world of green on black, they dared to dream in color. 1985: An upstart team of Silicon Valley mavericks created a miracle: the Amiga computer. A machine made for creativity. For games, for art, for expression. Breaking from the mold set by IBM and Apple, this was something new. Something to change what people believed computers could do. 2016: The future they saw isn't the one we live in now. Or is it? From the creation of the world's first multimedia digital art powerhouse, to a bankrupt shell sold and resold into obscurity, to a post-punk spark revitalized by determined fans. Viva Amiga is a look at a digital dream and the freaks, geeks and geniuses who brought it to life. And the Amiga is still alive. > > > [![enter image description here](https://images-na.ssl-images-amazon.com/images/M/MV5BMmFiYjlmNmMtZDgxOC00MTVlLTg3ODEtNTYwZTIwMDg3MDVhL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyMTI3NDg2NzU@._V1_.jpg)](https://images-na.ssl-images-amazon.com/images/M/MV5BMmFiYjlmNmMtZDgxOC00MTVlLTg3ODEtNTYwZTIwMDg3MDVhL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyMTI3NDg2NzU@._V1_.jpg) [IMDB](http://www.imdb.com/title/tt6398570/) | [Trailer](https://www.youtube.com/watch?v=NHCxvZJW1S8)
12,207
Well, 2016 is finally over. It's been a long year and our first regularly scheduled Bridge Movie Night season. [Can you believe that it's been two years](https://gaming.meta.stackexchange.com/questions/10160/bridge-movie-night)? Putting aside how old I'm making you all feeling, it's time to begin another year of Bridge Movie Nights! Popcorn, the silver screen, exciting stories, and our wonderful Arqade community! Let's have another great year of movie-watching. A new addition I'm making to our Movie Nights is the introduction of a Google Calendar. I'll post it both here and in the canonical [So You Want to Attend Movie Night](https://gaming.meta.stackexchange.com/questions/11441/so-you-want-to-attend-movie-night) post when it's ready. [Scheduling votes will be taken here](http://www.strawpoll.me/12069621) and votes will be tallied and a decision will be made by the end of this month (January).
2017/01/09
[ "https://gaming.meta.stackexchange.com/questions/12207", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/27975/" ]
Movie Night Decision: ===================== [![enter image description here](https://i.stack.imgur.com/r8e1c.jpg)](https://i.stack.imgur.com/r8e1c.jpg) ### Kubo and the Two Strings The scheduling poll has resulted as follows: [![enter image description here](https://i.stack.imgur.com/ZlYdi.png)](https://i.stack.imgur.com/ZlYdi.png) Now, there's been some talk about what hour to start the showing. For the past several movie nights, the movie has been started at 11:00 PM UTC-0. However, this was due to the first few movie nights beginning on a Friday rather than a Saturday and out of a need to accommodate people who work on weekdays, I had scheduled it then. Now that movie nights are firmly scheduled on Saturdays, I feel that it is appropriate to adjust the showtime to more easily accommodate some of our friends outside of the American continents. ---[Here is a poll with a selection of available times. Pick as many as you can show up to and I'll do my best to pick a schedule that best fits everyone's times](http://doodle.com/poll/rv95t7te5c7fwrpe)--- Movie Night will be occurring at 7:00PM UTC-0.
Viva Amiga ========== I'm not sure if documentaries are up for consideration, but this one covers the rise and fall of the Commodore Amiga and the culture that developed around it, which I think would be interesting to people here. From IMDB: > > In a world of green on black, they dared to dream in color. 1985: An upstart team of Silicon Valley mavericks created a miracle: the Amiga computer. A machine made for creativity. For games, for art, for expression. Breaking from the mold set by IBM and Apple, this was something new. Something to change what people believed computers could do. 2016: The future they saw isn't the one we live in now. Or is it? From the creation of the world's first multimedia digital art powerhouse, to a bankrupt shell sold and resold into obscurity, to a post-punk spark revitalized by determined fans. Viva Amiga is a look at a digital dream and the freaks, geeks and geniuses who brought it to life. And the Amiga is still alive. > > > [![enter image description here](https://images-na.ssl-images-amazon.com/images/M/MV5BMmFiYjlmNmMtZDgxOC00MTVlLTg3ODEtNTYwZTIwMDg3MDVhL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyMTI3NDg2NzU@._V1_.jpg)](https://images-na.ssl-images-amazon.com/images/M/MV5BMmFiYjlmNmMtZDgxOC00MTVlLTg3ODEtNTYwZTIwMDg3MDVhL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyMTI3NDg2NzU@._V1_.jpg) [IMDB](http://www.imdb.com/title/tt6398570/) | [Trailer](https://www.youtube.com/watch?v=NHCxvZJW1S8)
12,207
Well, 2016 is finally over. It's been a long year and our first regularly scheduled Bridge Movie Night season. [Can you believe that it's been two years](https://gaming.meta.stackexchange.com/questions/10160/bridge-movie-night)? Putting aside how old I'm making you all feeling, it's time to begin another year of Bridge Movie Nights! Popcorn, the silver screen, exciting stories, and our wonderful Arqade community! Let's have another great year of movie-watching. A new addition I'm making to our Movie Nights is the introduction of a Google Calendar. I'll post it both here and in the canonical [So You Want to Attend Movie Night](https://gaming.meta.stackexchange.com/questions/11441/so-you-want-to-attend-movie-night) post when it's ready. [Scheduling votes will be taken here](http://www.strawpoll.me/12069621) and votes will be tallied and a decision will be made by the end of this month (January).
2017/01/09
[ "https://gaming.meta.stackexchange.com/questions/12207", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/27975/" ]
Hell or High Water ================== This is different from the movies we normally watch, but it looks good, and the critical reception was been positive. Essentially, in order to protect his family ranch and provide for his son a man teams up with his brother (who's an ex-con) to rob a bank. Summary courtesy of IMBD: > > A divorced father and his ex-con older brother resort to a desperate scheme in order to save their family's ranch in West Texas. > > > [![enter image description here](http://t1.gstatic.com/images?q=tbn:ANd9GcRYPGO1eXsOXccVk-YmuR5XBUsr9Cjf7PrrAdc-KngRAptlynNl)](http://t1.gstatic.com/images?q=tbn:ANd9GcRYPGO1eXsOXccVk-YmuR5XBUsr9Cjf7PrrAdc-KngRAptlynNl) [IMDB](http://www.imdb.com/title/tt2582782/) | [Rotten Tomatoes 98%](https://www.rottentomatoes.com/m/hell_or_high_water/) | [Trailer](https://www.youtube.com/watch?v=JQoqsKoJVDw)
Old spy movie based in WW2 starring Richard Burton and Clint Eastwood. I watched it back in the day and thought it was pretty interesting and had some pretty good acting. > > Allied agents stage a daring raid on a castle where the Nazis are holding an American General prisoner... but that's not all that's really going on. > > > [![![enter image description here](https://i.stack.imgur.com/y07XY.jpg)](https://i.stack.imgur.com/y07XY.jpg) [IMDB](http://www.imdb.com/title/tt0065207/) | [Rotten Tomatoes 88%](https://www.rottentomatoes.com/m/where_eagles_dare/) | [Trailer](https://www.youtube.com/watch?v=8OpMRRgTseI)
12,207
Well, 2016 is finally over. It's been a long year and our first regularly scheduled Bridge Movie Night season. [Can you believe that it's been two years](https://gaming.meta.stackexchange.com/questions/10160/bridge-movie-night)? Putting aside how old I'm making you all feeling, it's time to begin another year of Bridge Movie Nights! Popcorn, the silver screen, exciting stories, and our wonderful Arqade community! Let's have another great year of movie-watching. A new addition I'm making to our Movie Nights is the introduction of a Google Calendar. I'll post it both here and in the canonical [So You Want to Attend Movie Night](https://gaming.meta.stackexchange.com/questions/11441/so-you-want-to-attend-movie-night) post when it's ready. [Scheduling votes will be taken here](http://www.strawpoll.me/12069621) and votes will be tallied and a decision will be made by the end of this month (January).
2017/01/09
[ "https://gaming.meta.stackexchange.com/questions/12207", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/27975/" ]
Movie Night Decision: ===================== [![enter image description here](https://i.stack.imgur.com/r8e1c.jpg)](https://i.stack.imgur.com/r8e1c.jpg) ### Kubo and the Two Strings The scheduling poll has resulted as follows: [![enter image description here](https://i.stack.imgur.com/ZlYdi.png)](https://i.stack.imgur.com/ZlYdi.png) Now, there's been some talk about what hour to start the showing. For the past several movie nights, the movie has been started at 11:00 PM UTC-0. However, this was due to the first few movie nights beginning on a Friday rather than a Saturday and out of a need to accommodate people who work on weekdays, I had scheduled it then. Now that movie nights are firmly scheduled on Saturdays, I feel that it is appropriate to adjust the showtime to more easily accommodate some of our friends outside of the American continents. ---[Here is a poll with a selection of available times. Pick as many as you can show up to and I'll do my best to pick a schedule that best fits everyone's times](http://doodle.com/poll/rv95t7te5c7fwrpe)--- Movie Night will be occurring at 7:00PM UTC-0.
Old spy movie based in WW2 starring Richard Burton and Clint Eastwood. I watched it back in the day and thought it was pretty interesting and had some pretty good acting. > > Allied agents stage a daring raid on a castle where the Nazis are holding an American General prisoner... but that's not all that's really going on. > > > [![![enter image description here](https://i.stack.imgur.com/y07XY.jpg)](https://i.stack.imgur.com/y07XY.jpg) [IMDB](http://www.imdb.com/title/tt0065207/) | [Rotten Tomatoes 88%](https://www.rottentomatoes.com/m/where_eagles_dare/) | [Trailer](https://www.youtube.com/watch?v=8OpMRRgTseI)
12,207
Well, 2016 is finally over. It's been a long year and our first regularly scheduled Bridge Movie Night season. [Can you believe that it's been two years](https://gaming.meta.stackexchange.com/questions/10160/bridge-movie-night)? Putting aside how old I'm making you all feeling, it's time to begin another year of Bridge Movie Nights! Popcorn, the silver screen, exciting stories, and our wonderful Arqade community! Let's have another great year of movie-watching. A new addition I'm making to our Movie Nights is the introduction of a Google Calendar. I'll post it both here and in the canonical [So You Want to Attend Movie Night](https://gaming.meta.stackexchange.com/questions/11441/so-you-want-to-attend-movie-night) post when it's ready. [Scheduling votes will be taken here](http://www.strawpoll.me/12069621) and votes will be tallied and a decision will be made by the end of this month (January).
2017/01/09
[ "https://gaming.meta.stackexchange.com/questions/12207", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/27975/" ]
Movie Night Decision: ===================== [![enter image description here](https://i.stack.imgur.com/r8e1c.jpg)](https://i.stack.imgur.com/r8e1c.jpg) ### Kubo and the Two Strings The scheduling poll has resulted as follows: [![enter image description here](https://i.stack.imgur.com/ZlYdi.png)](https://i.stack.imgur.com/ZlYdi.png) Now, there's been some talk about what hour to start the showing. For the past several movie nights, the movie has been started at 11:00 PM UTC-0. However, this was due to the first few movie nights beginning on a Friday rather than a Saturday and out of a need to accommodate people who work on weekdays, I had scheduled it then. Now that movie nights are firmly scheduled on Saturdays, I feel that it is appropriate to adjust the showtime to more easily accommodate some of our friends outside of the American continents. ---[Here is a poll with a selection of available times. Pick as many as you can show up to and I'll do my best to pick a schedule that best fits everyone's times](http://doodle.com/poll/rv95t7te5c7fwrpe)--- Movie Night will be occurring at 7:00PM UTC-0.
District 9 ========== I see GnomeSlice's relevance, and raise more relevant. Idea shamelessly stolen. Sue me. In addition to being relevant, this is also a good movie. > > An extraterrestrial race forced to live in slum-like conditions on Earth suddenly finds a kindred spirit in a government agent who is exposed to their biotechnology. > > > [![District 9 movie poster](https://images-na.ssl-images-amazon.com/images/M/MV5BMTM4OTI1OTM5NF5BMl5BanBnXkFtZTcwMzk5MTU1Mg@@._V1_SY1000_CR0,0,675,1000_AL_.jpg)](https://images-na.ssl-images-amazon.com/images/M/MV5BMTM4OTI1OTM5NF5BMl5BanBnXkFtZTcwMzk5MTU1Mg@@._V1_SY1000_CR0,0,675,1000_AL_.jpg) [IMDB](http://www.imdb.com/title/tt1136608/) | [Rotten Tomatoes 90%](https://www.rottentomatoes.com/m/district_9) | [Trailer](https://www.youtube.com/watch?v=DyLUwOcR5pk) | [Content Advisory (rated R)](http://www.imdb.com/title/tt1136608/parentalguide?ref_=tt_stry_pg)
35,584,981
do you know the minesweeper game of windows . well , the following problem is the same , you will input m and n ... ``` 0 < n,m <= 100 n : colons , m : rows ``` > > input : > > > ``` 4 4 *... .... .*.. .... ``` > > output : > > > ``` *100 2210 1*10 1110 ``` and , that is my code . ``` #include <stdio.h> #include <stdlib.h> char ms[100][101] ; int m , n; void input(){ for(int r = 0 ; r < m ; r++) for(int c = 0 ; c <= n ; c++){ scanf("%c",&ms[r][c]); if('.' == ms[r][c]) ms[r][c] += 2 ; } } void calc(int m , int n){ for(int r = m ; r <= (m+2) ; r++) for(int c = n ; c <= (n+2) ; c++) if(r >= 0 && c >= 0 && ms[r][c] != '*') ms[r][c] += 1 ; } void solve(){ for(int r = 0 ; r < m ; r++) for(int c = 0 ; c < n ; c++) if( '*' == ms[r][c]) calc(r-1 , c-1); } void output(){ for(int r = 0 ; r < m ; r++) for(int c = 0 ; c <= n ; c++) printf("%c ", ms[r][c]); } int main() { scanf("%d%d" , &m , &n); input(); solve(); output(); return 0; } ``` when running my code , if the input have \* at the first as follows : ``` 4 4 *... .... .*.. .... ``` the output is : [important to see it .. click here](http://i.stack.imgur.com/VUvY9.jpg) note: i tried to print the value of the symbol that appeard in the picture and it is 11 in ascii code which is vertical tab. and , another problem if the \* is at the last as follows : ``` 4 4 ...* .... .... ...* 000* 0000 0000 000* ``` but my code works well when the \* is at the middle as follows : ``` 4 4 .... ..*. .*.. .... 0111 12*1 1*21 1110 ``` so , what's the problem with my code ?
2016/02/23
[ "https://Stackoverflow.com/questions/35584981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5334741/" ]
``` scanf("%d", ...); ``` leaves whitespace (the ENTER) in the input buffer. Then ``` scanf("%c", ...); ``` reads that whitespace into the variable. You need to ignore the whitespace before (and during) reading the stars and dots. Use ``` scanf(" %c", ...); // ^^^ ignore whitespace ``` *Note: the conversion specifier `"%d"` (and many others) already includes ignoring whitespace; the exceptions are `"%c"`, `"%["`, and [for different reasons] `"%n"`).*
In this line you can go out of bounds: ``` if(r >= 0 && c >= 0 && ms[r][c] != '*') ms[r][c] += 1 ; ``` You only test if *r* and *c* are not negative, but you should also test they are not too large. The thing becomes more complicated because you have global variables *m* and *n* which are the dimensions of your array, but they are not available in the *calc* function, because there you have local variables with the same name. So you better use different variable names. And then you should test that `r<m` and `c<n`, as follows: ``` void calc(int p , int q){ for(int r = p ; r <= (p+2) ; r++) for(int c = q ; c <= (q+2) ; c++) if(r >= 0 && c >= 0 && r < m && c < n && ms[r][c] != '*') ms[r][c] += 1 ; } ``` Now the reason you saw an ASCII 11 is explained by the fact that ASCII 10 is the line feed character that marks the end of a row. Then when your code performs `ms[r][c] += 1` on it (because it goes too far), it becomes that funny character. That you have that ASCII 10 in your array is explained by how you read the input (see @pmg's answer). If you would not have read those white space characters, you would still overrun, and probably touch data in a next row of data, which is not what you want to happen.
5,248
**Which layout works best for your users?**: * Field labels on the side of fields * Field labels above the data entry fields * What about prompt text, format tips, examples and validation or error messages? I've done many online forms over the past few years. I have "pre-designed" patterns and layouts I've used over and over and over again. Some of the layouts have been heavily tested, some not so much. One of my colleagues challenged me recently asking why I could be so confident that the layout they had proposed wasn't right. It made me stop and reassess my approach, which I realised were based on opinion rather than evidence. **Examples or evidence?** I have an existing paper form to work with. Its ugly. Truly ugly. The last thing I want is to create an online version of the same ugliness. Do you have examples of forms or wizards that you think are designed really well? Can you point me to any research or academic material that I could use to back up my recommendation to (read as: looming major argument with) the product owner? **My task**: take an existing paper based form, convert it to an online form and extend the functionality to include validation on-the-fly, file uploads, credit card payments and confirmation, status and error messages. **The overall design**: most likely to be about 8 screens, in the format of a step-by-step wizard. Users will be able to save incomplete forms and come back later. Most questions need to be answered, some questions are complex. Users will only need to use the form once every five years so they won't be familiar with the questions in advance. **The challenge:** there's no existing pattern for online forms in this organisation, they don't have many running at the moment, and none as complicated as this form. I will need to convince the product owner that creating a replica of the paper form is a bad idea. A really bad idea.
2010/05/28
[ "https://ux.stackexchange.com/questions/5248", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1061/" ]
Luke Wroblewski has some good articles about form design. I recommend you these two: [Web Application Form Design](http://www.lukew.com/resources/articles/web_forms.html) [Primary & Secondary Actions in Web Forms](http://www.lukew.com/resources/articles/psactions.asp) Or do you need something even more specific?
[Matteo Penzo’s study](http://www.uxmatters.com/mt/archives/2006/07/label-placement-in-forms.php) provides the best evidence to date for the advantages of placing the label above the field control. However, the [merits of this continue to be debated](http://www.uxmatters.com/mt/archives/2010/01/label-alignment-in-long-forms-paper-prototyping-for-engineers.php). The bottom line appears to be that top labels are best for filling out an empty form, but not so good for using a partially or fully completed form. Their main advantage is consistent close physical proximity of the label to the field for easy association when the labels vary considerably in length. The main concerns with top labels are: * It takes more vertical space, possibly requiring scrolling to scan the whole form. * It makes it more difficult to scan down the labels or fields when looking for a particular field or value to read, check, or change. * It can make it harder for the designer to group fields into a visual hierarchy. * It’s possible for users to [confuse which field](http://usability.gov/articles/newsletter/pubs/042008news.html) a label applies to (the one above or below). The latter can be mitigated with adequate white space or graphic division, although both of these tend to take yet more vertical space. Frankly, this issue needs more research. For one thing, maybe you can have both good vertical scanning and good label-field association by using left-aligned labels with a graphic connection to the field, such as with leader dots or zebra striping. If you try these out, let us know how it works in your user testing. Prompts and tips are best to the right of the field all else being equal: * It keeps the distance short between the label (the primary information) and the field, making it easiest to read with fewer fixations. * It makes the prompt/tip relatively noticeable since it’s not “buried” between the label and field. * It provides a clear visual separation between primary and secondary information, encouraging users to read *all* of the primary information (users tend to skip over long strings of text). Placing prompts under the field is another option, which may make it easier to see the prompt when the field control is long, but this has all the disadvantages of putting labels on top of the field, plus possibly inducing misleading apparent groupings of fields due to fields no longer being uniformly separated on the vertical dimension. Because prompts and hints are secondary information, I wouldn’t let their placement disrupt the layout of the primary information, even if that means being inconsistent. In contrast to other hints/prompts, Required Field indicators (e.g., red asterisks) should be put at the beginning of the label to help users decide at a glance [if they really want to fill out the field](http://formulate.com.au/articles/mandatory-versus-optional-fields/).
5,248
**Which layout works best for your users?**: * Field labels on the side of fields * Field labels above the data entry fields * What about prompt text, format tips, examples and validation or error messages? I've done many online forms over the past few years. I have "pre-designed" patterns and layouts I've used over and over and over again. Some of the layouts have been heavily tested, some not so much. One of my colleagues challenged me recently asking why I could be so confident that the layout they had proposed wasn't right. It made me stop and reassess my approach, which I realised were based on opinion rather than evidence. **Examples or evidence?** I have an existing paper form to work with. Its ugly. Truly ugly. The last thing I want is to create an online version of the same ugliness. Do you have examples of forms or wizards that you think are designed really well? Can you point me to any research or academic material that I could use to back up my recommendation to (read as: looming major argument with) the product owner? **My task**: take an existing paper based form, convert it to an online form and extend the functionality to include validation on-the-fly, file uploads, credit card payments and confirmation, status and error messages. **The overall design**: most likely to be about 8 screens, in the format of a step-by-step wizard. Users will be able to save incomplete forms and come back later. Most questions need to be answered, some questions are complex. Users will only need to use the form once every five years so they won't be familiar with the questions in advance. **The challenge:** there's no existing pattern for online forms in this organisation, they don't have many running at the moment, and none as complicated as this form. I will need to convince the product owner that creating a replica of the paper form is a bad idea. A really bad idea.
2010/05/28
[ "https://ux.stackexchange.com/questions/5248", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1061/" ]
Luke Wroblewski has some good articles about form design. I recommend you these two: [Web Application Form Design](http://www.lukew.com/resources/articles/web_forms.html) [Primary & Secondary Actions in Web Forms](http://www.lukew.com/resources/articles/psactions.asp) Or do you need something even more specific?
Look at this <http://www.csskarma.com/lab/plugin_slidinglabels/> found it just the other day, impressed me to tears.
5,248
**Which layout works best for your users?**: * Field labels on the side of fields * Field labels above the data entry fields * What about prompt text, format tips, examples and validation or error messages? I've done many online forms over the past few years. I have "pre-designed" patterns and layouts I've used over and over and over again. Some of the layouts have been heavily tested, some not so much. One of my colleagues challenged me recently asking why I could be so confident that the layout they had proposed wasn't right. It made me stop and reassess my approach, which I realised were based on opinion rather than evidence. **Examples or evidence?** I have an existing paper form to work with. Its ugly. Truly ugly. The last thing I want is to create an online version of the same ugliness. Do you have examples of forms or wizards that you think are designed really well? Can you point me to any research or academic material that I could use to back up my recommendation to (read as: looming major argument with) the product owner? **My task**: take an existing paper based form, convert it to an online form and extend the functionality to include validation on-the-fly, file uploads, credit card payments and confirmation, status and error messages. **The overall design**: most likely to be about 8 screens, in the format of a step-by-step wizard. Users will be able to save incomplete forms and come back later. Most questions need to be answered, some questions are complex. Users will only need to use the form once every five years so they won't be familiar with the questions in advance. **The challenge:** there's no existing pattern for online forms in this organisation, they don't have many running at the moment, and none as complicated as this form. I will need to convince the product owner that creating a replica of the paper form is a bad idea. A really bad idea.
2010/05/28
[ "https://ux.stackexchange.com/questions/5248", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1061/" ]
Luke Wroblewski has some good articles about form design. I recommend you these two: [Web Application Form Design](http://www.lukew.com/resources/articles/web_forms.html) [Primary & Secondary Actions in Web Forms](http://www.lukew.com/resources/articles/psactions.asp) Or do you need something even more specific?
Another option to consider is Infield Top Aligned Labels. > > Most websites today either use top aligned or infield form labels > because they aren’t aware of a better way. > > > <http://uxmovement.com/forms/why-infield-top-aligned-form-labels-are-quickest-to-scan/>
5,248
**Which layout works best for your users?**: * Field labels on the side of fields * Field labels above the data entry fields * What about prompt text, format tips, examples and validation or error messages? I've done many online forms over the past few years. I have "pre-designed" patterns and layouts I've used over and over and over again. Some of the layouts have been heavily tested, some not so much. One of my colleagues challenged me recently asking why I could be so confident that the layout they had proposed wasn't right. It made me stop and reassess my approach, which I realised were based on opinion rather than evidence. **Examples or evidence?** I have an existing paper form to work with. Its ugly. Truly ugly. The last thing I want is to create an online version of the same ugliness. Do you have examples of forms or wizards that you think are designed really well? Can you point me to any research or academic material that I could use to back up my recommendation to (read as: looming major argument with) the product owner? **My task**: take an existing paper based form, convert it to an online form and extend the functionality to include validation on-the-fly, file uploads, credit card payments and confirmation, status and error messages. **The overall design**: most likely to be about 8 screens, in the format of a step-by-step wizard. Users will be able to save incomplete forms and come back later. Most questions need to be answered, some questions are complex. Users will only need to use the form once every five years so they won't be familiar with the questions in advance. **The challenge:** there's no existing pattern for online forms in this organisation, they don't have many running at the moment, and none as complicated as this form. I will need to convince the product owner that creating a replica of the paper form is a bad idea. A really bad idea.
2010/05/28
[ "https://ux.stackexchange.com/questions/5248", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1061/" ]
[Matteo Penzo’s study](http://www.uxmatters.com/mt/archives/2006/07/label-placement-in-forms.php) provides the best evidence to date for the advantages of placing the label above the field control. However, the [merits of this continue to be debated](http://www.uxmatters.com/mt/archives/2010/01/label-alignment-in-long-forms-paper-prototyping-for-engineers.php). The bottom line appears to be that top labels are best for filling out an empty form, but not so good for using a partially or fully completed form. Their main advantage is consistent close physical proximity of the label to the field for easy association when the labels vary considerably in length. The main concerns with top labels are: * It takes more vertical space, possibly requiring scrolling to scan the whole form. * It makes it more difficult to scan down the labels or fields when looking for a particular field or value to read, check, or change. * It can make it harder for the designer to group fields into a visual hierarchy. * It’s possible for users to [confuse which field](http://usability.gov/articles/newsletter/pubs/042008news.html) a label applies to (the one above or below). The latter can be mitigated with adequate white space or graphic division, although both of these tend to take yet more vertical space. Frankly, this issue needs more research. For one thing, maybe you can have both good vertical scanning and good label-field association by using left-aligned labels with a graphic connection to the field, such as with leader dots or zebra striping. If you try these out, let us know how it works in your user testing. Prompts and tips are best to the right of the field all else being equal: * It keeps the distance short between the label (the primary information) and the field, making it easiest to read with fewer fixations. * It makes the prompt/tip relatively noticeable since it’s not “buried” between the label and field. * It provides a clear visual separation between primary and secondary information, encouraging users to read *all* of the primary information (users tend to skip over long strings of text). Placing prompts under the field is another option, which may make it easier to see the prompt when the field control is long, but this has all the disadvantages of putting labels on top of the field, plus possibly inducing misleading apparent groupings of fields due to fields no longer being uniformly separated on the vertical dimension. Because prompts and hints are secondary information, I wouldn’t let their placement disrupt the layout of the primary information, even if that means being inconsistent. In contrast to other hints/prompts, Required Field indicators (e.g., red asterisks) should be put at the beginning of the label to help users decide at a glance [if they really want to fill out the field](http://formulate.com.au/articles/mandatory-versus-optional-fields/).
Look at this <http://www.csskarma.com/lab/plugin_slidinglabels/> found it just the other day, impressed me to tears.
5,248
**Which layout works best for your users?**: * Field labels on the side of fields * Field labels above the data entry fields * What about prompt text, format tips, examples and validation or error messages? I've done many online forms over the past few years. I have "pre-designed" patterns and layouts I've used over and over and over again. Some of the layouts have been heavily tested, some not so much. One of my colleagues challenged me recently asking why I could be so confident that the layout they had proposed wasn't right. It made me stop and reassess my approach, which I realised were based on opinion rather than evidence. **Examples or evidence?** I have an existing paper form to work with. Its ugly. Truly ugly. The last thing I want is to create an online version of the same ugliness. Do you have examples of forms or wizards that you think are designed really well? Can you point me to any research or academic material that I could use to back up my recommendation to (read as: looming major argument with) the product owner? **My task**: take an existing paper based form, convert it to an online form and extend the functionality to include validation on-the-fly, file uploads, credit card payments and confirmation, status and error messages. **The overall design**: most likely to be about 8 screens, in the format of a step-by-step wizard. Users will be able to save incomplete forms and come back later. Most questions need to be answered, some questions are complex. Users will only need to use the form once every five years so they won't be familiar with the questions in advance. **The challenge:** there's no existing pattern for online forms in this organisation, they don't have many running at the moment, and none as complicated as this form. I will need to convince the product owner that creating a replica of the paper form is a bad idea. A really bad idea.
2010/05/28
[ "https://ux.stackexchange.com/questions/5248", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1061/" ]
[Matteo Penzo’s study](http://www.uxmatters.com/mt/archives/2006/07/label-placement-in-forms.php) provides the best evidence to date for the advantages of placing the label above the field control. However, the [merits of this continue to be debated](http://www.uxmatters.com/mt/archives/2010/01/label-alignment-in-long-forms-paper-prototyping-for-engineers.php). The bottom line appears to be that top labels are best for filling out an empty form, but not so good for using a partially or fully completed form. Their main advantage is consistent close physical proximity of the label to the field for easy association when the labels vary considerably in length. The main concerns with top labels are: * It takes more vertical space, possibly requiring scrolling to scan the whole form. * It makes it more difficult to scan down the labels or fields when looking for a particular field or value to read, check, or change. * It can make it harder for the designer to group fields into a visual hierarchy. * It’s possible for users to [confuse which field](http://usability.gov/articles/newsletter/pubs/042008news.html) a label applies to (the one above or below). The latter can be mitigated with adequate white space or graphic division, although both of these tend to take yet more vertical space. Frankly, this issue needs more research. For one thing, maybe you can have both good vertical scanning and good label-field association by using left-aligned labels with a graphic connection to the field, such as with leader dots or zebra striping. If you try these out, let us know how it works in your user testing. Prompts and tips are best to the right of the field all else being equal: * It keeps the distance short between the label (the primary information) and the field, making it easiest to read with fewer fixations. * It makes the prompt/tip relatively noticeable since it’s not “buried” between the label and field. * It provides a clear visual separation between primary and secondary information, encouraging users to read *all* of the primary information (users tend to skip over long strings of text). Placing prompts under the field is another option, which may make it easier to see the prompt when the field control is long, but this has all the disadvantages of putting labels on top of the field, plus possibly inducing misleading apparent groupings of fields due to fields no longer being uniformly separated on the vertical dimension. Because prompts and hints are secondary information, I wouldn’t let their placement disrupt the layout of the primary information, even if that means being inconsistent. In contrast to other hints/prompts, Required Field indicators (e.g., red asterisks) should be put at the beginning of the label to help users decide at a glance [if they really want to fill out the field](http://formulate.com.au/articles/mandatory-versus-optional-fields/).
Another option to consider is Infield Top Aligned Labels. > > Most websites today either use top aligned or infield form labels > because they aren’t aware of a better way. > > > <http://uxmovement.com/forms/why-infield-top-aligned-form-labels-are-quickest-to-scan/>
5,248
**Which layout works best for your users?**: * Field labels on the side of fields * Field labels above the data entry fields * What about prompt text, format tips, examples and validation or error messages? I've done many online forms over the past few years. I have "pre-designed" patterns and layouts I've used over and over and over again. Some of the layouts have been heavily tested, some not so much. One of my colleagues challenged me recently asking why I could be so confident that the layout they had proposed wasn't right. It made me stop and reassess my approach, which I realised were based on opinion rather than evidence. **Examples or evidence?** I have an existing paper form to work with. Its ugly. Truly ugly. The last thing I want is to create an online version of the same ugliness. Do you have examples of forms or wizards that you think are designed really well? Can you point me to any research or academic material that I could use to back up my recommendation to (read as: looming major argument with) the product owner? **My task**: take an existing paper based form, convert it to an online form and extend the functionality to include validation on-the-fly, file uploads, credit card payments and confirmation, status and error messages. **The overall design**: most likely to be about 8 screens, in the format of a step-by-step wizard. Users will be able to save incomplete forms and come back later. Most questions need to be answered, some questions are complex. Users will only need to use the form once every five years so they won't be familiar with the questions in advance. **The challenge:** there's no existing pattern for online forms in this organisation, they don't have many running at the moment, and none as complicated as this form. I will need to convince the product owner that creating a replica of the paper form is a bad idea. A really bad idea.
2010/05/28
[ "https://ux.stackexchange.com/questions/5248", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1061/" ]
Look at this <http://www.csskarma.com/lab/plugin_slidinglabels/> found it just the other day, impressed me to tears.
Another option to consider is Infield Top Aligned Labels. > > Most websites today either use top aligned or infield form labels > because they aren’t aware of a better way. > > > <http://uxmovement.com/forms/why-infield-top-aligned-form-labels-are-quickest-to-scan/>
1,147,796
$Z\_1, Z\_2$ are $\mathrm{Bin}(n,\frac{1}{2})$ and independent. Show that $Y=Z\_1+Z\_2$ and $X=|Z\_1-Z\_2|$ are uncorrelated but not independent. My attempt: $$P(Y=k\_Y)=\binom{2n}{k\_Y}\left(\frac{1}{4}\right)^n$$ $\forall k\_Y \in [0,2n]$ $$P(X=k\_X)=2(\frac{1}{4})^n\sum\_{j=0}^{j=n-k\_X}\binom n j \binom n {j+k\_X}$$ $\forall k\_X \in [0,n]$ $$P(Y=k\_Y,X=k\_X)=2(\frac{1}{4})^n\binom n {(k\_Y-k\_X)/2}\binom n {(k\_X+k\_Y)/2}$$ if $k\_X \in [0,n],k\_Y \in [0,2n]$ $k\_Y>k\_X$ and $k\_X \pm k\_Y$ are even, $0$ otherwise. Clear enough $\forall n$ and $k\_Y=0$ and $k\_X = n$ $P(Y=0) = (\frac{1}{4})^n$ $P(X=n) = 2(\frac{1}{4})^n$ and $P(Y=0,X=n)=0$ thus $P(Y=0)P(X=n) \ne P(Y=0,X=n)$ $\implies$ $X$ and $Y$ are dependent. Now show that $Cov(X,Y)=E(XY)-E(X)E(Y)=0$. $E(Y)=n$ $E(X)=2(\frac{1}{4})^n\sum\_{x=0}^{n}x\sum\_{j=0}^{j=n-x}\binom n j \binom n {j+x}$ \begin{align} E(XY) & =2(\frac{1}{4})^n\sum\_{x=0}^{n}\sum\_{y=0}^{2n}xy\binom n {(y-x)/2} \binom n {(x+y)/2} \\ & =2(\frac{1}{4})^n \sum\_{x=0}^{n}x\sum\_{y=x}^{2n-x}y\binom n {(y-x)/2 } \binom n {(x+y)/2} \\ & =2(\frac{1}{4})^n\sum\_{x=0}^{n}x\sum\_{j=0}^{n-x}(x+2j)\binom n j \binom n {j+x} \end{align} and here I am stuck...
2015/02/14
[ "https://math.stackexchange.com/questions/1147796", "https://math.stackexchange.com", "https://math.stackexchange.com/users/100051/" ]
First show that the distribution of $(X,Y)$ is the same as that of $(X,2n-Y)$. Hence $$\operatorname{cov}(X,Y) = \operatorname{cov}(X,2n-Y) = \operatorname{cov}(X,-Y) = -\operatorname{cov}(X,Y)$$ and uncorrelatedness follows.
As Michael Hardy suggested let's show that the distribution of $(Y,X)$ are the same as $(2n-Y,X)$ $$P(Y=k\_Y,X=k\_X)=2(\frac{1}{4})^n\binom n {(k\_Y-k\_X)/2}\binom n {(k\_X+k\_Y)/2}\text{ if }k\_X \in [0,n] ,k\_Y \in [0,2n] ,k\_Y \ge k\_X$$ and $k\_X±k\_Y$ are even, $0$ otherwise. $$P(2n-Y=k\_Y,X=k\_X)=P(Y=2n-k\_Y,X=k\_X)$$ $$2n-k\_Y \in [0,2n]\text{ and }2n-k\_Y \ge k\_X\text{ (because $2n \ge a+b + |a-b|$ if $a,b \in [0,n]$) and $2n-k\_Y \pm k\_X$ are even,}$$ thus: $$P(Y=2n-k\_Y,X=k\_X)=2(\frac{1}{4})^n\binom n {(2n-k\_Y-k\_X)/2}\binom n {(k\_X+2n-k\_Y)/2}=2(\frac{1}{4})^n\binom n {n-(k\_Y+k\_X)/2}\binom n {n-(k\_Y-k\_X)/2}=2(\frac{1}{4})^n\binom n {(k\_Y-k\_X)/2}\binom n {(k\_X+k\_Y)/2}$$ Because $\binom{n}{k}=\binom{n}{n-k}$.
51,389,809
I have this angular code to get the datas ``` $http({ header: 'content-type:application/json', method:'GET', url: 'https://us-central1-****-*****.cloudfunctions.net/**/GetAll****', }).then(function(messages){ $scope.member = messages.data.**** }) ``` the error in the console is ``` Failed to load https://us-central1-site-*****.cloudfunctions.net/**/GetAll****: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://site-******.firebaseapp.com' is therefore not allowed access. ``` Please could anyone help me
2018/07/17
[ "https://Stackoverflow.com/questions/51389809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Just add these lines before sending the response in your cloud function, as you need to enable **CORS**: ``` function foo(req, res) { res.set('Access-Control-Allow-Origin', "*"); res.set('Access-Control-Allow-Methods', 'GET, POST'); res.set('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token'); // <-- Try adding this line res.status(200).send('custom message'); } ```
I had the same problem but when i was trying. Normally this error happens because of when you try to access "http" to "https" so the browser blocks for security reasons. What you have to do is, use cors like below Step 1 : first install cors with npm in the firebase functions. Step 2 : After installing the cors, write your function in the following way ``` const cors = require('cors')({ origin: true }); // origin true must be there exports.sampleFunction = functions.https.onRequest((request, response)=>{ cors(request,response, () =>{ // Do your business logic or code. }) }) ``` [![My Firebase functions. See the highlighted code](https://i.stack.imgur.com/zmf3e.png)](https://i.stack.imgur.com/zmf3e.png) [![Reply from firebase support team when i had the same issue](https://i.stack.imgur.com/jPaqU.png)](https://i.stack.imgur.com/jPaqU.png)
459,592
I have winXP LibreOffice and MS office installed. How do I make LibreOffice the default opening program for all of its know document types? I know that I can change one extension at a time. But is there a way to change all of them? I want LibreOffice to open .doc .xls and ... (I do not know all of them)
2012/08/09
[ "https://superuser.com/questions/459592", "https://superuser.com", "https://superuser.com/users/114476/" ]
from [here](http://user.services.openoffice.org/en/forum/viewtopic.php?f=15&t=42104): please try a 'Custom Setup', see → Installation of LibreOffice 3.3 on Windows <http://www.libreoffice.org/get-help/installation/windows/> especially: - Dialog Box #6: Choice of Typical or Custom Installation - Dialog Box #8: Choice for File Type Associations You may start from 'Add or Remove Programs' > 'LibreOffice...' > 'Modify', or (unpacked \*.exe file) 'libreoffice33.msi' > right-click 'Install' > 'Modify'.
'Modify' worked for me. Thanks! On Windows Vista: * click START * Settings * Control Panel * Programs * Programs and Features * Uninstall a Program * Select the right program from the list * click 'change' * follow instructions.
459,592
I have winXP LibreOffice and MS office installed. How do I make LibreOffice the default opening program for all of its know document types? I know that I can change one extension at a time. But is there a way to change all of them? I want LibreOffice to open .doc .xls and ... (I do not know all of them)
2012/08/09
[ "https://superuser.com/questions/459592", "https://superuser.com", "https://superuser.com/users/114476/" ]
from [here](http://user.services.openoffice.org/en/forum/viewtopic.php?f=15&t=42104): please try a 'Custom Setup', see → Installation of LibreOffice 3.3 on Windows <http://www.libreoffice.org/get-help/installation/windows/> especially: - Dialog Box #6: Choice of Typical or Custom Installation - Dialog Box #8: Choice for File Type Associations You may start from 'Add or Remove Programs' > 'LibreOffice...' > 'Modify', or (unpacked \*.exe file) 'libreoffice33.msi' > right-click 'Install' > 'Modify'.
To make office libre the default reader for all your documents: Right click any document, tap Properties. A box opens that enables you to change the opener to office libre. Do this for a couple documents and OL magically becomes the default opener for all docs of the same type This works for windows 10 at least.
459,592
I have winXP LibreOffice and MS office installed. How do I make LibreOffice the default opening program for all of its know document types? I know that I can change one extension at a time. But is there a way to change all of them? I want LibreOffice to open .doc .xls and ... (I do not know all of them)
2012/08/09
[ "https://superuser.com/questions/459592", "https://superuser.com", "https://superuser.com/users/114476/" ]
from [here](http://user.services.openoffice.org/en/forum/viewtopic.php?f=15&t=42104): please try a 'Custom Setup', see → Installation of LibreOffice 3.3 on Windows <http://www.libreoffice.org/get-help/installation/windows/> especially: - Dialog Box #6: Choice of Typical or Custom Installation - Dialog Box #8: Choice for File Type Associations You may start from 'Add or Remove Programs' > 'LibreOffice...' > 'Modify', or (unpacked \*.exe file) 'libreoffice33.msi' > right-click 'Install' > 'Modify'.
For me it worked to just use the "default apps" in windows system settings. just hit start and type default apps
459,592
I have winXP LibreOffice and MS office installed. How do I make LibreOffice the default opening program for all of its know document types? I know that I can change one extension at a time. But is there a way to change all of them? I want LibreOffice to open .doc .xls and ... (I do not know all of them)
2012/08/09
[ "https://superuser.com/questions/459592", "https://superuser.com", "https://superuser.com/users/114476/" ]
'Modify' worked for me. Thanks! On Windows Vista: * click START * Settings * Control Panel * Programs * Programs and Features * Uninstall a Program * Select the right program from the list * click 'change' * follow instructions.
To make office libre the default reader for all your documents: Right click any document, tap Properties. A box opens that enables you to change the opener to office libre. Do this for a couple documents and OL magically becomes the default opener for all docs of the same type This works for windows 10 at least.