qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
5,267,816
I am trying to get the full path of an uploaded file. The php code is like this: ``` <?php $destination_path = getcwd() . DIRECTORY_SEPARATOR; $result = 0; $target_path = $destination_path . basename($_FILES['thefile']['name']); if(@move_uploaded_file($_FILES['thefile']['tmp_name'],*$target_path)) { $result = 1; } ...
2011/03/11
[ "https://Stackoverflow.com/questions/5267816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/654557/" ]
You are assumingly using this on Windows, where `DIRECTORY_SEPARATOR` is a backslash. If the filename starts with a `n` then your Javascript code will end up like this: ``` d = '..\path\nameoffile.txt'; ``` Javascript unlike PHP will interpret `\n` in single quoted strings. The solution to your dilemma is either no...
Do you mean the full path to the file on the *client's* machine? JavaScript security will not reveal that. It will just send the actual file name to the server.
26,243,506
Suppose one has the following pattern: * Foobar class, which makes use of the logic in either Foo or Bar, but not both, depending upon the arguments given by the constructor * Foo module, containing some logic * Bar module, containing some alternate logic A good example is an orbital elements calculator, which might ...
2014/10/07
[ "https://Stackoverflow.com/questions/26243506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/170300/" ]
I'm not really sure why you want to mask an instance of two different entities under one but if you want simple decision logic based on arguments, this works: ``` # orbit.rb module Orbit module_function def from_options(options = {}) klass = if options[:radius] && options[:velocity] FromRadiusAn...
To me it sounds like a job for simple inheritance: ``` class FooBar def self.new(options) if [:radius,:velocity].all? { |key| options.has_key?(key) } Foo.new options else Bar.new options end end # common Foo and Barlogic here end class Foo < FooBar end class Bar < FooBar end ```
26,243,506
Suppose one has the following pattern: * Foobar class, which makes use of the logic in either Foo or Bar, but not both, depending upon the arguments given by the constructor * Foo module, containing some logic * Bar module, containing some alternate logic A good example is an orbital elements calculator, which might ...
2014/10/07
[ "https://Stackoverflow.com/questions/26243506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/170300/" ]
You can by including the module of choice in the singleton class (sometimes called eigenclass), not the object itself. So the initializer can look like this ``` class Orbit def initialize options = {} if [:radius,:velocity].all? { |key| options.has_key?(key) } self.singleton_class.include Orbit::FromRadius...
To me it sounds like a job for simple inheritance: ``` class FooBar def self.new(options) if [:radius,:velocity].all? { |key| options.has_key?(key) } Foo.new options else Bar.new options end end # common Foo and Barlogic here end class Foo < FooBar end class Bar < FooBar end ```
17,673,492
I get an error while running yo webapp as "Easy with the sudo. Yeoman is the master around here" Please help me out. I followed the same instructions in the yoeman.io website. Without sudo , on running in /usr/node/ with the directory changed to 777 with chmod, Error: EACCES, permission denied '/home/manish/.confi...
2013/07/16
[ "https://Stackoverflow.com/questions/17673492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2149185/" ]
This happens because you must be trying to start your application as root. See this for more information: <https://github.com/passy/yo/commit/d33e7a67d74343d836a14881b17b3072b92f2532> If you're starting your applciation by running: ``` sudo node app.js ``` Try doing this instead: ``` node app.js ``` I.e. this w...
There's a Gist here with a selection of shell scripts to help you install Node and NPM without requiring sudo permissions: <https://gist.github.com/isaacs/579814>
17,673,492
I get an error while running yo webapp as "Easy with the sudo. Yeoman is the master around here" Please help me out. I followed the same instructions in the yoeman.io website. Without sudo , on running in /usr/node/ with the directory changed to 777 with chmod, Error: EACCES, permission denied '/home/manish/.confi...
2013/07/16
[ "https://Stackoverflow.com/questions/17673492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2149185/" ]
This happens because you must be trying to start your application as root. See this for more information: <https://github.com/passy/yo/commit/d33e7a67d74343d836a14881b17b3072b92f2532> If you're starting your applciation by running: ``` sudo node app.js ``` Try doing this instead: ``` node app.js ``` I.e. this w...
So running yo ? gives the error above - maybe like for me it installed ~/Users/yourusername/.config/configstore/insight-yo.yml with the root permissions and this needs chowning to the name of the user. chown yourusername ~/Users/yourusername/.config/configstore/insight-yo.yml This was my issue and may be a part of th...
25,368,773
I am jumping into building an ASP.NET MVC site and I am stuck on a probably simple issue. I am attempting to filter a query by date using a lambda expression. The other ways I have attempted to filter have been successful. Here is what I am trying to accomplish. The data is stored in a SQL Server 2008 R2 database with ...
2014/08/18
[ "https://Stackoverflow.com/questions/25368773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3352768/" ]
``` //per lordkain: var dt = DateTime.Now.Date.AddDays(-10); //per Yuliam Chandra: db.tableName.Where(x => x.col1 >= dt); ```
At the looks of your code the c# datatype is DateTime, and the one in your database is Date. you probally want to change your code in youre create function as ``` var dt = DateTime.Today.AddDays(-10); ``` now the code is only Date, without the time!
57,756,440
I have dumped the output of a command into a text file which consists of multiple columns results in multiple rows. The first column contains the Equipment ID and second column contain the time (In UTC) I want to sort the rows on the basis of increasing time order(Setup time). How to do that? Here is my command out p...
2019/09/02
[ "https://Stackoverflow.com/questions/57756440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11986993/" ]
Is the class `dest-sitemap__sublist-title-empty` unique for this element? you can use it ``` elem = driver.find_element_by_class_name('dest-sitemap__sublist-title-empty') ```
You can use XPATH and text() function. XPATH provides a rich possibility to locate elements. So if you want to locate all h4 elements with empty strings, you can use the following way. ``` xpath = "//h4[text()='']" elems = driver.find_elements_by_xpath(xpath) ```
27,001,838
I have an Angular 1.0 app, and I have been asked to upgrade it to 1.3.2 What are the main changes / new features between these two version. What are the biggest challenges. I'm aware this question is kind of broad. I don't know how to narrow it at this point. Suggestions for how to narrow in the comments would be most...
2014/11/18
[ "https://Stackoverflow.com/questions/27001838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/687677/" ]
well I have to say since it feels like a minor version, definitely it feels like doing an upgrade to a major version (with all the breaking changes with it). I'd point some cases that for me are in one or another way challenges: * Third party libraries are not up to date with 1.3, some of them are making the effort t...
`ng-route` & `ng-resource` are made as seperate modules/libraries in angular 1.3.2. so, these js files need to be script included in your html file.
27,001,838
I have an Angular 1.0 app, and I have been asked to upgrade it to 1.3.2 What are the main changes / new features between these two version. What are the biggest challenges. I'm aware this question is kind of broad. I don't know how to narrow it at this point. Suggestions for how to narrow in the comments would be most...
2014/11/18
[ "https://Stackoverflow.com/questions/27001838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/687677/" ]
Angular has documented the detailed list of breaking changes / migration issues in its website. You can have a look on the document from here: [Breaking Changes](https://docs.angularjs.org/guide/migration) I have made a brief list on the major breaking changes Summary of Breaking Changes by Migrating from 1.0 to 1.2:...
`ng-route` & `ng-resource` are made as seperate modules/libraries in angular 1.3.2. so, these js files need to be script included in your html file.
27,001,838
I have an Angular 1.0 app, and I have been asked to upgrade it to 1.3.2 What are the main changes / new features between these two version. What are the biggest challenges. I'm aware this question is kind of broad. I don't know how to narrow it at this point. Suggestions for how to narrow in the comments would be most...
2014/11/18
[ "https://Stackoverflow.com/questions/27001838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/687677/" ]
well I have to say since it feels like a minor version, definitely it feels like doing an upgrade to a major version (with all the breaking changes with it). I'd point some cases that for me are in one or another way challenges: * Third party libraries are not up to date with 1.3, some of them are making the effort t...
Angular has documented the detailed list of breaking changes / migration issues in its website. You can have a look on the document from here: [Breaking Changes](https://docs.angularjs.org/guide/migration) I have made a brief list on the major breaking changes Summary of Breaking Changes by Migrating from 1.0 to 1.2:...
27,001,838
I have an Angular 1.0 app, and I have been asked to upgrade it to 1.3.2 What are the main changes / new features between these two version. What are the biggest challenges. I'm aware this question is kind of broad. I don't know how to narrow it at this point. Suggestions for how to narrow in the comments would be most...
2014/11/18
[ "https://Stackoverflow.com/questions/27001838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/687677/" ]
well I have to say since it feels like a minor version, definitely it feels like doing an upgrade to a major version (with all the breaking changes with it). I'd point some cases that for me are in one or another way challenges: * Third party libraries are not up to date with 1.3, some of them are making the effort t...
There is one main change I found while working angularjs application that is filter usages in template. For example, **In older version** | filter: { product.name: stock.product.name } **In updated version** | filter: { product: { name: stock.product.name }}
27,001,838
I have an Angular 1.0 app, and I have been asked to upgrade it to 1.3.2 What are the main changes / new features between these two version. What are the biggest challenges. I'm aware this question is kind of broad. I don't know how to narrow it at this point. Suggestions for how to narrow in the comments would be most...
2014/11/18
[ "https://Stackoverflow.com/questions/27001838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/687677/" ]
Angular has documented the detailed list of breaking changes / migration issues in its website. You can have a look on the document from here: [Breaking Changes](https://docs.angularjs.org/guide/migration) I have made a brief list on the major breaking changes Summary of Breaking Changes by Migrating from 1.0 to 1.2:...
There is one main change I found while working angularjs application that is filter usages in template. For example, **In older version** | filter: { product.name: stock.product.name } **In updated version** | filter: { product: { name: stock.product.name }}
81,209
I'm interested in installing a solar power system in my garage and am wondering how to connect the three-prong receptacle output of the power inverter to a NM-B lighting circuit that was previously hooked into a switch in an electric box receiving power from the main panel. [Here's the inverter](http://rads.stackoverf...
2016/01/04
[ "https://diy.stackexchange.com/questions/81209", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/47326/" ]
Note that these days the best answer for solar, if you aren't determined to go completely off-grid and if your electric company supports it, may be to get inverters that support line synchronization and ask the electric company to set you up for net metering. In this setup the inverters and line feed the house in par...
Separate the supply to your lights so that they are supplied from one of [these](http://www.ceshowroom.com/ProductDetails.asp?ProductCode=PETMDT4642W&click=2&gclid=Cj0KEQiAzai0BRCs2Yydo8yptuIBEiQAN3_lFnNoTQ7I3RsatvuM6fFvFvEb4i_B7WuxekM-m_OJz3YaAlDI8P8HAQ). Get a double-pole 120v relay capable of switching 15-20 amps, ...
81,209
I'm interested in installing a solar power system in my garage and am wondering how to connect the three-prong receptacle output of the power inverter to a NM-B lighting circuit that was previously hooked into a switch in an electric box receiving power from the main panel. [Here's the inverter](http://rads.stackoverf...
2016/01/04
[ "https://diy.stackexchange.com/questions/81209", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/47326/" ]
I think the simplest answer is to install a piece of SO/SJO cord with a cord cap to the switch box for your lighting circuit and plug it in to the inverter when you wish to use it. Make sure you disconnect the lighting circuit from the existing main power wiring first. Good luck!
Separate the supply to your lights so that they are supplied from one of [these](http://www.ceshowroom.com/ProductDetails.asp?ProductCode=PETMDT4642W&click=2&gclid=Cj0KEQiAzai0BRCs2Yydo8yptuIBEiQAN3_lFnNoTQ7I3RsatvuM6fFvFvEb4i_B7WuxekM-m_OJz3YaAlDI8P8HAQ). Get a double-pole 120v relay capable of switching 15-20 amps, ...
81,209
I'm interested in installing a solar power system in my garage and am wondering how to connect the three-prong receptacle output of the power inverter to a NM-B lighting circuit that was previously hooked into a switch in an electric box receiving power from the main panel. [Here's the inverter](http://rads.stackoverf...
2016/01/04
[ "https://diy.stackexchange.com/questions/81209", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/47326/" ]
Note that these days the best answer for solar, if you aren't determined to go completely off-grid and if your electric company supports it, may be to get inverters that support line synchronization and ask the electric company to set you up for net metering. In this setup the inverters and line feed the house in par...
**The easiest method to achieve what you appear to want is:** 1. Disconnect power to your garage circuitry in your breaker panel. **NOTE**: If there is ANY chance that someone could fiddle with your breakers, it would be ideally best to physically disconnect the garage circuit wires from its circuit breaker. Otherwise...
81,209
I'm interested in installing a solar power system in my garage and am wondering how to connect the three-prong receptacle output of the power inverter to a NM-B lighting circuit that was previously hooked into a switch in an electric box receiving power from the main panel. [Here's the inverter](http://rads.stackoverf...
2016/01/04
[ "https://diy.stackexchange.com/questions/81209", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/47326/" ]
I think the simplest answer is to install a piece of SO/SJO cord with a cord cap to the switch box for your lighting circuit and plug it in to the inverter when you wish to use it. Make sure you disconnect the lighting circuit from the existing main power wiring first. Good luck!
**The easiest method to achieve what you appear to want is:** 1. Disconnect power to your garage circuitry in your breaker panel. **NOTE**: If there is ANY chance that someone could fiddle with your breakers, it would be ideally best to physically disconnect the garage circuit wires from its circuit breaker. Otherwise...
81,209
I'm interested in installing a solar power system in my garage and am wondering how to connect the three-prong receptacle output of the power inverter to a NM-B lighting circuit that was previously hooked into a switch in an electric box receiving power from the main panel. [Here's the inverter](http://rads.stackoverf...
2016/01/04
[ "https://diy.stackexchange.com/questions/81209", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/47326/" ]
I think the simplest answer is to install a piece of SO/SJO cord with a cord cap to the switch box for your lighting circuit and plug it in to the inverter when you wish to use it. Make sure you disconnect the lighting circuit from the existing main power wiring first. Good luck!
Note that these days the best answer for solar, if you aren't determined to go completely off-grid and if your electric company supports it, may be to get inverters that support line synchronization and ask the electric company to set you up for net metering. In this setup the inverters and line feed the house in par...
81,209
I'm interested in installing a solar power system in my garage and am wondering how to connect the three-prong receptacle output of the power inverter to a NM-B lighting circuit that was previously hooked into a switch in an electric box receiving power from the main panel. [Here's the inverter](http://rads.stackoverf...
2016/01/04
[ "https://diy.stackexchange.com/questions/81209", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/47326/" ]
Note that these days the best answer for solar, if you aren't determined to go completely off-grid and if your electric company supports it, may be to get inverters that support line synchronization and ask the electric company to set you up for net metering. In this setup the inverters and line feed the house in par...
Disconnect means to physically disconnect - not switch or turn it off. To me that is logical. When you disconnect an electrical appliance you pull the plug on it not just simply switch it off. The M-M connection could be in the form of Anderson connectors where the terminals are not exposed. Anderson connectors are us...
81,209
I'm interested in installing a solar power system in my garage and am wondering how to connect the three-prong receptacle output of the power inverter to a NM-B lighting circuit that was previously hooked into a switch in an electric box receiving power from the main panel. [Here's the inverter](http://rads.stackoverf...
2016/01/04
[ "https://diy.stackexchange.com/questions/81209", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/47326/" ]
I think the simplest answer is to install a piece of SO/SJO cord with a cord cap to the switch box for your lighting circuit and plug it in to the inverter when you wish to use it. Make sure you disconnect the lighting circuit from the existing main power wiring first. Good luck!
Disconnect means to physically disconnect - not switch or turn it off. To me that is logical. When you disconnect an electrical appliance you pull the plug on it not just simply switch it off. The M-M connection could be in the form of Anderson connectors where the terminals are not exposed. Anderson connectors are us...
594,123
In 1d, for $V(x) = g\delta(x)$, integrating the TISE yields (assuming that $\psi$ is *bounded*$^\dagger$, so as to suppress the term containing $E$) $$ -\frac{\hbar^2}{2m} \left( \psi'(\varepsilon) - \psi'(-\varepsilon) \right) + g\psi(0) = 0 $$ for $\varepsilon\to0^+$. Now, this doesn't at all imply that $\psi$ has t...
2020/11/15
[ "https://physics.stackexchange.com/questions/594123", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/231957/" ]
Were $\psi(x)$ not continuous at $x=0$ then $\psi''(x)$ would contain the derivative of a $\delta$-function, and there is nothing else in the equation $H\psi=E\psi$ that could cancel it, so a discontinuity is not allowed.
Well, let's carefully analyze the system: 1. Let us assume the integral form $$ \psi(x)~=~ \frac{2m}{\hbar^2} \int^{x}\mathrm{d}y \int^{y}\mathrm{d}z\ (V(z)-E)\psi(z) \tag{1}$$ of the time independent 1D [Schrödinger equation](http://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation) (TISE), where the potential $$V(x)~=...
594,123
In 1d, for $V(x) = g\delta(x)$, integrating the TISE yields (assuming that $\psi$ is *bounded*$^\dagger$, so as to suppress the term containing $E$) $$ -\frac{\hbar^2}{2m} \left( \psi'(\varepsilon) - \psi'(-\varepsilon) \right) + g\psi(0) = 0 $$ for $\varepsilon\to0^+$. Now, this doesn't at all imply that $\psi$ has t...
2020/11/15
[ "https://physics.stackexchange.com/questions/594123", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/231957/" ]
Were $\psi(x)$ not continuous at $x=0$ then $\psi''(x)$ would contain the derivative of a $\delta$-function, and there is nothing else in the equation $H\psi=E\psi$ that could cancel it, so a discontinuity is not allowed.
You can think of the delta potential $V(x)=g\delta(x)$ as representing the limiting form of a potential barrier (or well) of height $\Lambda$ and width $w$, with $w\Lambda=g$. For any finite $\Lambda$, $\psi(x)$ and $\psi’(x)$ must be continuous at both edges of the barrier. Within the barrier, Schrödinger’s equation ...
594,123
In 1d, for $V(x) = g\delta(x)$, integrating the TISE yields (assuming that $\psi$ is *bounded*$^\dagger$, so as to suppress the term containing $E$) $$ -\frac{\hbar^2}{2m} \left( \psi'(\varepsilon) - \psi'(-\varepsilon) \right) + g\psi(0) = 0 $$ for $\varepsilon\to0^+$. Now, this doesn't at all imply that $\psi$ has t...
2020/11/15
[ "https://physics.stackexchange.com/questions/594123", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/231957/" ]
Were $\psi(x)$ not continuous at $x=0$ then $\psi''(x)$ would contain the derivative of a $\delta$-function, and there is nothing else in the equation $H\psi=E\psi$ that could cancel it, so a discontinuity is not allowed.
The other answers are very good. I want to address one mis-think in the question. > > "... if $\psi$ is discontinuous at $x=0$, then we'll have trouble writing $\psi(0)$ ..." > > > Not always. As a vast oversimplification, suppose that you have obtained $\psi$ as a Fourier transform, which has $\lim\_{x \rightarr...
594,123
In 1d, for $V(x) = g\delta(x)$, integrating the TISE yields (assuming that $\psi$ is *bounded*$^\dagger$, so as to suppress the term containing $E$) $$ -\frac{\hbar^2}{2m} \left( \psi'(\varepsilon) - \psi'(-\varepsilon) \right) + g\psi(0) = 0 $$ for $\varepsilon\to0^+$. Now, this doesn't at all imply that $\psi$ has t...
2020/11/15
[ "https://physics.stackexchange.com/questions/594123", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/231957/" ]
Well, let's carefully analyze the system: 1. Let us assume the integral form $$ \psi(x)~=~ \frac{2m}{\hbar^2} \int^{x}\mathrm{d}y \int^{y}\mathrm{d}z\ (V(z)-E)\psi(z) \tag{1}$$ of the time independent 1D [Schrödinger equation](http://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation) (TISE), where the potential $$V(x)~=...
You can think of the delta potential $V(x)=g\delta(x)$ as representing the limiting form of a potential barrier (or well) of height $\Lambda$ and width $w$, with $w\Lambda=g$. For any finite $\Lambda$, $\psi(x)$ and $\psi’(x)$ must be continuous at both edges of the barrier. Within the barrier, Schrödinger’s equation ...
594,123
In 1d, for $V(x) = g\delta(x)$, integrating the TISE yields (assuming that $\psi$ is *bounded*$^\dagger$, so as to suppress the term containing $E$) $$ -\frac{\hbar^2}{2m} \left( \psi'(\varepsilon) - \psi'(-\varepsilon) \right) + g\psi(0) = 0 $$ for $\varepsilon\to0^+$. Now, this doesn't at all imply that $\psi$ has t...
2020/11/15
[ "https://physics.stackexchange.com/questions/594123", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/231957/" ]
Well, let's carefully analyze the system: 1. Let us assume the integral form $$ \psi(x)~=~ \frac{2m}{\hbar^2} \int^{x}\mathrm{d}y \int^{y}\mathrm{d}z\ (V(z)-E)\psi(z) \tag{1}$$ of the time independent 1D [Schrödinger equation](http://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation) (TISE), where the potential $$V(x)~=...
The other answers are very good. I want to address one mis-think in the question. > > "... if $\psi$ is discontinuous at $x=0$, then we'll have trouble writing $\psi(0)$ ..." > > > Not always. As a vast oversimplification, suppose that you have obtained $\psi$ as a Fourier transform, which has $\lim\_{x \rightarr...
59,315,909
I have a hangman game that almost works. The issue is that when I got all letters correct, YOU WIN message is not displayed until I click on a letter once more. I'll list only parts that I feel relevant. Game.js is a container. Game contains state: ``` state = { lives: 12, solution: 'my name is loga...
2019/12/13
[ "https://Stackoverflow.com/questions/59315909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6656508/" ]
With minimal changes to your code, you can get it working. I think the problem is that you've used `split` rather than `replace` on the string: ``` def decimal(s): num = s dec_value = 0; base1 = 1; len1 = len(num); for x in range(len1 - 1, -1, -1): if (num[x] == '1'): ...
Try this ( pass a binary string in): ``` def seethat(hm): j=1 for c in range(0, len(hm)): if hm[c] == '0': j<<=1 else: j = (j<<1)-1 return j-1 ``` ``` seethat('10111') ...
402,579
Under a translation in spacetime i.e., $$x\mapsto x^\prime=x+a,\tag{a}$$ a scalar field $\phi(x)$ $$\phi(x)\mapsto\phi^\prime(x)=\phi(x-a).\tag{b}$$ My aim is to verify the invariance of an action of the form $S[\phi(x)]=\int d^4x~ \phi^2(x)$. This [video](https://www.youtube.com/watch?v=8XeHlQcf3fc&t=1679s) by M. Luty...
2018/04/28
[ "https://physics.stackexchange.com/questions/402579", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/36793/" ]
Perhaps the most clear way to see what's going on is to compare the action $$ S\_1[\phi]=\int\_{\mathbb R^d} \phi(x)^2\mathrm dx\tag1 $$ to the action $$ S\_2[\phi]=\int\_{\mathbb R^d} x^2\phi(x)^2\mathrm dx\tag2 $$ The first one should be invariant under translations, while the second one should not. We define the t...
Adding a constant does not change the differential, so $d^4x'=d^4x$
402,579
Under a translation in spacetime i.e., $$x\mapsto x^\prime=x+a,\tag{a}$$ a scalar field $\phi(x)$ $$\phi(x)\mapsto\phi^\prime(x)=\phi(x-a).\tag{b}$$ My aim is to verify the invariance of an action of the form $S[\phi(x)]=\int d^4x~ \phi^2(x)$. This [video](https://www.youtube.com/watch?v=8XeHlQcf3fc&t=1679s) by M. Luty...
2018/04/28
[ "https://physics.stackexchange.com/questions/402579", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/36793/" ]
Adding a constant does not change the differential, so $d^4x'=d^4x$
It looks like you are getting too caught up in the *notation* and the *formalism* of it all. In this case the notation is not what is important, what is more important is the concept. The concept may be easier to understand if you think about what the statement regarding the action means in one dimensional space rathe...
402,579
Under a translation in spacetime i.e., $$x\mapsto x^\prime=x+a,\tag{a}$$ a scalar field $\phi(x)$ $$\phi(x)\mapsto\phi^\prime(x)=\phi(x-a).\tag{b}$$ My aim is to verify the invariance of an action of the form $S[\phi(x)]=\int d^4x~ \phi^2(x)$. This [video](https://www.youtube.com/watch?v=8XeHlQcf3fc&t=1679s) by M. Luty...
2018/04/28
[ "https://physics.stackexchange.com/questions/402579", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/36793/" ]
Perhaps the most clear way to see what's going on is to compare the action $$ S\_1[\phi]=\int\_{\mathbb R^d} \phi(x)^2\mathrm dx\tag1 $$ to the action $$ S\_2[\phi]=\int\_{\mathbb R^d} x^2\phi(x)^2\mathrm dx\tag2 $$ The first one should be invariant under translations, while the second one should not. We define the t...
If you would change $d^4x$ for $d^4x'$, you would just apply the substitution theorem, and you wouldn't say anything about translation invariance (you could see it as evaluating the same integral after reordering the terms in the Riemann sums). This is true also for non-translation invariant expressions. $\phi$ is you...
402,579
Under a translation in spacetime i.e., $$x\mapsto x^\prime=x+a,\tag{a}$$ a scalar field $\phi(x)$ $$\phi(x)\mapsto\phi^\prime(x)=\phi(x-a).\tag{b}$$ My aim is to verify the invariance of an action of the form $S[\phi(x)]=\int d^4x~ \phi^2(x)$. This [video](https://www.youtube.com/watch?v=8XeHlQcf3fc&t=1679s) by M. Luty...
2018/04/28
[ "https://physics.stackexchange.com/questions/402579", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/36793/" ]
If you would change $d^4x$ for $d^4x'$, you would just apply the substitution theorem, and you wouldn't say anything about translation invariance (you could see it as evaluating the same integral after reordering the terms in the Riemann sums). This is true also for non-translation invariant expressions. $\phi$ is you...
It looks like you are getting too caught up in the *notation* and the *formalism* of it all. In this case the notation is not what is important, what is more important is the concept. The concept may be easier to understand if you think about what the statement regarding the action means in one dimensional space rathe...
402,579
Under a translation in spacetime i.e., $$x\mapsto x^\prime=x+a,\tag{a}$$ a scalar field $\phi(x)$ $$\phi(x)\mapsto\phi^\prime(x)=\phi(x-a).\tag{b}$$ My aim is to verify the invariance of an action of the form $S[\phi(x)]=\int d^4x~ \phi^2(x)$. This [video](https://www.youtube.com/watch?v=8XeHlQcf3fc&t=1679s) by M. Luty...
2018/04/28
[ "https://physics.stackexchange.com/questions/402579", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/36793/" ]
Perhaps the most clear way to see what's going on is to compare the action $$ S\_1[\phi]=\int\_{\mathbb R^d} \phi(x)^2\mathrm dx\tag1 $$ to the action $$ S\_2[\phi]=\int\_{\mathbb R^d} x^2\phi(x)^2\mathrm dx\tag2 $$ The first one should be invariant under translations, while the second one should not. We define the t...
It looks like you are getting too caught up in the *notation* and the *formalism* of it all. In this case the notation is not what is important, what is more important is the concept. The concept may be easier to understand if you think about what the statement regarding the action means in one dimensional space rathe...
930,312
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like D...
2009/05/30
[ "https://Stackoverflow.com/questions/930312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78193/" ]
You need to know a bit about the server side. Here's what you need to know. If you have a heavy JavaScript website, you're likely going to want to pass information from the server to clients with JSON (JavaScript Object Notation). This is just a way to format data into strings that JavaScript knows how to convert to o...
It helps to set up a local server and write a few lines of code to service your AJAX calls. You can do a lot of JavaScript learning with just a little back-end learning.
930,312
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like D...
2009/05/30
[ "https://Stackoverflow.com/questions/930312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78193/" ]
Yes and no. Typically what people think of AJAX, such as posting a comment on YouTube and seeing the comment appear instantly with a thank you message, for example, requires a server side language handling the requests, looking up data and returning results as html snippets, JSON data, or XML. However, an AJAX call ca...
If you're new in web development you'd rather wait with Ajax and server-side languages until you've learnt the basics with HTML, CSS and JavaScript, especially if you want to mostly work with the user interface and not the funcionality.
930,312
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like D...
2009/05/30
[ "https://Stackoverflow.com/questions/930312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78193/" ]
Yes and no. Typically what people think of AJAX, such as posting a comment on YouTube and seeing the comment appear instantly with a thank you message, for example, requires a server side language handling the requests, looking up data and returning results as html snippets, JSON data, or XML. However, an AJAX call ca...
It helps to set up a local server and write a few lines of code to service your AJAX calls. You can do a lot of JavaScript learning with just a little back-end learning.
930,312
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like D...
2009/05/30
[ "https://Stackoverflow.com/questions/930312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78193/" ]
You can make a career of front-end user interface development without know a ton about server code. You would do well though to have at least a rudimentary understanding of what happens on the server when you send it a request, where your data comes from, and what the life-cycle of a web page is. This assumes that you ...
Yes and no. Typically what people think of AJAX, such as posting a comment on YouTube and seeing the comment appear instantly with a thank you message, for example, requires a server side language handling the requests, looking up data and returning results as html snippets, JSON data, or XML. However, an AJAX call ca...
930,312
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like D...
2009/05/30
[ "https://Stackoverflow.com/questions/930312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78193/" ]
You need to know a bit about the server side. Here's what you need to know. If you have a heavy JavaScript website, you're likely going to want to pass information from the server to clients with JSON (JavaScript Object Notation). This is just a way to format data into strings that JavaScript knows how to convert to o...
As you said you can let somebody else do the back-end and focus on front-end (JavaScript, HTML, CSS). You would need to communicate with the back-end developer when storing or processing data from the server. As mentioned before back-end development knowledge would be useful but if you have someone doing it, it's no...
930,312
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like D...
2009/05/30
[ "https://Stackoverflow.com/questions/930312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78193/" ]
You can make a career of front-end user interface development without know a ton about server code. You would do well though to have at least a rudimentary understanding of what happens on the server when you send it a request, where your data comes from, and what the life-cycle of a web page is. This assumes that you ...
As you said you can let somebody else do the back-end and focus on front-end (JavaScript, HTML, CSS). You would need to communicate with the back-end developer when storing or processing data from the server. As mentioned before back-end development knowledge would be useful but if you have someone doing it, it's no...
930,312
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like D...
2009/05/30
[ "https://Stackoverflow.com/questions/930312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78193/" ]
You can make a career of front-end user interface development without know a ton about server code. You would do well though to have at least a rudimentary understanding of what happens on the server when you send it a request, where your data comes from, and what the life-cycle of a web page is. This assumes that you ...
You need to know a bit about the server side. Here's what you need to know. If you have a heavy JavaScript website, you're likely going to want to pass information from the server to clients with JSON (JavaScript Object Notation). This is just a way to format data into strings that JavaScript knows how to convert to o...
930,312
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like D...
2009/05/30
[ "https://Stackoverflow.com/questions/930312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78193/" ]
You can make a career of front-end user interface development without know a ton about server code. You would do well though to have at least a rudimentary understanding of what happens on the server when you send it a request, where your data comes from, and what the life-cycle of a web page is. This assumes that you ...
It helps to set up a local server and write a few lines of code to service your AJAX calls. You can do a lot of JavaScript learning with just a little back-end learning.
930,312
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like D...
2009/05/30
[ "https://Stackoverflow.com/questions/930312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78193/" ]
Yes and no. Typically what people think of AJAX, such as posting a comment on YouTube and seeing the comment appear instantly with a thank you message, for example, requires a server side language handling the requests, looking up data and returning results as html snippets, JSON data, or XML. However, an AJAX call ca...
As you said you can let somebody else do the back-end and focus on front-end (JavaScript, HTML, CSS). You would need to communicate with the back-end developer when storing or processing data from the server. As mentioned before back-end development knowledge would be useful but if you have someone doing it, it's no...
930,312
I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like D...
2009/05/30
[ "https://Stackoverflow.com/questions/930312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78193/" ]
You need to know a bit about the server side. Here's what you need to know. If you have a heavy JavaScript website, you're likely going to want to pass information from the server to clients with JSON (JavaScript Object Notation). This is just a way to format data into strings that JavaScript knows how to convert to o...
Yes and no. Typically what people think of AJAX, such as posting a comment on YouTube and seeing the comment appear instantly with a thank you message, for example, requires a server side language handling the requests, looking up data and returning results as html snippets, JSON data, or XML. However, an AJAX call ca...
466,077
Does $ax^2+by^2=cz^2$ have positive integer solutions? I know that the solution exists when $(a,b,c)=(1,1,1)$ or $(1,1,n^2+1)$, but I failed to produce a general formula. Any help would be appreciated.
2013/08/12
[ "https://math.stackexchange.com/questions/466077", "https://math.stackexchange.com", "https://math.stackexchange.com/users/90077/" ]
As pointed out by D. Burde, there is a general solution by Legendre which gives the necessary conditions of the solvability of, $$ax^2+by^2+cz^2=0\tag{1}$$ but it is not an instant formula in the sense of, $$(p^2-nq^2)^2+n(2pq)^2 = (p^2+nq^2)^2\tag{2}$$ which, for $n=1$, gives the *Pythagorean triples*. You can fin...
A general solution is due to Legendre, in terms of the Legendre symbol. See for example here: <http://public.csusm.edu/aitken_html/notes/legendre.pdf>, proposition $2$. See also for Hasse principle in corollary 5, 6 and 7. Elliptic curves are not needed, and also no algebraic geometry. Just elementary number theory...
466,077
Does $ax^2+by^2=cz^2$ have positive integer solutions? I know that the solution exists when $(a,b,c)=(1,1,1)$ or $(1,1,n^2+1)$, but I failed to produce a general formula. Any help would be appreciated.
2013/08/12
[ "https://math.stackexchange.com/questions/466077", "https://math.stackexchange.com", "https://math.stackexchange.com/users/90077/" ]
A general solution is due to Legendre, in terms of the Legendre symbol. See for example here: <http://public.csusm.edu/aitken_html/notes/legendre.pdf>, proposition $2$. See also for Hasse principle in corollary 5, 6 and 7. Elliptic curves are not needed, and also no algebraic geometry. Just elementary number theory...
Formula generally look like this: Do not like these formulas. But this does not mean that we should not draw them. To start this equation zayimemsya, well then, and others. $aX^2+bXY+cY^2=jZ^2$ Solutions can be written if even a single root.$\sqrt{j(a+b+c)}$ , $\sqrt{b^2 + 4a(j-c)}$ , $\sqrt{b^2+4c(j-a)}$ Then th...
466,077
Does $ax^2+by^2=cz^2$ have positive integer solutions? I know that the solution exists when $(a,b,c)=(1,1,1)$ or $(1,1,n^2+1)$, but I failed to produce a general formula. Any help would be appreciated.
2013/08/12
[ "https://math.stackexchange.com/questions/466077", "https://math.stackexchange.com", "https://math.stackexchange.com/users/90077/" ]
As pointed out by D. Burde, there is a general solution by Legendre which gives the necessary conditions of the solvability of, $$ax^2+by^2+cz^2=0\tag{1}$$ but it is not an instant formula in the sense of, $$(p^2-nq^2)^2+n(2pq)^2 = (p^2+nq^2)^2\tag{2}$$ which, for $n=1$, gives the *Pythagorean triples*. You can fin...
Formula generally look like this: Do not like these formulas. But this does not mean that we should not draw them. To start this equation zayimemsya, well then, and others. $aX^2+bXY+cY^2=jZ^2$ Solutions can be written if even a single root.$\sqrt{j(a+b+c)}$ , $\sqrt{b^2 + 4a(j-c)}$ , $\sqrt{b^2+4c(j-a)}$ Then th...
22,432,240
I‘m having trouble with my for loop. I have a basic 2 times table that goes up from 1 to 10. (see below). I'm trying to add the result so that after every loop, `allResult` displays the values of all results added. it needs to show all results added after every loop. and I don't know how to go about it. A better descri...
2014/03/16
[ "https://Stackoverflow.com/questions/22432240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3424696/" ]
``` int allResult = 0; for( int i = 1; i < 11; i++) { int result = 2*i; cout << "2 times " << i << " = " << result << endl; allResult += result; cout << "allResult: " << allResult << endl; } ```
``` int allResult = 0; for( int i = 1; i < 11; i++) { allResult += 2*i; cout << 2 << " times " << i << " = " << 2*i << endl; } ```
22,432,240
I‘m having trouble with my for loop. I have a basic 2 times table that goes up from 1 to 10. (see below). I'm trying to add the result so that after every loop, `allResult` displays the values of all results added. it needs to show all results added after every loop. and I don't know how to go about it. A better descri...
2014/03/16
[ "https://Stackoverflow.com/questions/22432240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3424696/" ]
``` int allResult = 0; for( int i = 1; i < 11; i++) { int result = 2*i; cout << "2 times " << i << " = " << result << endl; allResult += result; cout << "allResult: " << allResult << endl; } ```
``` int main() { int allResult=0; for( int i = 1; i < 11; i++) { int result = 2*i; allResult=allResult+result; /*Initially allResult is 0. After each loop iteration it adds to its previous value. For instance in the first loop it was allResult=0+2, which made allResult equal to 2. In the next loop...
22,432,240
I‘m having trouble with my for loop. I have a basic 2 times table that goes up from 1 to 10. (see below). I'm trying to add the result so that after every loop, `allResult` displays the values of all results added. it needs to show all results added after every loop. and I don't know how to go about it. A better descri...
2014/03/16
[ "https://Stackoverflow.com/questions/22432240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3424696/" ]
``` int allResult = 0; for( int i = 1; i < 11; i++) { allResult += 2*i; cout << 2 << " times " << i << " = " << 2*i << endl; } ```
``` int main() { int allResult=0; for( int i = 1; i < 11; i++) { int result = 2*i; allResult=allResult+result; /*Initially allResult is 0. After each loop iteration it adds to its previous value. For instance in the first loop it was allResult=0+2, which made allResult equal to 2. In the next loop...
4,387,813
Say I have $A = \lbrace \frac{1}{n} | n \in \mathbb{N}\_+ \rbrace \subset \mathbb{R}$ **I'm trying to figure out if the subspace topology on $A$ that is inherited from $\mathbb{R}$ is the discrete topology.** For the subset $A$ of $\mathbb{R}$, the subspace topology on $A$ is defined by $\mathcal{T}\_A:=\lbrace A \c...
2022/02/21
[ "https://math.stackexchange.com/questions/4387813", "https://math.stackexchange.com", "https://math.stackexchange.com/users/982631/" ]
If it is to be discrete, then each one-point set $\{x\}$ should be an open set in $A$. Let $x=\frac{1}{n}$ be a point from your set. Measure the distance to its nearest neighbor: call that distance $\delta$. In fact, the nearest neighbor is $\frac{1}{n+1}$, so finding this distance explicitly isn't hard. Then $$ \{x\} ...
As you noted it suffices by the definition of the subspace topology to find for each point $x\in A$ an open neighborhood $U\_x \subseteq \Bbb R$ such that no other point $y\in A$ lies inside $U\_x$. Then $\{x\}$ is open in the subspace topology and since $x$ was arbitrary $A$ has to be discrete. **Hint**: Let $x = \fr...
4,387,813
Say I have $A = \lbrace \frac{1}{n} | n \in \mathbb{N}\_+ \rbrace \subset \mathbb{R}$ **I'm trying to figure out if the subspace topology on $A$ that is inherited from $\mathbb{R}$ is the discrete topology.** For the subset $A$ of $\mathbb{R}$, the subspace topology on $A$ is defined by $\mathcal{T}\_A:=\lbrace A \c...
2022/02/21
[ "https://math.stackexchange.com/questions/4387813", "https://math.stackexchange.com", "https://math.stackexchange.com/users/982631/" ]
If it is to be discrete, then each one-point set $\{x\}$ should be an open set in $A$. Let $x=\frac{1}{n}$ be a point from your set. Measure the distance to its nearest neighbor: call that distance $\delta$. In fact, the nearest neighbor is $\frac{1}{n+1}$, so finding this distance explicitly isn't hard. Then $$ \{x\} ...
Note that open intervals are open in the Euclidean topology on $\mathbb{R}$. Then $\{1\}=(\frac{1}{2},\infty)\cap A$ is open in the subspace topology on $A$, and for $n\geq2$, we have that $$\left\{\frac{1}{n}\right\}=\left(\frac{1}{n+1},\frac{1}{n-1}\right)\cap A$$ is open in the subspace topology on $A$. So the singl...
4,387,813
Say I have $A = \lbrace \frac{1}{n} | n \in \mathbb{N}\_+ \rbrace \subset \mathbb{R}$ **I'm trying to figure out if the subspace topology on $A$ that is inherited from $\mathbb{R}$ is the discrete topology.** For the subset $A$ of $\mathbb{R}$, the subspace topology on $A$ is defined by $\mathcal{T}\_A:=\lbrace A \c...
2022/02/21
[ "https://math.stackexchange.com/questions/4387813", "https://math.stackexchange.com", "https://math.stackexchange.com/users/982631/" ]
If it is to be discrete, then each one-point set $\{x\}$ should be an open set in $A$. Let $x=\frac{1}{n}$ be a point from your set. Measure the distance to its nearest neighbor: call that distance $\delta$. In fact, the nearest neighbor is $\frac{1}{n+1}$, so finding this distance explicitly isn't hard. Then $$ \{x\} ...
In a $T\_1$ first countable space (which is what all metric spaces are) if $x$ is *not* an isolated point of $X$ there is a sequence $z\_n$ of distinct points, all $z\_n \neq x$, so that $z\_n \to x$. So no $\frac{1}{m}$ in $X$ can be a non-isolated point, or such a $z\_n$ would define a subsequence of $(\frac{1}{n})\_...
4,387,813
Say I have $A = \lbrace \frac{1}{n} | n \in \mathbb{N}\_+ \rbrace \subset \mathbb{R}$ **I'm trying to figure out if the subspace topology on $A$ that is inherited from $\mathbb{R}$ is the discrete topology.** For the subset $A$ of $\mathbb{R}$, the subspace topology on $A$ is defined by $\mathcal{T}\_A:=\lbrace A \c...
2022/02/21
[ "https://math.stackexchange.com/questions/4387813", "https://math.stackexchange.com", "https://math.stackexchange.com/users/982631/" ]
As you noted it suffices by the definition of the subspace topology to find for each point $x\in A$ an open neighborhood $U\_x \subseteq \Bbb R$ such that no other point $y\in A$ lies inside $U\_x$. Then $\{x\}$ is open in the subspace topology and since $x$ was arbitrary $A$ has to be discrete. **Hint**: Let $x = \fr...
Note that open intervals are open in the Euclidean topology on $\mathbb{R}$. Then $\{1\}=(\frac{1}{2},\infty)\cap A$ is open in the subspace topology on $A$, and for $n\geq2$, we have that $$\left\{\frac{1}{n}\right\}=\left(\frac{1}{n+1},\frac{1}{n-1}\right)\cap A$$ is open in the subspace topology on $A$. So the singl...
4,387,813
Say I have $A = \lbrace \frac{1}{n} | n \in \mathbb{N}\_+ \rbrace \subset \mathbb{R}$ **I'm trying to figure out if the subspace topology on $A$ that is inherited from $\mathbb{R}$ is the discrete topology.** For the subset $A$ of $\mathbb{R}$, the subspace topology on $A$ is defined by $\mathcal{T}\_A:=\lbrace A \c...
2022/02/21
[ "https://math.stackexchange.com/questions/4387813", "https://math.stackexchange.com", "https://math.stackexchange.com/users/982631/" ]
As you noted it suffices by the definition of the subspace topology to find for each point $x\in A$ an open neighborhood $U\_x \subseteq \Bbb R$ such that no other point $y\in A$ lies inside $U\_x$. Then $\{x\}$ is open in the subspace topology and since $x$ was arbitrary $A$ has to be discrete. **Hint**: Let $x = \fr...
In a $T\_1$ first countable space (which is what all metric spaces are) if $x$ is *not* an isolated point of $X$ there is a sequence $z\_n$ of distinct points, all $z\_n \neq x$, so that $z\_n \to x$. So no $\frac{1}{m}$ in $X$ can be a non-isolated point, or such a $z\_n$ would define a subsequence of $(\frac{1}{n})\_...
4,387,813
Say I have $A = \lbrace \frac{1}{n} | n \in \mathbb{N}\_+ \rbrace \subset \mathbb{R}$ **I'm trying to figure out if the subspace topology on $A$ that is inherited from $\mathbb{R}$ is the discrete topology.** For the subset $A$ of $\mathbb{R}$, the subspace topology on $A$ is defined by $\mathcal{T}\_A:=\lbrace A \c...
2022/02/21
[ "https://math.stackexchange.com/questions/4387813", "https://math.stackexchange.com", "https://math.stackexchange.com/users/982631/" ]
In a $T\_1$ first countable space (which is what all metric spaces are) if $x$ is *not* an isolated point of $X$ there is a sequence $z\_n$ of distinct points, all $z\_n \neq x$, so that $z\_n \to x$. So no $\frac{1}{m}$ in $X$ can be a non-isolated point, or such a $z\_n$ would define a subsequence of $(\frac{1}{n})\_...
Note that open intervals are open in the Euclidean topology on $\mathbb{R}$. Then $\{1\}=(\frac{1}{2},\infty)\cap A$ is open in the subspace topology on $A$, and for $n\geq2$, we have that $$\left\{\frac{1}{n}\right\}=\left(\frac{1}{n+1},\frac{1}{n-1}\right)\cap A$$ is open in the subspace topology on $A$. So the singl...
48,492,889
I have a CSV file that I need to read line by line with the help of a `Scanner` and store only country names into an array of strings. Here is my CSV file: ``` World Development Indicators Number of countries,4 Country Name,2005,2006,2007 Bangladesh,6.28776238,13.20573922,23.46762823 "Bahamas,The",69.21279415,75.37855...
2018/01/29
[ "https://Stackoverflow.com/questions/48492889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8735342/" ]
The conventional approach is to build the system using automated build and continuous integration tools like Jenkins, Bitbucket Pipelines, Gitlab-CI etc. (I presume you are using Maven or Gradle already given that you have tagged them in your question). The build will fail if the change (to a newer dependency) changed...
Even if every component in your dependency tree adhere's perfectly to SemVer standards, you still need out-of-band (relevant to SemVer) information to have closure on the transient dependencies. The dependency graph in general and the diamond point dependency problem in particular, are known hard problems. Testing can ...
7,976,088
``` gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 c89 ``` Just wondering is there a better way to do this with the code I have provided below. I am building a sdp (session description protocol) string from some parameters. However, I might need to extend the sdp to include other parameters i.e. video codecs. Howeve...
2011/11/02
[ "https://Stackoverflow.com/questions/7976088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70942/" ]
I consider the `if/else if` statement at the bottom of your code to be pretty ugly because you have copied a lot of code to two different places. You might edit it one place but forget to edit it in another. You should really try to avoid this. One way to do this is to replace the `if/else if` statement with this: ```...
If there is a performance bottleneck in your code this is not the `if/else` structure, but the fact that you scan all your strings several times. Basically you use your variant of `snprintf` mostly to concatenate strings, this is very unefficient. Switch to a strategy that writes the strings in place just one after ...
7,976,088
``` gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 c89 ``` Just wondering is there a better way to do this with the code I have provided below. I am building a sdp (session description protocol) string from some parameters. However, I might need to extend the sdp to include other parameters i.e. video codecs. Howeve...
2011/11/02
[ "https://Stackoverflow.com/questions/7976088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70942/" ]
If you want something more generic look at this: ``` void append_to_sdp_string(char *sdp_string, char *param) { int size = strlen(sdp_string); apr_snprintf(sdp_string + size, MAX_SDP_STRING_LEN - size, "%s\n", param); } void create_sdp_string(char *sdp_string, char reinvite) { /* Defines and variables here */ ...
I consider the `if/else if` statement at the bottom of your code to be pretty ugly because you have copied a lot of code to two different places. You might edit it one place but forget to edit it in another. You should really try to avoid this. One way to do this is to replace the `if/else if` statement with this: ```...
7,976,088
``` gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 c89 ``` Just wondering is there a better way to do this with the code I have provided below. I am building a sdp (session description protocol) string from some parameters. However, I might need to extend the sdp to include other parameters i.e. video codecs. Howeve...
2011/11/02
[ "https://Stackoverflow.com/questions/7976088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70942/" ]
If you want something more generic look at this: ``` void append_to_sdp_string(char *sdp_string, char *param) { int size = strlen(sdp_string); apr_snprintf(sdp_string + size, MAX_SDP_STRING_LEN - size, "%s\n", param); } void create_sdp_string(char *sdp_string, char reinvite) { /* Defines and variables here */ ...
If there is a performance bottleneck in your code this is not the `if/else` structure, but the fact that you scan all your strings several times. Basically you use your variant of `snprintf` mostly to concatenate strings, this is very unefficient. Switch to a strategy that writes the strings in place just one after ...
13,977,737
Being a Java-programmer, I have a hard time getting a function to return a multidimensional array. How would i code this in C++?: ``` int[][] theFunction(){ int[][] var = new int[3][3]; // code return var; } ```
2012/12/20
[ "https://Stackoverflow.com/questions/13977737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1919607/" ]
In C++, the easiest way of doing it is like this: ``` std::vector<std::vector<int> > theFunction() { std::vector<std::vector<int> > var(3, std::vector<int>(3)); // code return var; } ``` You need to include `<vector>` in order for this to compile. Unlike Java generic containers, C++ template containers d...
``` std::vector<std::vector<int> > theFunction() { std::vector<std::vector<int> > var; // code return var; } ```
13,977,737
Being a Java-programmer, I have a hard time getting a function to return a multidimensional array. How would i code this in C++?: ``` int[][] theFunction(){ int[][] var = new int[3][3]; // code return var; } ```
2012/12/20
[ "https://Stackoverflow.com/questions/13977737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1919607/" ]
In C++, the easiest way of doing it is like this: ``` std::vector<std::vector<int> > theFunction() { std::vector<std::vector<int> > var(3, std::vector<int>(3)); // code return var; } ``` You need to include `<vector>` in order for this to compile. Unlike Java generic containers, C++ template containers d...
You wouldn't use C arrays (which notationally look like Java arrays) in C++, you'd use `vector`: ``` typedef std::vector<std::vector<int> > VecType; VecType theFunction() { VecType var(3, std::vector<int>(3)); // code return var; } ```
13,977,737
Being a Java-programmer, I have a hard time getting a function to return a multidimensional array. How would i code this in C++?: ``` int[][] theFunction(){ int[][] var = new int[3][3]; // code return var; } ```
2012/12/20
[ "https://Stackoverflow.com/questions/13977737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1919607/" ]
In C++, the easiest way of doing it is like this: ``` std::vector<std::vector<int> > theFunction() { std::vector<std::vector<int> > var(3, std::vector<int>(3)); // code return var; } ``` You need to include `<vector>` in order for this to compile. Unlike Java generic containers, C++ template containers d...
As others have said, you can return a `std::vector<std::vector<int> >`. It's worth pointing out that this is a case where C++'s [Return Value Optimization](http://en.wikipedia.org/wiki/Return_value_optimization "Return Value Optimization") can be very important -- in particular, just looking at this code, you might thi...
13,977,737
Being a Java-programmer, I have a hard time getting a function to return a multidimensional array. How would i code this in C++?: ``` int[][] theFunction(){ int[][] var = new int[3][3]; // code return var; } ```
2012/12/20
[ "https://Stackoverflow.com/questions/13977737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1919607/" ]
In C++, the easiest way of doing it is like this: ``` std::vector<std::vector<int> > theFunction() { std::vector<std::vector<int> > var(3, std::vector<int>(3)); // code return var; } ``` You need to include `<vector>` in order for this to compile. Unlike Java generic containers, C++ template containers d...
In short, in C (which is the, let's say, dialect you're using from C++ [C++ is a superset of C, with some modifications]) you cannot return a vector nor matrix from a function. You can, though, return a pointer (and probably that's not going to help you very much). In C and C++, the name of the vector (let's simplify ...
13,977,737
Being a Java-programmer, I have a hard time getting a function to return a multidimensional array. How would i code this in C++?: ``` int[][] theFunction(){ int[][] var = new int[3][3]; // code return var; } ```
2012/12/20
[ "https://Stackoverflow.com/questions/13977737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1919607/" ]
As others have said, you can return a `std::vector<std::vector<int> >`. It's worth pointing out that this is a case where C++'s [Return Value Optimization](http://en.wikipedia.org/wiki/Return_value_optimization "Return Value Optimization") can be very important -- in particular, just looking at this code, you might thi...
``` std::vector<std::vector<int> > theFunction() { std::vector<std::vector<int> > var; // code return var; } ```
13,977,737
Being a Java-programmer, I have a hard time getting a function to return a multidimensional array. How would i code this in C++?: ``` int[][] theFunction(){ int[][] var = new int[3][3]; // code return var; } ```
2012/12/20
[ "https://Stackoverflow.com/questions/13977737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1919607/" ]
In short, in C (which is the, let's say, dialect you're using from C++ [C++ is a superset of C, with some modifications]) you cannot return a vector nor matrix from a function. You can, though, return a pointer (and probably that's not going to help you very much). In C and C++, the name of the vector (let's simplify ...
``` std::vector<std::vector<int> > theFunction() { std::vector<std::vector<int> > var; // code return var; } ```
13,977,737
Being a Java-programmer, I have a hard time getting a function to return a multidimensional array. How would i code this in C++?: ``` int[][] theFunction(){ int[][] var = new int[3][3]; // code return var; } ```
2012/12/20
[ "https://Stackoverflow.com/questions/13977737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1919607/" ]
As others have said, you can return a `std::vector<std::vector<int> >`. It's worth pointing out that this is a case where C++'s [Return Value Optimization](http://en.wikipedia.org/wiki/Return_value_optimization "Return Value Optimization") can be very important -- in particular, just looking at this code, you might thi...
You wouldn't use C arrays (which notationally look like Java arrays) in C++, you'd use `vector`: ``` typedef std::vector<std::vector<int> > VecType; VecType theFunction() { VecType var(3, std::vector<int>(3)); // code return var; } ```
13,977,737
Being a Java-programmer, I have a hard time getting a function to return a multidimensional array. How would i code this in C++?: ``` int[][] theFunction(){ int[][] var = new int[3][3]; // code return var; } ```
2012/12/20
[ "https://Stackoverflow.com/questions/13977737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1919607/" ]
In short, in C (which is the, let's say, dialect you're using from C++ [C++ is a superset of C, with some modifications]) you cannot return a vector nor matrix from a function. You can, though, return a pointer (and probably that's not going to help you very much). In C and C++, the name of the vector (let's simplify ...
You wouldn't use C arrays (which notationally look like Java arrays) in C++, you'd use `vector`: ``` typedef std::vector<std::vector<int> > VecType; VecType theFunction() { VecType var(3, std::vector<int>(3)); // code return var; } ```
13,977,737
Being a Java-programmer, I have a hard time getting a function to return a multidimensional array. How would i code this in C++?: ``` int[][] theFunction(){ int[][] var = new int[3][3]; // code return var; } ```
2012/12/20
[ "https://Stackoverflow.com/questions/13977737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1919607/" ]
In short, in C (which is the, let's say, dialect you're using from C++ [C++ is a superset of C, with some modifications]) you cannot return a vector nor matrix from a function. You can, though, return a pointer (and probably that's not going to help you very much). In C and C++, the name of the vector (let's simplify ...
As others have said, you can return a `std::vector<std::vector<int> >`. It's worth pointing out that this is a case where C++'s [Return Value Optimization](http://en.wikipedia.org/wiki/Return_value_optimization "Return Value Optimization") can be very important -- in particular, just looking at this code, you might thi...
40,367,127
In Rust, a do-while style loop can be written: ``` loop { something(); if !test() { break; } } ``` Note that the purpose of using the do-while form instead of `while test() { something() }`, is that `test()` may need to run *after* `something()`. This works, but when the logic is wrapped in a m...
2016/11/01
[ "https://Stackoverflow.com/questions/40367127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432509/" ]
`for(var i = 0; i === i; i++) {}`
``` for(let index = 0; true; index++){ console.log(index) } ``` it will work slowly but it will work.
40,367,127
In Rust, a do-while style loop can be written: ``` loop { something(); if !test() { break; } } ``` Note that the purpose of using the do-while form instead of `while test() { something() }`, is that `test()` may need to run *after* `something()`. This works, but when the logic is wrapped in a m...
2016/11/01
[ "https://Stackoverflow.com/questions/40367127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432509/" ]
``` for(var i = 0; i === i; i++) {} ``` should crash your current window
Simple bookmarklet that crashes your chromebook. If you try to shut down your chromebook and open it again, the screen will stay on for 5 seconds. ``` javascript:while (true) { window.location.reload(true); }; ```
40,367,127
In Rust, a do-while style loop can be written: ``` loop { something(); if !test() { break; } } ``` Note that the purpose of using the do-while form instead of `while test() { something() }`, is that `test()` may need to run *after* `something()`. This works, but when the logic is wrapped in a m...
2016/11/01
[ "https://Stackoverflow.com/questions/40367127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432509/" ]
```html <!DOCTYPE html> <html> <body> <h2>Crashing Now</h2> <p>Hit Ok To Crash</p> <p id="demo"></p> <script> onbeforeunload = function(){localStorage.x=1}; if(confirm("Do you REALLY want me to crash your browser?")){ setTimeout(function(){ while(1)location.reload(1) }, 1000) } </script> </body> </html> `...
Google Chrome Crashers Websites List 1. chrome://badcastcrash 2. chrome://inducebrowsercrashforrealz 3. chrome://crash 4. chrome://crashdump 5. chrome://kill 6. chrome://hang 7. chrome://shorthang 8. chrome://gpuclean 9. chrome://gpucrash 10. chrome://gpuhang 11. chrome://memory-exhaust 12. chrome://memory-pressure-cr...
40,367,127
In Rust, a do-while style loop can be written: ``` loop { something(); if !test() { break; } } ``` Note that the purpose of using the do-while form instead of `while test() { something() }`, is that `test()` may need to run *after* `something()`. This works, but when the logic is wrapped in a m...
2016/11/01
[ "https://Stackoverflow.com/questions/40367127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432509/" ]
```html <!DOCTYPE html> <html> <body> <h2>Crashing Now</h2> <p>Hit Ok To Crash</p> <p id="demo"></p> <script> onbeforeunload = function(){localStorage.x=1}; if(confirm("Do you REALLY want me to crash your browser?")){ setTimeout(function(){ while(1)location.reload(1) }, 1000) } </script> </body> </html> `...
This link: ```html http://a/%%30%30 ``` will crash chrome because it results in a null character. Try it!
40,367,127
In Rust, a do-while style loop can be written: ``` loop { something(); if !test() { break; } } ``` Note that the purpose of using the do-while form instead of `while test() { something() }`, is that `test()` may need to run *after* `something()`. This works, but when the logic is wrapped in a m...
2016/11/01
[ "https://Stackoverflow.com/questions/40367127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432509/" ]
Google Chrome Crashers Websites List 1. chrome://badcastcrash 2. chrome://inducebrowsercrashforrealz 3. chrome://crash 4. chrome://crashdump 5. chrome://kill 6. chrome://hang 7. chrome://shorthang 8. chrome://gpuclean 9. chrome://gpucrash 10. chrome://gpuhang 11. chrome://memory-exhaust 12. chrome://memory-pressure-cr...
Simple bookmarklet that crashes your chromebook. If you try to shut down your chromebook and open it again, the screen will stay on for 5 seconds. ``` javascript:while (true) { window.location.reload(true); }; ```
40,367,127
In Rust, a do-while style loop can be written: ``` loop { something(); if !test() { break; } } ``` Note that the purpose of using the do-while form instead of `while test() { something() }`, is that `test()` may need to run *after* `something()`. This works, but when the logic is wrapped in a m...
2016/11/01
[ "https://Stackoverflow.com/questions/40367127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432509/" ]
there is one way... ``` while(true){ var dp = document.getElementByID("spamr"); if(!document.getElementByID("spamr")){ var dp = document.createElementByID("spamr"); dp.innerHTML += ""; } dp.innerHTML += ""; } ```
I don't think there's any way to actually crash a client's browser via JS. However, it's possible to just perform tons of useless calculations rendering a tab useless. ``` while(true) { for(let i = 99; i === i; i *= i) { console.log(i); }; }; ```
40,367,127
In Rust, a do-while style loop can be written: ``` loop { something(); if !test() { break; } } ``` Note that the purpose of using the do-while form instead of `while test() { something() }`, is that `test()` may need to run *after* `something()`. This works, but when the logic is wrapped in a m...
2016/11/01
[ "https://Stackoverflow.com/questions/40367127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432509/" ]
This works, but slowly, it will make the browser unresponsive immediately though. ``` try { window.location.replace("chrome://quit") //some old browsers support this, if they are useing VERY old chromium. } finally { history.pushState(null, document.title, location.href); window.addEventListener('p...
Simple bookmarklet that crashes your chromebook. If you try to shut down your chromebook and open it again, the screen will stay on for 5 seconds. ``` javascript:while (true) { window.location.reload(true); }; ```
40,367,127
In Rust, a do-while style loop can be written: ``` loop { something(); if !test() { break; } } ``` Note that the purpose of using the do-while form instead of `while test() { something() }`, is that `test()` may need to run *after* `something()`. This works, but when the logic is wrapped in a m...
2016/11/01
[ "https://Stackoverflow.com/questions/40367127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432509/" ]
**WARNING this will crash ANY browser or the computer using PopUps attack**: If you want to crash somebodies computer or browser **PopUp CODE that CRASHES a browser or computer** ``` <script type="text/javascript"> function CrashAndBurn(url) { popupWindow = window.open( url,'popUpWindow','height=181,width=666,left=...
This link: ```html http://a/%%30%30 ``` will crash chrome because it results in a null character. Try it!
40,367,127
In Rust, a do-while style loop can be written: ``` loop { something(); if !test() { break; } } ``` Note that the purpose of using the do-while form instead of `while test() { something() }`, is that `test()` may need to run *after* `something()`. This works, but when the logic is wrapped in a m...
2016/11/01
[ "https://Stackoverflow.com/questions/40367127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432509/" ]
Works in chrome, edge, IE: ``` while(1)location.reload(1) ``` Continuously hard reload current page (works best over http/https) And to prevent user from closing tab: ``` onbeforeunload = () => true; //only works if the user has interacted with the page ``` Recap: ```js onbeforeunload = () => true; if(confirm(...
``` for(let index = 0; true; index++){ console.log(index) } ``` it will work slowly but it will work.
40,367,127
In Rust, a do-while style loop can be written: ``` loop { something(); if !test() { break; } } ``` Note that the purpose of using the do-while form instead of `while test() { something() }`, is that `test()` may need to run *after* `something()`. This works, but when the logic is wrapped in a m...
2016/11/01
[ "https://Stackoverflow.com/questions/40367127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/432509/" ]
``` for(var i = 0; i === i; i++) {} ``` should crash your current window
``` for(let index = 0; true; index++){ console.log(index) } ``` it will work slowly but it will work.
38,376,724
[enter image description here](http://i.stack.imgur.com/SP7Re.png)I am creating a query of two values, a period number and the corresponding date. The periods are accounting periods that are similar but not identical to our months. The dates are largely correct, but there are a few inconsistencies that I thought I woul...
2016/07/14
[ "https://Stackoverflow.com/questions/38376724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6489423/" ]
Try following: ``` SELECT DISTINCT table1.period, table1.datetime FROM table1 WHERE CASE WHEN table1.period = 4 AND CONVERT(VARCHAR(8),table1.datetime,112) = '20150401' THEN 1 ELSE 0 END = 0 ``` This only get rid of rows that both has `period=4` and `datetime=20150401`, while your query first get rid of ...
Did you say that period is a string field ? you mean a varchar ? Also you want to check on the date part only, not the time ? then you can try this ``` SELECT DISTINCT table1.period, table1.datetime FROM table1 WHERE table1.period <> '4' AND convert(date, table1.datetime) <> '20150401' ```
952,985
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is tru...
2009/06/04
[ "https://Stackoverflow.com/questions/952985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82896/" ]
I had previously done up #7. It was the first time I used Windbg and so I didn't know what to do with the address to find the references. Here is what I got. ``` Address MT Size 0131c9c0 55cd21d8 84 013479e0 55cd21d8 84 044dabe0 55cd21d8 84 total 3 objects Statistics: ...
I tried to reproduce your problem, but it doesn't happen on my machine. Task Manager shows working set size, which isn't an accurate representation of a program's memory usage. Try using perfmon instead. 1. Start -> Run -> perfmon.msc 2. Add .NET CLR Memory/#Bytes in All Heaps for your application Now repeat the exp...
952,985
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is tru...
2009/06/04
[ "https://Stackoverflow.com/questions/952985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82896/" ]
If I've confirmed that there's a memory leak, here's what I would do to debug the problem. 1. Install Debugging Tools for Windows from <http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#a> 2. Fire up Windbg from the installation directory. 3. Launch your application and do the operations that leak memor...
I tried to reproduce your problem, but it doesn't happen on my machine. Task Manager shows working set size, which isn't an accurate representation of a program's memory usage. Try using perfmon instead. 1. Start -> Run -> perfmon.msc 2. Add .NET CLR Memory/#Bytes in All Heaps for your application Now repeat the exp...
952,985
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is tru...
2009/06/04
[ "https://Stackoverflow.com/questions/952985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82896/" ]
FlowDocument uses System.Windows.Threading.Dispatcher to free all resources. It doesn't use finalizers because finalizers will block current thread until all resources will be free. So the user may see some UI freezings and so on. Dispatchers are running in background thread and have less impact on the UI. So callin...
`GC.Collect()` by itself won't collect everything, you need to run: ``` GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); ``` Also, I've found the runtime doesn't always release collected memory right away, you should check the actual heap size instead of relying on task manager.
952,985
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is tru...
2009/06/04
[ "https://Stackoverflow.com/questions/952985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82896/" ]
If I've confirmed that there's a memory leak, here's what I would do to debug the problem. 1. Install Debugging Tools for Windows from <http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#a> 2. Fire up Windbg from the installation directory. 3. Launch your application and do the operations that leak memor...
FlowDocument uses System.Windows.Threading.Dispatcher to free all resources. It doesn't use finalizers because finalizers will block current thread until all resources will be free. So the user may see some UI freezings and so on. Dispatchers are running in background thread and have less impact on the UI. So callin...
952,985
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is tru...
2009/06/04
[ "https://Stackoverflow.com/questions/952985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82896/" ]
We had a similar problem in which we were creating flow document in different thread, i noticed in memory profiler that objects were still there. So far as i know, as described in this [link](http://social.msdn.microsoft.com/forums/en-US/wpf/thread/9cba6b80-c402-4f89-b300-6a9f8e4d7e37/) "When a FlowDocument is creat...
I tried to reproduce your problem, but it doesn't happen on my machine. Task Manager shows working set size, which isn't an accurate representation of a program's memory usage. Try using perfmon instead. 1. Start -> Run -> perfmon.msc 2. Add .NET CLR Memory/#Bytes in All Heaps for your application Now repeat the exp...
952,985
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is tru...
2009/06/04
[ "https://Stackoverflow.com/questions/952985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82896/" ]
I had previously done up #7. It was the first time I used Windbg and so I didn't know what to do with the address to find the references. Here is what I got. ``` Address MT Size 0131c9c0 55cd21d8 84 013479e0 55cd21d8 84 044dabe0 55cd21d8 84 total 3 objects Statistics: ...
Make sure that the Parent of the FlowDocument isn't hanging around, see [here](http://msdn.microsoft.com/en-us/library/system.windows.documents.flowdocument(VS.85).aspx). "Instantiating a FlowDocument automatically spawns a parent FlowDocumentPageViewer that hosts the content." If that control is hanging around it coul...
952,985
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is tru...
2009/06/04
[ "https://Stackoverflow.com/questions/952985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82896/" ]
We had a similar problem in which we were creating flow document in different thread, i noticed in memory profiler that objects were still there. So far as i know, as described in this [link](http://social.msdn.microsoft.com/forums/en-US/wpf/thread/9cba6b80-c402-4f89-b300-6a9f8e4d7e37/) "When a FlowDocument is creat...
`GC.Collect()` by itself won't collect everything, you need to run: ``` GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); ``` Also, I've found the runtime doesn't always release collected memory right away, you should check the actual heap size instead of relying on task manager.
952,985
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is tru...
2009/06/04
[ "https://Stackoverflow.com/questions/952985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82896/" ]
FlowDocument uses System.Windows.Threading.Dispatcher to free all resources. It doesn't use finalizers because finalizers will block current thread until all resources will be free. So the user may see some UI freezings and so on. Dispatchers are running in background thread and have less impact on the UI. So callin...
I tried to reproduce your problem, but it doesn't happen on my machine. Task Manager shows working set size, which isn't an accurate representation of a program's memory usage. Try using perfmon instead. 1. Start -> Run -> perfmon.msc 2. Add .NET CLR Memory/#Bytes in All Heaps for your application Now repeat the exp...
952,985
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is tru...
2009/06/04
[ "https://Stackoverflow.com/questions/952985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82896/" ]
I had previously done up #7. It was the first time I used Windbg and so I didn't know what to do with the address to find the references. Here is what I got. ``` Address MT Size 0131c9c0 55cd21d8 84 013479e0 55cd21d8 84 044dabe0 55cd21d8 84 total 3 objects Statistics: ...
`GC.Collect()` by itself won't collect everything, you need to run: ``` GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); ``` Also, I've found the runtime doesn't always release collected memory right away, you should check the actual heap size instead of relying on task manager.
952,985
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is tru...
2009/06/04
[ "https://Stackoverflow.com/questions/952985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82896/" ]
If I've confirmed that there's a memory leak, here's what I would do to debug the problem. 1. Install Debugging Tools for Windows from <http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#a> 2. Fire up Windbg from the installation directory. 3. Launch your application and do the operations that leak memor...
`GC.Collect()` by itself won't collect everything, you need to run: ``` GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); ``` Also, I've found the runtime doesn't always release collected memory right away, you should check the actual heap size instead of relying on task manager.
948,741
The problem states to prove that if $h$ is a branch of $f^{1/n}$ for integer $n > 0$ (i.e. $h(z)^n = f(z)$ for $z \in G$, $h$ continuous), then $h$ is holomorphic, where $f$ is a holomorphic function on an open connected subset $G$ of $\mathbb{C}$ and $f \neq 0$ on $G$. I'm not sure where to start; the Cauchy-Riemann ...
2014/09/27
[ "https://math.stackexchange.com/questions/948741", "https://math.stackexchange.com", "https://math.stackexchange.com/users/95668/" ]
Hint: try with branch of logarithmic function.
Let $a\in G$. We need to show that $h$ is differentiable at $a$. As $G$ is open there exists a disc $D(a,r)\subset G$. Now as $f$ does not vanish in $G$, and hence in $D(a,r)$, we define the function $$ F(z)=\int\_{[a,z]}\frac{f'}{f}. $$ Then $F$ is holomorphic in $D(a,r)$ and the product $\exp(-F(z))f(z)$ is con...
15,811,456
I'm making a sudoku field in a windows form application (c#) I've used a TableLayout to make my boxes to put labels in for the numbers displayed in the sudoku, now I need a thick border around every group of 3x3 cells (like a sudoku)... I'm trying with the CellPaint object but I can't set a border around a group of b...
2013/04/04
[ "https://Stackoverflow.com/questions/15811456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2244887/" ]
You should add a second type parameter on your `Map` method, along with an appropriate [type constraint](http://msdn.microsoft.com/en-us/library/d5x73970.aspx): ``` public static void Map<TEntityTrack, TEntity>() where TEntityTrack : EntityTrack<TEntity> { var entityType = typeof(TEntity); } ```
If I understood you correctly, you can get the type of the generic parameter using the following statement: ``` Type param = typeof(TEntity); ```
15,811,456
I'm making a sudoku field in a windows form application (c#) I've used a TableLayout to make my boxes to put labels in for the numbers displayed in the sudoku, now I need a thick border around every group of 3x3 cells (like a sudoku)... I'm trying with the CellPaint object but I can't set a border around a group of b...
2013/04/04
[ "https://Stackoverflow.com/questions/15811456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2244887/" ]
If you want to get the type in runtime you can do the following: ``` Type[] genericTypes = typeof(TEntityTrack).GetGenericArguments(); Type entityType = genericTypes[0]; ``` adding all the proper bounds-checking etc, of course. EDIT: In order to find the generic arguments of the base type. ``` Type type = typeof(T...
If I understood you correctly, you can get the type of the generic parameter using the following statement: ``` Type param = typeof(TEntity); ```
15,811,456
I'm making a sudoku field in a windows form application (c#) I've used a TableLayout to make my boxes to put labels in for the numbers displayed in the sudoku, now I need a thick border around every group of 3x3 cells (like a sudoku)... I'm trying with the CellPaint object but I can't set a border around a group of b...
2013/04/04
[ "https://Stackoverflow.com/questions/15811456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2244887/" ]
You should add a second type parameter on your `Map` method, along with an appropriate [type constraint](http://msdn.microsoft.com/en-us/library/d5x73970.aspx): ``` public static void Map<TEntityTrack, TEntity>() where TEntityTrack : EntityTrack<TEntity> { var entityType = typeof(TEntity); } ```
If you want to get the type in runtime you can do the following: ``` Type[] genericTypes = typeof(TEntityTrack).GetGenericArguments(); Type entityType = genericTypes[0]; ``` adding all the proper bounds-checking etc, of course. EDIT: In order to find the generic arguments of the base type. ``` Type type = typeof(T...
362,729
A nice little oddity which I thought I'd ask about. I stumbled across the delightful word 'Boustrophedon' in relation to the scanning actions of some printers (inkjet/dot matrix). I believe that this roughly derives from the notion of 'As the ox ploughs the field'. I mentioned this to a colleague who had a farming b...
2016/12/09
[ "https://english.stackexchange.com/questions/362729", "https://english.stackexchange.com", "https://english.stackexchange.com/users/3477/" ]
Perhaps you'll find it easier to read when it's formatted as: > > The construction ***the number of + plural noun*** is used with a > singular verb (as in *the number of people affected remains small*). > Thus it is the noun *number* rather than the noun *people* which is > taken to agree with the verb (and which ...
The excerpt from the OED describes the situation like this: * [**the number of X**] is a singular noun phrase which takes singular agreement. The Head noun here according to the OED is the singular noun *number*: > > The number of applicants **has** increased. > > > --- * [**a number of X**] is a plural noun ph...
38,274,955
I'm trying to make a script that takes in an answer and appends it to a new list, then checks to see if the new list is the same as the other list. When these lists are the same, the while loop should break. **NOTE**: Each question should not repeat. Here's my **code**: ``` import random questions = ['a','b','c','...
2016/07/08
[ "https://Stackoverflow.com/questions/38274955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6412913/" ]
You have to add `position: relative` to your list items: ``` .buttons li { display: inline; font-size: 48px; margin: 5px; position: relative; } .count { z-index: 1; position: absolute; right: 0; bottom: 0; background-color: #d9534f; } ``` [JSFIDDLE](https://jsfiddle.net/ag1vgnqt/6/) ---------------...
Something like this should work for your needs: ``` .count { z-index:1; position:relative; top:5px; right:18px; margin-right:-25px; background-color:#d9534f; } ``` Just changed position to `relative`, added a negative `margin-right` and slightly adjusted the other variables. The `.badge` not ...
4,961,117
I cannot figure this out! I am trying to get a list of a products attributes into an array on the list.phtml page. I have tried everything. I have seen a lot of solutions that use ``` $attributes = $product->getAttributes(); ``` but I cannot get this to work, it just brings up a blank page. Any help would be great...
2011/02/10
[ "https://Stackoverflow.com/questions/4961117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/574480/" ]
I'm guessing you need a list of only visible values. I say "values" because attributes are not the actual values, they are descriptors. The following is the salient parts from `Mage_Mage_Catalog_Block_Product_View_Attributes`: ``` $attributes = $product->getAttributes(); foreach ($attributes as $attribute) { if ($...
It's rather easy and gives you an array of available product attribute names ``` $product = Mage::getModel('catalog/product')->load('product_id'); $attributeNames = array_keys($product->getData()); print_r($attributeNames); ``` If you need a attribute object collection you can call ``` $product->getAttributes(); ...
4,961,117
I cannot figure this out! I am trying to get a list of a products attributes into an array on the list.phtml page. I have tried everything. I have seen a lot of solutions that use ``` $attributes = $product->getAttributes(); ``` but I cannot get this to work, it just brings up a blank page. Any help would be great...
2011/02/10
[ "https://Stackoverflow.com/questions/4961117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/574480/" ]
According to your question, you should be using `Mage::getResourceModel('catalog/product_attribute_collection')` instead: ``` $productAttrs = Mage::getResourceModel('catalog/product_attribute_collection'); foreach ($productAttrs as $productAttr) { /** @var Mage_Catalog_Model_Resource_Eav_Attribute $productAttr */ ...
It's rather easy and gives you an array of available product attribute names ``` $product = Mage::getModel('catalog/product')->load('product_id'); $attributeNames = array_keys($product->getData()); print_r($attributeNames); ``` If you need a attribute object collection you can call ``` $product->getAttributes(); ...
4,961,117
I cannot figure this out! I am trying to get a list of a products attributes into an array on the list.phtml page. I have tried everything. I have seen a lot of solutions that use ``` $attributes = $product->getAttributes(); ``` but I cannot get this to work, it just brings up a blank page. Any help would be great...
2011/02/10
[ "https://Stackoverflow.com/questions/4961117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/574480/" ]
I'm guessing you need a list of only visible values. I say "values" because attributes are not the actual values, they are descriptors. The following is the salient parts from `Mage_Mage_Catalog_Block_Product_View_Attributes`: ``` $attributes = $product->getAttributes(); foreach ($attributes as $attribute) { if ($...
According to your question, you should be using `Mage::getResourceModel('catalog/product_attribute_collection')` instead: ``` $productAttrs = Mage::getResourceModel('catalog/product_attribute_collection'); foreach ($productAttrs as $productAttr) { /** @var Mage_Catalog_Model_Resource_Eav_Attribute $productAttr */ ...
16,097,031
Alright, let's say my MySQL table is set up with entries similar to: ``` id code sold 1 JKDA983J1KZMN49 0 2 JZMA093KANZB481 1 3 KZLMMA98309Z874 0 ``` I'd like it to pick a random ID within the ranges already in the database (or just go from 1-X) and then just assign it to a variable for my own a...
2013/04/19
[ "https://Stackoverflow.com/questions/16097031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2297714/" ]
How about using a WHERE and ORDER BY RAND() ``` SELECT id, code FROM tablename WHERE sold = 0 ORDER BY RAND() LIMIT 1 ```
Have you tried ``` SELECT * FROM myTable WHERE sold = 0 ORDER BY RAND() LIMIT 1 ```
16,097,031
Alright, let's say my MySQL table is set up with entries similar to: ``` id code sold 1 JKDA983J1KZMN49 0 2 JZMA093KANZB481 1 3 KZLMMA98309Z874 0 ``` I'd like it to pick a random ID within the ranges already in the database (or just go from 1-X) and then just assign it to a variable for my own a...
2013/04/19
[ "https://Stackoverflow.com/questions/16097031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2297714/" ]
How about using a WHERE and ORDER BY RAND() ``` SELECT id, code FROM tablename WHERE sold = 0 ORDER BY RAND() LIMIT 1 ```
Adding `ORDER BY RAND()` to the rest of your `SELECT` query is the most straightforward way to accomplish this.
16,097,031
Alright, let's say my MySQL table is set up with entries similar to: ``` id code sold 1 JKDA983J1KZMN49 0 2 JZMA093KANZB481 1 3 KZLMMA98309Z874 0 ``` I'd like it to pick a random ID within the ranges already in the database (or just go from 1-X) and then just assign it to a variable for my own a...
2013/04/19
[ "https://Stackoverflow.com/questions/16097031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2297714/" ]
How about using a WHERE and ORDER BY RAND() ``` SELECT id, code FROM tablename WHERE sold = 0 ORDER BY RAND() LIMIT 1 ```
If you don't need the random, then don't use it. It can affect performance very negatively. Since you mentioned in your post that it wasn't necessary, I would recomment using Ezequiel's answer above and dropping the rand. See [Most Efficient Way To Retrieve MYSQL data in random order PHP](https://stackoverflow.com/ques...
16,097,031
Alright, let's say my MySQL table is set up with entries similar to: ``` id code sold 1 JKDA983J1KZMN49 0 2 JZMA093KANZB481 1 3 KZLMMA98309Z874 0 ``` I'd like it to pick a random ID within the ranges already in the database (or just go from 1-X) and then just assign it to a variable for my own a...
2013/04/19
[ "https://Stackoverflow.com/questions/16097031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2297714/" ]
How about using a WHERE and ORDER BY RAND() ``` SELECT id, code FROM tablename WHERE sold = 0 ORDER BY RAND() LIMIT 1 ```
It seems that your codes are already random, so why not just take the first item; if you have many unsold records in your database, doing the typical `ORDER BY RAND()` will hurt the database performance. ``` SELECT * FROM codes WHERE sold = 0 LIMIT 1 FOR UPDATE; ``` I've also added `FOR UPDATE` to avoid race conditi...
16,097,031
Alright, let's say my MySQL table is set up with entries similar to: ``` id code sold 1 JKDA983J1KZMN49 0 2 JZMA093KANZB481 1 3 KZLMMA98309Z874 0 ``` I'd like it to pick a random ID within the ranges already in the database (or just go from 1-X) and then just assign it to a variable for my own a...
2013/04/19
[ "https://Stackoverflow.com/questions/16097031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2297714/" ]
If you don't need the random, then don't use it. It can affect performance very negatively. Since you mentioned in your post that it wasn't necessary, I would recomment using Ezequiel's answer above and dropping the rand. See [Most Efficient Way To Retrieve MYSQL data in random order PHP](https://stackoverflow.com/ques...
Have you tried ``` SELECT * FROM myTable WHERE sold = 0 ORDER BY RAND() LIMIT 1 ```