qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
27,123,304
I have come across some unit tests written by another developer that regularly use an overloaded version of `Assert.AreEqual` like so: ``` Assert.AreEqual(stringparamX, stringParamY, true, CultureInfo.InvariantCulture); ``` `stringParamX` is set within the unit test and `stringparamY` will be the result from the sy...
2014/11/25
[ "https://Stackoverflow.com/questions/27123304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/402421/" ]
There is no reason to use that overload if you are specifying the culture as `InvariantCulture`, because that is the default. From [the documentation here](http://msdn.microsoft.com/en-us/library/ms243448.aspx): > > The invariant culture is used for the comparison. > > > Note that there ARE some cases where it w...
The [MSDN documentation](http://msdn.microsoft.com/en-us/library/ms243448.aspx) for Assert.AreEqual that *doesn't* take the CultureInfo states in the "Remarks" section: > > The invariant culture is used for the comparison > > > If true, then specifying it explicitly is technically unnecessary. It's then a moot po...
10,353,275
I'm building out a decommissioning application that will allow an individual to provide an computer name and the utility will go out and purge the computer record from various locations. I'm running into a problem when attempting to delete a computer account from Active Directory. I'm impersonating a service account th...
2012/04/27
[ "https://Stackoverflow.com/questions/10353275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1361341/" ]
If you're on .NET 3.5 and up, you should check out the `System.DirectoryServices.AccountManagement` (S.DS.AM) namespace. Read all about it here: * [Managing Directory Security Principals in the .NET Framework 3.5](http://msdn.microsoft.com/en-us/magazine/cc135979.aspx) * [MSDN docs on System.DirectoryServices.AccountM...
Delete Tree is different from delete. You're going to need the Delete Subtree permission on the child computer objects for this to work.
21,841,551
I have to show all products that contain the word "Transducer" in them. I CANNOT use LIKE. I have tried using contain and I get a invalid relational operator error. I've tried everything I can think of and nothing is working. I'm using SQL Developer 4. Code: ``` SELECT product_name, name FROM a_product p JOIN a_item ...
2014/02/17
[ "https://Stackoverflow.com/questions/21841551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2250600/" ]
If you can't use LIKE because it's a problem for school, an alternative is REGEXP\_LIKE: ``` SELECT product_name, name FROM a_product p JOIN a_item i ON p.product_id = i.product_id JOIN a_sales_order so ON i.order_id = so.order_id JOIN a_customer c ON so.customer_id = c.customer_id where regexp_li...
<https://dev.mysql.com/doc/refman/5.1/en/regexp.html> ``` "SELECT * FROM `foo` WHERE `name` REGEXP *Transducer* ``` Or something like that?
74,271,442
Is it easy for people to find "public" google sheets/docs? Context: Storing some semi-sensitive data (individual user info, of non-sensitive nature) for an app beta-test in google sheets. Planning to migrate to some DB in the future, but for now, just using JavaScript to pull the data directly from the google sheets (...
2022/11/01
[ "https://Stackoverflow.com/questions/74271442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12634149/" ]
Yes, it's easy to get information. Search engines may index and cache the information. Then, there are bots, crawlers and scrapers. Do NOT put (semi)sensitive information in public. Implement [google-oauth](/questions/tagged/google-oauth "show questions tagged 'google-oauth'") properly with [google-sheets-api](/questio...
Don’t make it public unless you want the public to see it. Use oauth to access.
74,271,442
Is it easy for people to find "public" google sheets/docs? Context: Storing some semi-sensitive data (individual user info, of non-sensitive nature) for an app beta-test in google sheets. Planning to migrate to some DB in the future, but for now, just using JavaScript to pull the data directly from the google sheets (...
2022/11/01
[ "https://Stackoverflow.com/questions/74271442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12634149/" ]
Yes, it can be easily accessed. ------------------------------- According to the official Google article [Share files from Google Drive](https://support.google.com/docs/answer/2494822): when you set your file's `General Access` setting to `public`: > > Anyone can `search on Google` and get access to your file, `with...
Don’t make it public unless you want the public to see it. Use oauth to access.
74,271,442
Is it easy for people to find "public" google sheets/docs? Context: Storing some semi-sensitive data (individual user info, of non-sensitive nature) for an app beta-test in google sheets. Planning to migrate to some DB in the future, but for now, just using JavaScript to pull the data directly from the google sheets (...
2022/11/01
[ "https://Stackoverflow.com/questions/74271442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12634149/" ]
Yes, it's easy to get information. Search engines may index and cache the information. Then, there are bots, crawlers and scrapers. Do NOT put (semi)sensitive information in public. Implement [google-oauth](/questions/tagged/google-oauth "show questions tagged 'google-oauth'") properly with [google-sheets-api](/questio...
Yes, it can be easily accessed. ------------------------------- According to the official Google article [Share files from Google Drive](https://support.google.com/docs/answer/2494822): when you set your file's `General Access` setting to `public`: > > Anyone can `search on Google` and get access to your file, `with...
22,407,326
I have a subclass of NSManagedObject on which there's a "currency" attribute. This attribute is a 3 letters string. When I change it from "USD" to "CAD", and then call `changedValues` on the object, changedValues returns an empty dictionary. Is that the normal behaviour? I save the managedObjectContext first, then cha...
2014/03/14
[ "https://Stackoverflow.com/questions/22407326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3250560/" ]
I found a bug in my code. Now it works just fine. ;) I was using a delegate method to update the object from another viewController. When coming back from that viewController I saved the managedObjectContext in `viewWillAppear` which basically erased the changedValues.
Do it before you save the context. [NSManagedObject Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObject_Class/Reference/NSManagedObject.html#//apple_ref/occ/instm/NSManagedObject/changedValues) > > changedValues > > > Returns a dictionar...
32,896,020
this is my first question on here so ill try and be as detailed as possible! I am currently creating a HTML form with a select option with options 1 - 4. My aim is to use a Javascript function to create a certain amount of div's depending on which value the user has selected from the form. For example, if the user ha...
2015/10/01
[ "https://Stackoverflow.com/questions/32896020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5397172/" ]
You need to bind the `change` event on your `select` element. Something like this: ```js var divs = []; document.getElementById('select_seasons').addEventListener('change', function(e) { var n = +this.value; for (var i = 0; i < divs.length; i++) { divs[i].remove(); } divs = []; for (var i = 0; i ...
You could use the selected value of the `select` element: ``` var number = select.options[select.selectedIndex].value; ``` For example: ```js var select = document.getElementById("select_seasons"); var button = document.getElementById("add"); var container = document.getElementById("container"); button.addEven...
32,896,020
this is my first question on here so ill try and be as detailed as possible! I am currently creating a HTML form with a select option with options 1 - 4. My aim is to use a Javascript function to create a certain amount of div's depending on which value the user has selected from the form. For example, if the user ha...
2015/10/01
[ "https://Stackoverflow.com/questions/32896020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5397172/" ]
You need to bind the `change` event on your `select` element. Something like this: ```js var divs = []; document.getElementById('select_seasons').addEventListener('change', function(e) { var n = +this.value; for (var i = 0; i < divs.length; i++) { divs[i].remove(); } divs = []; for (var i = 0; i ...
If I understood the question correctly, the seasons form should update and auto-fill with the `select`'s number. Use the `change` event and refresh the form with the selected value. ```js var selectSeasons = document.getElementById("select_seasons"); selectSeasons.addEventListener('change', function() { populat...
32,896,020
this is my first question on here so ill try and be as detailed as possible! I am currently creating a HTML form with a select option with options 1 - 4. My aim is to use a Javascript function to create a certain amount of div's depending on which value the user has selected from the form. For example, if the user ha...
2015/10/01
[ "https://Stackoverflow.com/questions/32896020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5397172/" ]
You need to bind the `change` event on your `select` element. Something like this: ```js var divs = []; document.getElementById('select_seasons').addEventListener('change', function(e) { var n = +this.value; for (var i = 0; i < divs.length; i++) { divs[i].remove(); } divs = []; for (var i = 0; i ...
Solution for your problem: <http://jsfiddle.net/43ggkkg7/> ``` document.getElementById('select_seasons').addEventListener('change', function(){ var container = document.getElementById('container'); container.innerHTML = ''; //clear //Find selected option var n = 1; for(va...
32,896,020
this is my first question on here so ill try and be as detailed as possible! I am currently creating a HTML form with a select option with options 1 - 4. My aim is to use a Javascript function to create a certain amount of div's depending on which value the user has selected from the form. For example, if the user ha...
2015/10/01
[ "https://Stackoverflow.com/questions/32896020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5397172/" ]
You need to bind the `change` event on your `select` element. Something like this: ```js var divs = []; document.getElementById('select_seasons').addEventListener('change', function(e) { var n = +this.value; for (var i = 0; i < divs.length; i++) { divs[i].remove(); } divs = []; for (var i = 0; i ...
I will help you to read [this](https://stackoverflow.com/questions/14094697/javascript-how-to-create-new-div-dynamically-change-it-move-it-modify-it-in) now, I don't need another loop to remove the old divs in the container, you can use `innedHTML` and set it to empty. ``` <select id="select_seasons"> <option valu...
1,590,901
Prove the inequality: $$\left(1+\dfrac{1}{\sin a}\right)\left(1+\dfrac{1}{\cos a}\right)\ge 3+2\sqrt{2}; \text{ for } a\in\left]0,\frac{\pi}{2}\right[$$
2015/12/27
[ "https://math.stackexchange.com/questions/1590901", "https://math.stackexchange.com", "https://math.stackexchange.com/users/296768/" ]
By the AM-GM inequality, $$\dfrac{1}{\cos a}+\dfrac{1}{\sin a} \geq 2 \sqrt{\dfrac{1}{\sin a\cos a}}$$ Since $\sin a \cos a = \frac12 \sin(2a) \leq \frac12$, we have $\dfrac{1}{\sin a\cos a}\geq 2$. Hence $$\left(1+\dfrac{1}{\sin a}\right)\left(1+\dfrac{1}{\cos a}\right) = 1+\dfrac{1}{\cos a}+\dfrac{1}{\sin a}+\dfrac...
I think it should be $(0,\frac{\pi}{2})$, so that both $\sin a$ and $\cos a$ are positive and well defined. $$\bigg (1+\frac{1}{\sin a} \bigg)\bigg (1+\frac{1}{\cos a} \bigg) = 1+ \frac{1}{\sin a} + \frac{1}{\cos a} + \frac{1}{\sin a\cos a}$$ $$\frac{1}{\sin a} + \frac{1}{\cos a} \geq \frac{4}{\sin a + \cos a} \geq \...
1,590,901
Prove the inequality: $$\left(1+\dfrac{1}{\sin a}\right)\left(1+\dfrac{1}{\cos a}\right)\ge 3+2\sqrt{2}; \text{ for } a\in\left]0,\frac{\pi}{2}\right[$$
2015/12/27
[ "https://math.stackexchange.com/questions/1590901", "https://math.stackexchange.com", "https://math.stackexchange.com/users/296768/" ]
I think it should be $(0,\frac{\pi}{2})$, so that both $\sin a$ and $\cos a$ are positive and well defined. $$\bigg (1+\frac{1}{\sin a} \bigg)\bigg (1+\frac{1}{\cos a} \bigg) = 1+ \frac{1}{\sin a} + \frac{1}{\cos a} + \frac{1}{\sin a\cos a}$$ $$\frac{1}{\sin a} + \frac{1}{\cos a} \geq \frac{4}{\sin a + \cos a} \geq \...
Differentiate to find the minimum of the LHS : $$\frac{\mathrm{d}}{\mathrm{d}a}\left(\,\left(1+\frac{1}{\sin\,a}\right)\left(1+\frac{1}{\cos\,a}\right)\,\right)=0$$ $$\left(-\frac{1}{\sin^2 a}\right)\cos a\left(1+\frac{1}{\cos a}\right)+\left(1+\frac{1}{\sin a}\right)(-\sin a)\left(-\frac{1}{\cos^2 a}\right)=0$$ $$\...
1,590,901
Prove the inequality: $$\left(1+\dfrac{1}{\sin a}\right)\left(1+\dfrac{1}{\cos a}\right)\ge 3+2\sqrt{2}; \text{ for } a\in\left]0,\frac{\pi}{2}\right[$$
2015/12/27
[ "https://math.stackexchange.com/questions/1590901", "https://math.stackexchange.com", "https://math.stackexchange.com/users/296768/" ]
By the AM-GM inequality, $$\dfrac{1}{\cos a}+\dfrac{1}{\sin a} \geq 2 \sqrt{\dfrac{1}{\sin a\cos a}}$$ Since $\sin a \cos a = \frac12 \sin(2a) \leq \frac12$, we have $\dfrac{1}{\sin a\cos a}\geq 2$. Hence $$\left(1+\dfrac{1}{\sin a}\right)\left(1+\dfrac{1}{\cos a}\right) = 1+\dfrac{1}{\cos a}+\dfrac{1}{\sin a}+\dfrac...
Here is another proof: Assume $x^2+y^2=1$ then $(x+y)^2=1+2xy$ and $$\left(1+\frac{1}{x}\right)\left(1+\frac{1}{y}\right)=\frac{xy+x+y+1}{xy}=\frac{(x+y+1)^2}{(x+y)^2-1}=\frac{x+y+1}{x+y-1}$$ Now rearranging the inequality becomes $x+y\leq \sqrt{2}$. And it can be seen simply that this is the maximum value of $x+y$ ...
1,590,901
Prove the inequality: $$\left(1+\dfrac{1}{\sin a}\right)\left(1+\dfrac{1}{\cos a}\right)\ge 3+2\sqrt{2}; \text{ for } a\in\left]0,\frac{\pi}{2}\right[$$
2015/12/27
[ "https://math.stackexchange.com/questions/1590901", "https://math.stackexchange.com", "https://math.stackexchange.com/users/296768/" ]
By the AM-GM inequality, $$\dfrac{1}{\cos a}+\dfrac{1}{\sin a} \geq 2 \sqrt{\dfrac{1}{\sin a\cos a}}$$ Since $\sin a \cos a = \frac12 \sin(2a) \leq \frac12$, we have $\dfrac{1}{\sin a\cos a}\geq 2$. Hence $$\left(1+\dfrac{1}{\sin a}\right)\left(1+\dfrac{1}{\cos a}\right) = 1+\dfrac{1}{\cos a}+\dfrac{1}{\sin a}+\dfrac...
Differentiate to find the minimum of the LHS : $$\frac{\mathrm{d}}{\mathrm{d}a}\left(\,\left(1+\frac{1}{\sin\,a}\right)\left(1+\frac{1}{\cos\,a}\right)\,\right)=0$$ $$\left(-\frac{1}{\sin^2 a}\right)\cos a\left(1+\frac{1}{\cos a}\right)+\left(1+\frac{1}{\sin a}\right)(-\sin a)\left(-\frac{1}{\cos^2 a}\right)=0$$ $$\...
1,590,901
Prove the inequality: $$\left(1+\dfrac{1}{\sin a}\right)\left(1+\dfrac{1}{\cos a}\right)\ge 3+2\sqrt{2}; \text{ for } a\in\left]0,\frac{\pi}{2}\right[$$
2015/12/27
[ "https://math.stackexchange.com/questions/1590901", "https://math.stackexchange.com", "https://math.stackexchange.com/users/296768/" ]
Here is another proof: Assume $x^2+y^2=1$ then $(x+y)^2=1+2xy$ and $$\left(1+\frac{1}{x}\right)\left(1+\frac{1}{y}\right)=\frac{xy+x+y+1}{xy}=\frac{(x+y+1)^2}{(x+y)^2-1}=\frac{x+y+1}{x+y-1}$$ Now rearranging the inequality becomes $x+y\leq \sqrt{2}$. And it can be seen simply that this is the maximum value of $x+y$ ...
Differentiate to find the minimum of the LHS : $$\frac{\mathrm{d}}{\mathrm{d}a}\left(\,\left(1+\frac{1}{\sin\,a}\right)\left(1+\frac{1}{\cos\,a}\right)\,\right)=0$$ $$\left(-\frac{1}{\sin^2 a}\right)\cos a\left(1+\frac{1}{\cos a}\right)+\left(1+\frac{1}{\sin a}\right)(-\sin a)\left(-\frac{1}{\cos^2 a}\right)=0$$ $$\...
542,428
Can anyone identify this connector? Female part: [![enter image description here](https://i.stack.imgur.com/iTFuz.jpg)](https://i.stack.imgur.com/iTFuz.jpg) [![enter image description here](https://i.stack.imgur.com/gnLI1.jpg)](https://i.stack.imgur.com/gnLI1.jpg) [![enter image description here](https://i.stack.imgu...
2021/01/13
[ "https://electronics.stackexchange.com/questions/542428", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/200654/" ]
It looks like a “Molex” 4-position connector. It seems to be part connector series “2695” (if you look up ‘Molex 2695’, you get plenty of results). If you go to Molex’s page directly for that part, they even provide a nice “Mates with/use with” section detailing the corresponding headers / crimps / pre-crimped leads). ...
Molex "KK" series, I believe -- [link](https://www.molex.com/molex/products/family/kk_254_rpc_connector_system)
697,526
I want to set up a source code control system that: 1. is networked, so users can access it at work or on the road 2. does not need to provide sharing, lock mode is sufficient 3. there will be only three users and they will never be working with the same code 4. we have no system administrator and not much knowledge i...
2009/03/30
[ "https://Stackoverflow.com/questions/697526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24989/" ]
The simplest version control system I am aware of is a **Revision Control System RCS**. It is a command line utility that is available out of the box on Linux systems. It's usage is quite simple. **First.** Inside current directory, create a directory where RCS's information will be stored: ``` $ mkdir RCS ``` **Se...
Lots of recommendations for SVN, but I'm not sure I'd call that "simplest" from an admin point of view. You still need to set up a server, IIRC. In comparison, a DVCS like Mercurial makes no distinction between "repository" and "working copy". To put something on a server (which can be any folder you have file-sharing ...
697,526
I want to set up a source code control system that: 1. is networked, so users can access it at work or on the road 2. does not need to provide sharing, lock mode is sufficient 3. there will be only three users and they will never be working with the same code 4. we have no system administrator and not much knowledge i...
2009/03/30
[ "https://Stackoverflow.com/questions/697526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24989/" ]
Try [Subversion (svn)](http://subversion.tigris.org/). Edit: Rich beat me to it =D. And yes, as he points out sharing is better than locking. Sounds like you're a SourceSafe user. Those were the same set of problems I was trying to address when moving out from SourceSafe =)
Lots of recommendations for SVN, but I'm not sure I'd call that "simplest" from an admin point of view. You still need to set up a server, IIRC. In comparison, a DVCS like Mercurial makes no distinction between "repository" and "working copy". To put something on a server (which can be any folder you have file-sharing ...
697,526
I want to set up a source code control system that: 1. is networked, so users can access it at work or on the road 2. does not need to provide sharing, lock mode is sufficient 3. there will be only three users and they will never be working with the same code 4. we have no system administrator and not much knowledge i...
2009/03/30
[ "https://Stackoverflow.com/questions/697526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24989/" ]
[SVN](http://subversion.tigris.org/) covers all of these, and is quite easy to set up. Wrt point 2, sharing tends to be better than locking, as a file that is locked by someone who then goes on holiday/dies/etc. needs to be unlocked by someone before it can be worked on by another developer. SVN supports sharing 'out ...
I recommend [Tortoise SVN](https://tortoisesvn.net/). SVN is a source control environment that's easy to set up and use on Windows, and Tortoise is an add on that integrates with windows explorer. Despite being simple to use, it allows different people to work on the same file and merge their changes. Even though that...
697,526
I want to set up a source code control system that: 1. is networked, so users can access it at work or on the road 2. does not need to provide sharing, lock mode is sufficient 3. there will be only three users and they will never be working with the same code 4. we have no system administrator and not much knowledge i...
2009/03/30
[ "https://Stackoverflow.com/questions/697526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24989/" ]
the *SIMPLEST* system is what we here call the "Hey Chris" system. We have a networked drive that everyone can mount, and if you want to edit something you shoud "Hey, Chris, are you working on blahblah.cpp?" and Chris says "Nope." and then you edit blahblah.cpp, and stick it back on the shared drive... If you want ver...
Try [Subversion (svn)](http://subversion.tigris.org/). Edit: Rich beat me to it =D. And yes, as he points out sharing is better than locking. Sounds like you're a SourceSafe user. Those were the same set of problems I was trying to address when moving out from SourceSafe =)
697,526
I want to set up a source code control system that: 1. is networked, so users can access it at work or on the road 2. does not need to provide sharing, lock mode is sufficient 3. there will be only three users and they will never be working with the same code 4. we have no system administrator and not much knowledge i...
2009/03/30
[ "https://Stackoverflow.com/questions/697526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24989/" ]
[SVN](http://subversion.tigris.org/) covers all of these, and is quite easy to set up. Wrt point 2, sharing tends to be better than locking, as a file that is locked by someone who then goes on holiday/dies/etc. needs to be unlocked by someone before it can be worked on by another developer. SVN supports sharing 'out ...
[Darcs](http://darcs.net) provides all this and a lot more. It's a distributed version contoll system, which would make it easier to access the data on the road. You can send/receive patches (similar to revisions) through email or ssh. The thing about darcs that I like the most is that it's really verbose. It really t...
697,526
I want to set up a source code control system that: 1. is networked, so users can access it at work or on the road 2. does not need to provide sharing, lock mode is sufficient 3. there will be only three users and they will never be working with the same code 4. we have no system administrator and not much knowledge i...
2009/03/30
[ "https://Stackoverflow.com/questions/697526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24989/" ]
the *SIMPLEST* system is what we here call the "Hey Chris" system. We have a networked drive that everyone can mount, and if you want to edit something you shoud "Hey, Chris, are you working on blahblah.cpp?" and Chris says "Nope." and then you edit blahblah.cpp, and stick it back on the shared drive... If you want ver...
Lots of recommendations for SVN, but I'm not sure I'd call that "simplest" from an admin point of view. You still need to set up a server, IIRC. In comparison, a DVCS like Mercurial makes no distinction between "repository" and "working copy". To put something on a server (which can be any folder you have file-sharing ...
697,526
I want to set up a source code control system that: 1. is networked, so users can access it at work or on the road 2. does not need to provide sharing, lock mode is sufficient 3. there will be only three users and they will never be working with the same code 4. we have no system administrator and not much knowledge i...
2009/03/30
[ "https://Stackoverflow.com/questions/697526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24989/" ]
[SVN](http://subversion.tigris.org/) covers all of these, and is quite easy to set up. Wrt point 2, sharing tends to be better than locking, as a file that is locked by someone who then goes on holiday/dies/etc. needs to be unlocked by someone before it can be worked on by another developer. SVN supports sharing 'out ...
Try [Subversion (svn)](http://subversion.tigris.org/). Edit: Rich beat me to it =D. And yes, as he points out sharing is better than locking. Sounds like you're a SourceSafe user. Those were the same set of problems I was trying to address when moving out from SourceSafe =)
697,526
I want to set up a source code control system that: 1. is networked, so users can access it at work or on the road 2. does not need to provide sharing, lock mode is sufficient 3. there will be only three users and they will never be working with the same code 4. we have no system administrator and not much knowledge i...
2009/03/30
[ "https://Stackoverflow.com/questions/697526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24989/" ]
Try [Subversion (svn)](http://subversion.tigris.org/). Edit: Rich beat me to it =D. And yes, as he points out sharing is better than locking. Sounds like you're a SourceSafe user. Those were the same set of problems I was trying to address when moving out from SourceSafe =)
[Darcs](http://darcs.net) provides all this and a lot more. It's a distributed version contoll system, which would make it easier to access the data on the road. You can send/receive patches (similar to revisions) through email or ssh. The thing about darcs that I like the most is that it's really verbose. It really t...
697,526
I want to set up a source code control system that: 1. is networked, so users can access it at work or on the road 2. does not need to provide sharing, lock mode is sufficient 3. there will be only three users and they will never be working with the same code 4. we have no system administrator and not much knowledge i...
2009/03/30
[ "https://Stackoverflow.com/questions/697526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24989/" ]
the *SIMPLEST* system is what we here call the "Hey Chris" system. We have a networked drive that everyone can mount, and if you want to edit something you shoud "Hey, Chris, are you working on blahblah.cpp?" and Chris says "Nope." and then you edit blahblah.cpp, and stick it back on the shared drive... If you want ver...
I recommend [Tortoise SVN](https://tortoisesvn.net/). SVN is a source control environment that's easy to set up and use on Windows, and Tortoise is an add on that integrates with windows explorer. Despite being simple to use, it allows different people to work on the same file and merge their changes. Even though that...
697,526
I want to set up a source code control system that: 1. is networked, so users can access it at work or on the road 2. does not need to provide sharing, lock mode is sufficient 3. there will be only three users and they will never be working with the same code 4. we have no system administrator and not much knowledge i...
2009/03/30
[ "https://Stackoverflow.com/questions/697526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24989/" ]
[Mercurial](http://www.selenic.com/mercurial) or [Git](http://git-scm.com/)
Lots of recommendations for SVN, but I'm not sure I'd call that "simplest" from an admin point of view. You still need to set up a server, IIRC. In comparison, a DVCS like Mercurial makes no distinction between "repository" and "working copy". To put something on a server (which can be any folder you have file-sharing ...
25,049,968
In my localhost (with xammp) CakePHP works fine. After I completed my project and uploaded to my host, it gives me this error: ``` cakephp: Fatal error: Class 'appModel' not found in .../app/Model/Slider.php ``` Model class was called in AppController and AppModel.php (App::uses('appModel', 'Model')) & all is fine ...
2014/07/31
[ "https://Stackoverflow.com/questions/25049968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3829518/" ]
For Python2.7, Use `io.open()` in both locations. ``` import io import shutil with io.open('/etc/passwd', encoding='latin-1', errors='ignore') as source: with io.open('/tmp/goof', mode='w', encoding='utf-8') as target: shutil.copyfileobj(source, target) ``` The above program runs without errors on my PC...
This is how you can convert ansi to utf-8 in Python 2 (you just use normal file objects): ``` with open(file_path_ansi, "r") as source: with open(file_path_utf8, "w") as target: target.write(source.read().decode("latin1").encode("utf8")) ```
25,049,968
In my localhost (with xammp) CakePHP works fine. After I completed my project and uploaded to my host, it gives me this error: ``` cakephp: Fatal error: Class 'appModel' not found in .../app/Model/Slider.php ``` Model class was called in AppController and AppModel.php (App::uses('appModel', 'Model')) & all is fine ...
2014/07/31
[ "https://Stackoverflow.com/questions/25049968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3829518/" ]
This is how you can convert ansi to utf-8 in Python 2 (you just use normal file objects): ``` with open(file_path_ansi, "r") as source: with open(file_path_utf8, "w") as target: target.write(source.read().decode("latin1").encode("utf8")) ```
I had the same issue when I did try to write bytes to file. So my point is, bytes are already encoded. So when you use encoding keyword this leads to an error.
25,049,968
In my localhost (with xammp) CakePHP works fine. After I completed my project and uploaded to my host, it gives me this error: ``` cakephp: Fatal error: Class 'appModel' not found in .../app/Model/Slider.php ``` Model class was called in AppController and AppModel.php (App::uses('appModel', 'Model')) & all is fine ...
2014/07/31
[ "https://Stackoverflow.com/questions/25049968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3829518/" ]
This is how you can convert ansi to utf-8 in Python 2 (you just use normal file objects): ``` with open(file_path_ansi, "r") as source: with open(file_path_utf8, "w") as target: target.write(source.read().decode("latin1").encode("utf8")) ```
> > TypeError: 'encoding' is an invalid keyword argument for this function > > > ``` open('textfile.txt', encoding='utf-16') ``` Use io, it will work in both 2.7 and 3.6 python version ``` import io io.open('textfile.txt', encoding='utf-16') ```
25,049,968
In my localhost (with xammp) CakePHP works fine. After I completed my project and uploaded to my host, it gives me this error: ``` cakephp: Fatal error: Class 'appModel' not found in .../app/Model/Slider.php ``` Model class was called in AppController and AppModel.php (App::uses('appModel', 'Model')) & all is fine ...
2014/07/31
[ "https://Stackoverflow.com/questions/25049968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3829518/" ]
For Python2.7, Use `io.open()` in both locations. ``` import io import shutil with io.open('/etc/passwd', encoding='latin-1', errors='ignore') as source: with io.open('/tmp/goof', mode='w', encoding='utf-8') as target: shutil.copyfileobj(source, target) ``` The above program runs without errors on my PC...
I had the same issue when I did try to write bytes to file. So my point is, bytes are already encoded. So when you use encoding keyword this leads to an error.
25,049,968
In my localhost (with xammp) CakePHP works fine. After I completed my project and uploaded to my host, it gives me this error: ``` cakephp: Fatal error: Class 'appModel' not found in .../app/Model/Slider.php ``` Model class was called in AppController and AppModel.php (App::uses('appModel', 'Model')) & all is fine ...
2014/07/31
[ "https://Stackoverflow.com/questions/25049968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3829518/" ]
For Python2.7, Use `io.open()` in both locations. ``` import io import shutil with io.open('/etc/passwd', encoding='latin-1', errors='ignore') as source: with io.open('/tmp/goof', mode='w', encoding='utf-8') as target: shutil.copyfileobj(source, target) ``` The above program runs without errors on my PC...
> > TypeError: 'encoding' is an invalid keyword argument for this function > > > ``` open('textfile.txt', encoding='utf-16') ``` Use io, it will work in both 2.7 and 3.6 python version ``` import io io.open('textfile.txt', encoding='utf-16') ```
25,049,968
In my localhost (with xammp) CakePHP works fine. After I completed my project and uploaded to my host, it gives me this error: ``` cakephp: Fatal error: Class 'appModel' not found in .../app/Model/Slider.php ``` Model class was called in AppController and AppModel.php (App::uses('appModel', 'Model')) & all is fine ...
2014/07/31
[ "https://Stackoverflow.com/questions/25049968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3829518/" ]
> > TypeError: 'encoding' is an invalid keyword argument for this function > > > ``` open('textfile.txt', encoding='utf-16') ``` Use io, it will work in both 2.7 and 3.6 python version ``` import io io.open('textfile.txt', encoding='utf-16') ```
I had the same issue when I did try to write bytes to file. So my point is, bytes are already encoded. So when you use encoding keyword this leads to an error.
9,999,500
I am writing a simple game in XNA where you move a sprite around using WSAD. The problem is if two keys of the same direction are pressed at the same time, the movement cancels out and the character does not move. Is it possible to manually set a key to released to avoid this? Here is the key movement code: ``` if (ne...
2012/04/03
[ "https://Stackoverflow.com/questions/9999500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1150769/" ]
I had a similar issue a little while back and was able to solve it by changing my IE9 settings. The main things I find that tend to break WatiN are compatibility mode and protected mode. Turn these off. For Protected mode you have to turn it off for each security level. Not sure if this is the issue but thought I shoul...
I've got no idea since I've got the same configuration and everything is working ok here, but what happens when you put a System.Threading.Thread.Sleep(5000); between the two lines? Is there any difference if you run the test through NUnit? What happens when you start the browser with IE ie = new IE("http://google.com"...
32,105,834
I want to add an "Always-On-Top"-menuentry to the system menu of all windows (the menu which opens when you right click the titlebar or click the icon). I'd prefer C# or C++, but if worst comes to worst I'll also use VB... I know there are some applications like Dexpot which do this, but I was unable to find useful so...
2015/08/19
[ "https://Stackoverflow.com/questions/32105834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2061551/" ]
Use the `AddMenuItems()` method and test using MS-Paint. One thing I noticed is that after the program is closed, the modified system menu becomes wonky. Possibly this is because the events are not coming from the process' UI thread. A possible work-around is in the `ApplicationExit` event to call `GetMenu(hMainWindowH...
Here is an example of using a `ToolStripDropDown` instead of the default window menu. It can be made to look more like the default window menu by setting the background color, font and adding some icons if needed. It was surprisingly more difficult to hide the default window menu. Maybe there is a better way. The fail...
15,921,574
I build a worklight application. create android app and test this application with local machine , its working fine with emulator.but when i try to test this application with android tablet it through error "The Application failed connecting to the service". I try to find application-descriptor.xml and fix localhost t...
2013/04/10
[ "https://Stackoverflow.com/questions/15921574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2265231/" ]
Some things to check: - Are your tablet and your worklight development machine on the same wireless network? (they need to be!) - Does your computer have a firewall on it which may need configuring to let the traffic through. As a test you could briefly disable the firewall and see if you then have access (subject to...
In a command window, run `ipconfig` and copy the IPv4 address. This is the IP address you need to place as the value for `worklightServerRootURL` in the file application-descriptor.xml. The IP address you are usingnow does not look to me like the correct (public) IP address that you need to use. Try my above suggestio...
15,921,574
I build a worklight application. create android app and test this application with local machine , its working fine with emulator.but when i try to test this application with android tablet it through error "The Application failed connecting to the service". I try to find application-descriptor.xml and fix localhost t...
2013/04/10
[ "https://Stackoverflow.com/questions/15921574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2265231/" ]
Some things to check: - Are your tablet and your worklight development machine on the same wireless network? (they need to be!) - Does your computer have a firewall on it which may need configuring to let the traffic through. As a test you could briefly disable the firewall and see if you then have access (subject to...
How about adding "192.168.181.1:8080" in application-descriptor.xml?
15,921,574
I build a worklight application. create android app and test this application with local machine , its working fine with emulator.but when i try to test this application with android tablet it through error "The Application failed connecting to the service". I try to find application-descriptor.xml and fix localhost t...
2013/04/10
[ "https://Stackoverflow.com/questions/15921574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2265231/" ]
Some things to check: - Are your tablet and your worklight development machine on the same wireless network? (they need to be!) - Does your computer have a firewall on it which may need configuring to let the traffic through. As a test you could briefly disable the firewall and see if you then have access (subject to...
I would suggest the following debugging steps: a) Go to your device browser and browse to http: //xx.xx.xx.xx:8080/console -> If this doesn't work, you have an obvious ip address issue. Then you have to figure out why, maybe you have a Symantec thingy that blocks any incoming traffic to your desktop - which they do. ...
15,921,574
I build a worklight application. create android app and test this application with local machine , its working fine with emulator.but when i try to test this application with android tablet it through error "The Application failed connecting to the service". I try to find application-descriptor.xml and fix localhost t...
2013/04/10
[ "https://Stackoverflow.com/questions/15921574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2265231/" ]
Some things to check: - Are your tablet and your worklight development machine on the same wireless network? (they need to be!) - Does your computer have a firewall on it which may need configuring to let the traffic through. As a test you could briefly disable the firewall and see if you then have access (subject to...
1. Check ip in local machine ipconfig ( field Adaptador de Ethernet ) 2. Set this IP in field host name configuration server. 3. Rebuild 4. The other test is to check the direction in other machine, in the same network.
15,921,574
I build a worklight application. create android app and test this application with local machine , its working fine with emulator.but when i try to test this application with android tablet it through error "The Application failed connecting to the service". I try to find application-descriptor.xml and fix localhost t...
2013/04/10
[ "https://Stackoverflow.com/questions/15921574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2265231/" ]
1. Check ip in local machine ipconfig ( field Adaptador de Ethernet ) 2. Set this IP in field host name configuration server. 3. Rebuild 4. The other test is to check the direction in other machine, in the same network.
In a command window, run `ipconfig` and copy the IPv4 address. This is the IP address you need to place as the value for `worklightServerRootURL` in the file application-descriptor.xml. The IP address you are usingnow does not look to me like the correct (public) IP address that you need to use. Try my above suggestio...
15,921,574
I build a worklight application. create android app and test this application with local machine , its working fine with emulator.but when i try to test this application with android tablet it through error "The Application failed connecting to the service". I try to find application-descriptor.xml and fix localhost t...
2013/04/10
[ "https://Stackoverflow.com/questions/15921574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2265231/" ]
1. Check ip in local machine ipconfig ( field Adaptador de Ethernet ) 2. Set this IP in field host name configuration server. 3. Rebuild 4. The other test is to check the direction in other machine, in the same network.
How about adding "192.168.181.1:8080" in application-descriptor.xml?
15,921,574
I build a worklight application. create android app and test this application with local machine , its working fine with emulator.but when i try to test this application with android tablet it through error "The Application failed connecting to the service". I try to find application-descriptor.xml and fix localhost t...
2013/04/10
[ "https://Stackoverflow.com/questions/15921574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2265231/" ]
1. Check ip in local machine ipconfig ( field Adaptador de Ethernet ) 2. Set this IP in field host name configuration server. 3. Rebuild 4. The other test is to check the direction in other machine, in the same network.
I would suggest the following debugging steps: a) Go to your device browser and browse to http: //xx.xx.xx.xx:8080/console -> If this doesn't work, you have an obvious ip address issue. Then you have to figure out why, maybe you have a Symantec thingy that blocks any incoming traffic to your desktop - which they do. ...
30,346,744
I am preparing for an Oracle examination and answered incorrectly to the following question: > > the combination abstract private is legal for inner classes > > > As it turns the answer is true, I answered false, as I could not find any use cases for having an abstract private inner class, that cannot be overridd...
2015/05/20
[ "https://Stackoverflow.com/questions/30346744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3194545/" ]
The Java language specification defines the meaning of private members as follows: > > Otherwise, the member or constructor is declared private, and access is permitted if and only if it occurs within the body of the top level class (§7.6) that encloses the declaration of the member or constructor. > > > That is...
> > the combination abstract private is legal for inner classes > > > > Its a bit confusing but the rule is that an inner class can't have an abstract private method. if exam is saying the contrary then its wrong. **UPDATE**: if what you mean is in class declaration, then answer is true, check this **valid**...
58,340,926
I am trying to use a custom element in my application but after upgrading to the current version of lit-element, I can't seem to find the replacement function for **\_didRender**. I have tried **firstUpdated** and **connectedCallback** with no success. What should I do. The code renders but after rendering and amking a...
2019/10/11
[ "https://Stackoverflow.com/questions/58340926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10471519/" ]
have a look at the LitElement life cycle <https://lit-element.polymer-project.org/guide/lifecycle> \_didRender() i believe now is **updated()**
You also have the ability to rely on `await this.updateComplete;` in the case that you'd like to write async/await style code over callback style code.
49,864,528
I am trying to automate docx report generation process. For this I am using java and docx4j. I have a template document containing only single page.I would like to copy that page modify it and save it in another docx document.The output report is of multiple similar pages with modification from the template. How do I g...
2018/04/16
[ "https://Stackoverflow.com/questions/49864528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5958785/" ]
Leaving it up to you to modify the template, here is how you could add one document to the end of another document. Suppose `base.docx` contains "This is the base document." and `template.docx` contains "The time is:", then after executing this code: ``` WordprocessingMLPackage doc = Docx4J.load(new File("base.docx"))...
> > To be more precise my original template is containing only header and some styling component. > > > This kind of information can be stored in a Word stylesheet (.dotx file). > > PS : java and docx4j are my first choice but I am open to solutions apart from java and docx4j. > > > A good tool would be [p...
2,317,677
I am developing the smart device application. There are different screen resolution for different window mobile devices. I want to know that which is the standard screen resolution for windows mobile?
2010/02/23
[ "https://Stackoverflow.com/questions/2317677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265103/" ]
There is no standard. Many possibilities exist and the recent devices usually have 800x480. Others have: 640x480, 320x240, 320x320, 400x240, etc.
The default controls scale pretty well across resolutions. I've created forms in Visual Studio and deployed to multiple resolutions without any modifications.
69,828,385
App.jsx ``` import * as React from 'react'; import * as ReactDOM from 'react-dom'; function render() { ReactDOM.render(<h2>Hello from React!</h2>, document.body); } render(); ``` So, right now my friend made a React website that I have to try to port over to an Electron App that I got off of the team's Github....
2021/11/03
[ "https://Stackoverflow.com/questions/69828385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13948708/" ]
Ok, so the answer was adding this environment variable : ``` JAVA_OPTS_APPEND=-javaagent:{{path_to_elastic_apm_agent}} ``` this command allows you to launch your java application with options.
The Java agent allows multiple ways to configure it, one of which are command line system properties. Others include packaging an `elasticapm.properties` resource file or setting environment variables. [Check out the docs](https://www.elastic.co/guide/en/apm/agent/java/current/configuration.html). Small excerpt: > >...
25,199,553
``` text = ['This', 'brand', 'she', 'quenched', 'in', 'a', 'cool', 'well', 'by', 'Which', 'from', 'Love', "'", 's', 'fire'] ``` When I do a `' '.join(text)` I get the result; "This brand she quenched in a cool well by Which from Love ' s fire" I would like to join "Love ' s" as "Love's" instead of separating them. ...
2014/08/08
[ "https://Stackoverflow.com/questions/25199553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1948860/" ]
You can run a replace after joining. (Replace `" ' "` with `"'"`) ``` ' '.join(text).replace(" ' ", "'") ```
``` import re print re.sub(r"\s\'\s","'",' '.join(text)) ``` You can use this as a hack.It would be tough to join contents of list by 2 conditions.
27,369,502
I'm trying to make a vertical social share buttons for a blog post. ------------------------------------------------------------------- I want the "share\_DIV" position to be fixed after scrolling to a certain point. * because the "Share\_DIV" is not supposed to appear on header area, its position will be absolute an...
2014/12/09
[ "https://Stackoverflow.com/questions/27369502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1015648/" ]
You don't need to initialize it with a specific size - you can add objects later: ``` NSMutableArray *myArray = [NSMutableArray array]; for (int i = 0; i < 100; i++) { [myArray addObject:someData]; } ``` There are slight performance gains if you know the size ahead of time: ``` NSMutableArray *myArray = [NSMut...
`NSNull` is the class used to represent an unset, invalid or non-existent object. Therefore you can pad the array to a specific size using instances of this class. ``` NSUInteger sizeOfArray = 10; NSMutableArray *someArray = [NSMutableArray array]; for (NSUInteger i = 0; i < sizeOfArray; i++) { [someArray addObjec...
214,687
I'm looking for a library to save an array of colour data to a PNG file. (That's all there is to it, right? I know very little about the internals of a PNG.) This is for use in Nintendo DS development, so something lightweight is preferable. I don't need any other fancy features like rotation, etc.
2008/10/18
[ "https://Stackoverflow.com/questions/214687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/55/" ]
To encode any kind of PNG file, libpng is the way of the walk. However, on small devices like the DS you really want to store your image data in the format which the display hardware expects. It is technically possible to get libpng working on the platform, but it will add significant overhead, both in terms of loadti...
Have you looked at libpng? <http://www.libpng.org/pub/png/libpng.html> I'm not sure whether the memory footprint will be acceptable, but you should probably be aware that PNG files are a lot more involved than just an array of colors. Performance is likely to be a concern on a DS. If you go with libpng, you'll also n...
214,687
I'm looking for a library to save an array of colour data to a PNG file. (That's all there is to it, right? I know very little about the internals of a PNG.) This is for use in Nintendo DS development, so something lightweight is preferable. I don't need any other fancy features like rotation, etc.
2008/10/18
[ "https://Stackoverflow.com/questions/214687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/55/" ]
Have you looked at libpng? <http://www.libpng.org/pub/png/libpng.html> I'm not sure whether the memory footprint will be acceptable, but you should probably be aware that PNG files are a lot more involved than just an array of colors. Performance is likely to be a concern on a DS. If you go with libpng, you'll also n...
I managed to find a library that supports PNG (using libpng) and allows you to just give it raw image data. It's called [LibPicture](http://www.dragonminded.com/?loc=ndsdev/LibPicture). It's a bit hefty though: ~1MB.
214,687
I'm looking for a library to save an array of colour data to a PNG file. (That's all there is to it, right? I know very little about the internals of a PNG.) This is for use in Nintendo DS development, so something lightweight is preferable. I don't need any other fancy features like rotation, etc.
2008/10/18
[ "https://Stackoverflow.com/questions/214687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/55/" ]
To encode any kind of PNG file, libpng is the way of the walk. However, on small devices like the DS you really want to store your image data in the format which the display hardware expects. It is technically possible to get libpng working on the platform, but it will add significant overhead, both in terms of loadti...
I managed to find a library that supports PNG (using libpng) and allows you to just give it raw image data. It's called [LibPicture](http://www.dragonminded.com/?loc=ndsdev/LibPicture). It's a bit hefty though: ~1MB.
50,247,580
I have a keyword like "Click Menu Item" which takes an argument `${menuItem}`.It then clicks on the corresponding menu item making a dynamic locator xpath. I need to define/set the `LocatorVariables` and their Xpaths in separate `Locators.robot` resource file so that my testcases/keywords are xpaths free. ``` ** Keywo...
2018/05/09
[ "https://Stackoverflow.com/questions/50247580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9340007/" ]
You should use `object` name in template: ``` {% block content %} <h3>{{ object.title }}</h3> <h6> on {{ object.datetime }}</h6> <div class = "code"> {{ object.content|linebreaks }} </div> {% endblock %} ``` Or if you want to use `Tutorial` variable, you need to pass `context_object_name=Tu...
plus for @neverwalkaloner's answer. The reason why you can use `object` or `context_object_name` is cause you inherit `DetailView`. In `DetailView`, it has `get_object()` method. ``` def get_object(self, queryset=None): """ Return the object the view is displaying. Require `self.queryset` and a `pk` or ...
50,247,580
I have a keyword like "Click Menu Item" which takes an argument `${menuItem}`.It then clicks on the corresponding menu item making a dynamic locator xpath. I need to define/set the `LocatorVariables` and their Xpaths in separate `Locators.robot` resource file so that my testcases/keywords are xpaths free. ``` ** Keywo...
2018/05/09
[ "https://Stackoverflow.com/questions/50247580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9340007/" ]
You should use `object` name in template: ``` {% block content %} <h3>{{ object.title }}</h3> <h6> on {{ object.datetime }}</h6> <div class = "code"> {{ object.content|linebreaks }} </div> {% endblock %} ``` Or if you want to use `Tutorial` variable, you need to pass `context_object_name=Tu...
{% block content %} ### {{ object.title }} ``` <h6> on {{ object.datetime }}</h6> <div class = "code"> {{ object.content|linebreak }} </div> ``` {% endblock %}
50,247,580
I have a keyword like "Click Menu Item" which takes an argument `${menuItem}`.It then clicks on the corresponding menu item making a dynamic locator xpath. I need to define/set the `LocatorVariables` and their Xpaths in separate `Locators.robot` resource file so that my testcases/keywords are xpaths free. ``` ** Keywo...
2018/05/09
[ "https://Stackoverflow.com/questions/50247580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9340007/" ]
plus for @neverwalkaloner's answer. The reason why you can use `object` or `context_object_name` is cause you inherit `DetailView`. In `DetailView`, it has `get_object()` method. ``` def get_object(self, queryset=None): """ Return the object the view is displaying. Require `self.queryset` and a `pk` or ...
{% block content %} ### {{ object.title }} ``` <h6> on {{ object.datetime }}</h6> <div class = "code"> {{ object.content|linebreak }} </div> ``` {% endblock %}
22,156,030
i accessing google cloud storage by blobstore api, I would like to generate file names automatically instead of create it in the server. actually i want to do that, because it is hard to me to create a unique file name every time the user upload file. thank you
2014/03/03
[ "https://Stackoverflow.com/questions/22156030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3376321/" ]
If you are using Python you can simply use [UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier) to generate your random filenames like this: ``` import uuid ... # with dashes filename = uuid.uuid4() # or without dashhes filename = uuid.uuid4().hex ```
You can generate an organised file name simply by just by using either computer name and Internet clock time, with a Smart-Phone you can use GPS day time year and map coordinates like in the case of geotagging. Everything is unique and readily available on computer or mobile rather than leaving a server to name the fil...
61,100,105
I am attempting to only run an SQL `INSERT` query if the pageID (number) which is pulled through via an AJAX call, is more than what is already in the db. A user essentially clicks on a next button, which shows the correct page content, then calls an AJAX POST request, which fires an SQL statement. Any guidance on the ...
2020/04/08
[ "https://Stackoverflow.com/questions/61100105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11040508/" ]
you could try to wrap the `activeMQConnectionFactory` in a `CachingConnectionFactory` and utilize the `DefaultJmsListenerContainerFactoryConfigurer` to configure the `JmsListenerContainerFactory`: ``` @Bean ConnectionFactory connectionFactory() { return new CachingConnectionFactory(activeMQConnectionFactory()); } ...
I solved this with the below Code: ``` public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(){ DefaultJmsListenerContainerFactory defaultJmsListenerContainerFactory = new DefaultJmsListenerContainerFactory(); defaultJmsListenerContainerFactory.setConnectionFactory(activeMQConn...
56,518,068
This is for a homework problem, so I tried to work through it as much as I could before coming here for help. I've got it 95% solved, I just can't figure out the syntax of the last bit or what method I should be using if it's different from what I'm doing now. I can't find any solution to this online that isn't actuall...
2019/06/09
[ "https://Stackoverflow.com/questions/56518068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10559334/" ]
When you have just one element in the array, [Array#join](https://ruby-doc.org/core-2.6.3/Array.html#method-i-join) returns the element itself: ``` ['a'].join(' and ') #=> "a" ``` So, you could simplify your code prepending `"and "` to the last element when list size is 3 or more or returning `.join(' and ')` if les...
EDIT with max comments: You can do that: ``` def oxford_comma(array) array = [*array] case array.size when 0 '' when 1 array[0].to_s when 2 array.join(' and ') else array_copy = array array_copy[-1] = "and #{array_copy[-1]}" array_copy.join(', ') end end ``` The case when is to...
56,518,068
This is for a homework problem, so I tried to work through it as much as I could before coming here for help. I've got it 95% solved, I just can't figure out the syntax of the last bit or what method I should be using if it's different from what I'm doing now. I can't find any solution to this online that isn't actuall...
2019/06/09
[ "https://Stackoverflow.com/questions/56518068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10559334/" ]
When you have just one element in the array, [Array#join](https://ruby-doc.org/core-2.6.3/Array.html#method-i-join) returns the element itself: ``` ['a'].join(' and ') #=> "a" ``` So, you could simplify your code prepending `"and "` to the last element when list size is 3 or more or returning `.join(' and ')` if les...
For readability, I suggest a straightforward solution. ``` def oxford_comma(arr) case arr.size when 0 "" when 1 arr.first when 2 arr.join(' and ') else [arr[0..-2].join(', '), arr.last].join(', and ') end end ``` ``` oxford_comma ["blue", "green", "pink", "white"] #=> "blue, green, pink...
42,657,575
I have 3 images and each of them have a div after it. I am trying to adjust all the image's height to be the same as the height of the div after it. However, all the images are being given the height of the **first** div, not the one after it. I believe this is because when `$(".text").outerHeight()` is used, it alwa...
2017/03/07
[ "https://Stackoverflow.com/questions/42657575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5798798/" ]
I think you're on the right track. I would split on spaces to get all the words into an array. Then for-loop over the array and, where the index modulo 2 = 1 or 0 (depending on whether you want to alter even or odd words), use the char overload of replace .replace('x', 'y') to change your words. Then you just put the s...
If you want to replace every "A" with "Z" in a word, you can use this line: ``` s.Replace("A", "Z"); ``` If you have an array of strings, you can just iterate over the array, and replace A's with Z's for every string: ``` string[] array = ... for (int i = 0; i < array.Length; i++) array[i] = array[i].Replace("A...
2,492,674
Assume I have a set of weighted samples, where each samples has a corresponding weight between 0 and 1. I'd like to estimate the parameters of a gaussian mixture distribution that is biased towards the samples with higher weight. In the usual non-weighted case gaussian mixture estimation is done via the EM algorithm. ...
2010/03/22
[ "https://Stackoverflow.com/questions/2492674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292209/" ]
You can calculate a weighted log-Likelihood function; just multiply the every point with it's weight. Note that you need to use the log-Likelihood function for this. So your problem reduces to minimizing $-\ln L = \sum\_i w\_i \ln f(x\_i|q)$ (see [the Wikipedia article](http://en.wikipedia.org/wiki/Maximum_likelihood#...
Just a suggestion as no other answers are sent. You could use the normal EM with GMM (OpenCV for ex. has many wrappers for many languages) and put some points twice in the cluster you want to have "more weight". That way the EM would consider those points more important. You can remove the extra points later if it doe...
2,492,674
Assume I have a set of weighted samples, where each samples has a corresponding weight between 0 and 1. I'd like to estimate the parameters of a gaussian mixture distribution that is biased towards the samples with higher weight. In the usual non-weighted case gaussian mixture estimation is done via the EM algorithm. ...
2010/03/22
[ "https://Stackoverflow.com/questions/2492674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292209/" ]
I've just had the same problem. Even though the post is older, it might be interesting to someone else. honk's answer is in principle correct, it's just not immediate to see how it affects the implementation of the algorithm. From the Wikipedia article for [Expectation Maximization](http://en.wikipedia.org/wiki/Expecta...
Just a suggestion as no other answers are sent. You could use the normal EM with GMM (OpenCV for ex. has many wrappers for many languages) and put some points twice in the cluster you want to have "more weight". That way the EM would consider those points more important. You can remove the extra points later if it doe...
2,492,674
Assume I have a set of weighted samples, where each samples has a corresponding weight between 0 and 1. I'd like to estimate the parameters of a gaussian mixture distribution that is biased towards the samples with higher weight. In the usual non-weighted case gaussian mixture estimation is done via the EM algorithm. ...
2010/03/22
[ "https://Stackoverflow.com/questions/2492674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292209/" ]
You can calculate a weighted log-Likelihood function; just multiply the every point with it's weight. Note that you need to use the log-Likelihood function for this. So your problem reduces to minimizing $-\ln L = \sum\_i w\_i \ln f(x\_i|q)$ (see [the Wikipedia article](http://en.wikipedia.org/wiki/Maximum_likelihood#...
I was looking for a similar solution related to gaussian kernel estimation (instead of a gaussian mixture) of the distribution. The standard [gaussian\_kde](http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gaussian_kde.html#scipy.stats.gaussian_kde) does not allow that but I found a python implementatio...
2,492,674
Assume I have a set of weighted samples, where each samples has a corresponding weight between 0 and 1. I'd like to estimate the parameters of a gaussian mixture distribution that is biased towards the samples with higher weight. In the usual non-weighted case gaussian mixture estimation is done via the EM algorithm. ...
2010/03/22
[ "https://Stackoverflow.com/questions/2492674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292209/" ]
You can calculate a weighted log-Likelihood function; just multiply the every point with it's weight. Note that you need to use the log-Likelihood function for this. So your problem reduces to minimizing $-\ln L = \sum\_i w\_i \ln f(x\_i|q)$ (see [the Wikipedia article](http://en.wikipedia.org/wiki/Maximum_likelihood#...
I think this analysis can be possibly be done via the `pomegranate` (see [Pomegranate](https://pomegranate.readthedocs.io/en/latest/) docs page) that supports a weighted Gaussian Mixture Modeling. According to their doc: > > weights : array-like, shape (n\_samples,), optional > The initial weights of each sample in ...
2,492,674
Assume I have a set of weighted samples, where each samples has a corresponding weight between 0 and 1. I'd like to estimate the parameters of a gaussian mixture distribution that is biased towards the samples with higher weight. In the usual non-weighted case gaussian mixture estimation is done via the EM algorithm. ...
2010/03/22
[ "https://Stackoverflow.com/questions/2492674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292209/" ]
I've just had the same problem. Even though the post is older, it might be interesting to someone else. honk's answer is in principle correct, it's just not immediate to see how it affects the implementation of the algorithm. From the Wikipedia article for [Expectation Maximization](http://en.wikipedia.org/wiki/Expecta...
I was looking for a similar solution related to gaussian kernel estimation (instead of a gaussian mixture) of the distribution. The standard [gaussian\_kde](http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gaussian_kde.html#scipy.stats.gaussian_kde) does not allow that but I found a python implementatio...
2,492,674
Assume I have a set of weighted samples, where each samples has a corresponding weight between 0 and 1. I'd like to estimate the parameters of a gaussian mixture distribution that is biased towards the samples with higher weight. In the usual non-weighted case gaussian mixture estimation is done via the EM algorithm. ...
2010/03/22
[ "https://Stackoverflow.com/questions/2492674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292209/" ]
I've just had the same problem. Even though the post is older, it might be interesting to someone else. honk's answer is in principle correct, it's just not immediate to see how it affects the implementation of the algorithm. From the Wikipedia article for [Expectation Maximization](http://en.wikipedia.org/wiki/Expecta...
I think this analysis can be possibly be done via the `pomegranate` (see [Pomegranate](https://pomegranate.readthedocs.io/en/latest/) docs page) that supports a weighted Gaussian Mixture Modeling. According to their doc: > > weights : array-like, shape (n\_samples,), optional > The initial weights of each sample in ...
19,330,441
I have an array that I am looping through and pushing specific values to a separate array. EX: ``` first_array = ["Promoter: 8", "Passive: 7"] ``` I want to push every value that is an integer to a separate array, that would look like this in the end: ``` final_array = [8,7] ``` It would be nice for the values in...
2013/10/12
[ "https://Stackoverflow.com/questions/19330441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2665588/" ]
``` first_array.map{|a| a.match(/\d+/)}.compact.map{|a| a[0].to_i } ``` * Use a regex to grab the integers, * compact the blank spaces from the strings with no integers, and * convert them all to ints
If the integer part of each string in (which look like members of a hash) is always preceded by at least one space, and there is no other whitespace (other than possibly at the beginning of the string), you could do this: ``` first_array = ["Promoter: 8", "Passive: 7"] Hash[*first_array.map(&:split).flatten].values.ma...
19,330,441
I have an array that I am looping through and pushing specific values to a separate array. EX: ``` first_array = ["Promoter: 8", "Passive: 7"] ``` I want to push every value that is an integer to a separate array, that would look like this in the end: ``` final_array = [8,7] ``` It would be nice for the values in...
2013/10/12
[ "https://Stackoverflow.com/questions/19330441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2665588/" ]
``` first_array.map{|a| a.match(/\d+/)}.compact.map{|a| a[0].to_i } ``` * Use a regex to grab the integers, * compact the blank spaces from the strings with no integers, and * convert them all to ints
And I have to add this super short but complicated one-liner solution: ``` a = ["Promoter: 8", "Passive: 7"] p a.grep(/(\d+)/){$&.to_i} #=> [8,7] ```
19,330,441
I have an array that I am looping through and pushing specific values to a separate array. EX: ``` first_array = ["Promoter: 8", "Passive: 7"] ``` I want to push every value that is an integer to a separate array, that would look like this in the end: ``` final_array = [8,7] ``` It would be nice for the values in...
2013/10/12
[ "https://Stackoverflow.com/questions/19330441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2665588/" ]
``` first_array.map{|a| a.match(/\d+/)}.compact.map{|a| a[0].to_i } ``` * Use a regex to grab the integers, * compact the blank spaces from the strings with no integers, and * convert them all to ints
Your question, as formulated, has an easy practical answer, already provided by others. But it seems to me, that your array of strings ``` a = ["Promoter: 8", "Passive: 7"] ``` envies being a `Hash`. So, from broader perspective, I would take freedom of converting it to a Hash first: ``` require 'pyper' # (type "ge...
19,330,441
I have an array that I am looping through and pushing specific values to a separate array. EX: ``` first_array = ["Promoter: 8", "Passive: 7"] ``` I want to push every value that is an integer to a separate array, that would look like this in the end: ``` final_array = [8,7] ``` It would be nice for the values in...
2013/10/12
[ "https://Stackoverflow.com/questions/19330441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2665588/" ]
``` first_array.map{|s| s[/\d+/].to_i} # => [8, 7] ```
If the integer part of each string in (which look like members of a hash) is always preceded by at least one space, and there is no other whitespace (other than possibly at the beginning of the string), you could do this: ``` first_array = ["Promoter: 8", "Passive: 7"] Hash[*first_array.map(&:split).flatten].values.ma...
19,330,441
I have an array that I am looping through and pushing specific values to a separate array. EX: ``` first_array = ["Promoter: 8", "Passive: 7"] ``` I want to push every value that is an integer to a separate array, that would look like this in the end: ``` final_array = [8,7] ``` It would be nice for the values in...
2013/10/12
[ "https://Stackoverflow.com/questions/19330441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2665588/" ]
``` first_array.map{|s| s[/\d+/].to_i} # => [8, 7] ```
And I have to add this super short but complicated one-liner solution: ``` a = ["Promoter: 8", "Passive: 7"] p a.grep(/(\d+)/){$&.to_i} #=> [8,7] ```
19,330,441
I have an array that I am looping through and pushing specific values to a separate array. EX: ``` first_array = ["Promoter: 8", "Passive: 7"] ``` I want to push every value that is an integer to a separate array, that would look like this in the end: ``` final_array = [8,7] ``` It would be nice for the values in...
2013/10/12
[ "https://Stackoverflow.com/questions/19330441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2665588/" ]
``` first_array.map{|s| s[/\d+/].to_i} # => [8, 7] ```
Your question, as formulated, has an easy practical answer, already provided by others. But it seems to me, that your array of strings ``` a = ["Promoter: 8", "Passive: 7"] ``` envies being a `Hash`. So, from broader perspective, I would take freedom of converting it to a Hash first: ``` require 'pyper' # (type "ge...
19,330,441
I have an array that I am looping through and pushing specific values to a separate array. EX: ``` first_array = ["Promoter: 8", "Passive: 7"] ``` I want to push every value that is an integer to a separate array, that would look like this in the end: ``` final_array = [8,7] ``` It would be nice for the values in...
2013/10/12
[ "https://Stackoverflow.com/questions/19330441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2665588/" ]
And I have to add this super short but complicated one-liner solution: ``` a = ["Promoter: 8", "Passive: 7"] p a.grep(/(\d+)/){$&.to_i} #=> [8,7] ```
If the integer part of each string in (which look like members of a hash) is always preceded by at least one space, and there is no other whitespace (other than possibly at the beginning of the string), you could do this: ``` first_array = ["Promoter: 8", "Passive: 7"] Hash[*first_array.map(&:split).flatten].values.ma...
19,330,441
I have an array that I am looping through and pushing specific values to a separate array. EX: ``` first_array = ["Promoter: 8", "Passive: 7"] ``` I want to push every value that is an integer to a separate array, that would look like this in the end: ``` final_array = [8,7] ``` It would be nice for the values in...
2013/10/12
[ "https://Stackoverflow.com/questions/19330441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2665588/" ]
Your question, as formulated, has an easy practical answer, already provided by others. But it seems to me, that your array of strings ``` a = ["Promoter: 8", "Passive: 7"] ``` envies being a `Hash`. So, from broader perspective, I would take freedom of converting it to a Hash first: ``` require 'pyper' # (type "ge...
If the integer part of each string in (which look like members of a hash) is always preceded by at least one space, and there is no other whitespace (other than possibly at the beginning of the string), you could do this: ``` first_array = ["Promoter: 8", "Passive: 7"] Hash[*first_array.map(&:split).flatten].values.ma...
21,935,187
I receive date as string from web service in following format `2014-02-27T11:17:00.000Z` Could someone tell me how to parse it as Date time object in Java. I tried parsing it `Date.parse()` but it didn't work properly. Then I tried date formatter but it crashes the app. Could someone enlighten me please.
2014/02/21
[ "https://Stackoverflow.com/questions/21935187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3296042/" ]
``` SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); Date d = sdf.parse("2014-02-27T11:17:00.000Z"); ```
You can use dateformat class for that. ``` DateFormat sdt = new SimpleDateFormat(put your format here); Date stime= sdt.parse(starttime); Date etime = sdt.parse(endtime); ``` Starttime and end time are the strings which you want to parse
21,935,187
I receive date as string from web service in following format `2014-02-27T11:17:00.000Z` Could someone tell me how to parse it as Date time object in Java. I tried parsing it `Date.parse()` but it didn't work properly. Then I tried date formatter but it crashes the app. Could someone enlighten me please.
2014/02/21
[ "https://Stackoverflow.com/questions/21935187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3296042/" ]
``` SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); Date d = sdf.parse("2014-02-27T11:17:00.000Z"); ```
Declare a SimpleDateTimeFormat to match your datetime from C# and then use .parse() method on it to get the (Java) Date. Example: ``` private static final SimpleDateFormat FORMAT_FULL_DATE = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss'.000Z'"); // replace kk with hh for am/pm format public static Date getDateTimeFr...
47,997,549
The data in my table looks like this: ``` date, app, country, sales 2017-01-01,XYZ,US,10000 2017-01-01,XYZ,GB,2000 2017-01-02,XYZ,US,30000 2017-01-02,XYZ,GB,1000 ``` I need to find, for each app on a daily basis, the ratio of US sales to GB sales, so ideally the result would look like this: ``` date, app, ratio 20...
2017/12/27
[ "https://Stackoverflow.com/questions/47997549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/722950/" ]
You can use the ratio of SUM(CASE WHEN) and GROUP BY in your query to do this without requiring a subquery. ``` SELECT DATE, APP, SUM(CASE WHEN COUNTRY = 'US' THEN SALES ELSE 0 END) / SUM(CASE WHEN COUNTRY = 'GB' THEN SALES END) AS RATIO FROM TABLE1 GROUP BY DATE, APP; ``` Based on the lik...
You can use one query with grouping and provide the condition once: ``` SELECT date, app, SUM(CASE WHEN country = 'US' THEN SALES ELSE 0 END) / SUM(CASE WHEN country = 'GB' THEN SALES END) AS ratio WHERE date between '2017-01-01' AND '2017-01-10' FROM your_table GROUP BY date, app; ``` However, this gi...
47,997,549
The data in my table looks like this: ``` date, app, country, sales 2017-01-01,XYZ,US,10000 2017-01-01,XYZ,GB,2000 2017-01-02,XYZ,US,30000 2017-01-02,XYZ,GB,1000 ``` I need to find, for each app on a daily basis, the ratio of US sales to GB sales, so ideally the result would look like this: ``` date, app, ratio 20...
2017/12/27
[ "https://Stackoverflow.com/questions/47997549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/722950/" ]
You can use the ratio of SUM(CASE WHEN) and GROUP BY in your query to do this without requiring a subquery. ``` SELECT DATE, APP, SUM(CASE WHEN COUNTRY = 'US' THEN SALES ELSE 0 END) / SUM(CASE WHEN COUNTRY = 'GB' THEN SALES END) AS RATIO FROM TABLE1 GROUP BY DATE, APP; ``` Based on the lik...
``` DROP TABLE IF EXISTS t; CREATE TABLE t ( date DATE, app VARCHAR(5), country VARCHAR(5), sales DECIMAL(10,2) ); INSERT INTO t VALUES ('2017-01-01','XYZ','US',10000), ('2017-01-01','XYZ','GB',2000), ('2017-01-02','XYZ','US',30000), ('2017-01-02','XYZ','GB',1000); WITH q AS ( SELECT date, ...
41,506
There is a blind test that asks participants to distinguish Coke and Pepsi. A participant will test 6 cups of drink and tell whether it was Coke or Pepsi. Assuming that the participant can tell the difference between them, though not perfect, if he judged that the first three were all Coke, then he would think it is m...
2012/10/30
[ "https://stats.stackexchange.com/questions/41506", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/15997/" ]
I do think it is a study design problem and a famous one in that some think RA Fisher did not actually realize it in making his famous Lady tasting cups of tea example and one that haunts clinical trials who try to prevent any unblinding of treatment assignment in clinical trials. A solution suggested from what is do...
You could (truthfully) tell the participants that you will flip a coin each time you provide a soda and that the coin flip will determine P vs C. You can go on to explain to them, "If the last five were Coke (or Pepsi), Coke and Pepsi are equally likely on the next test." One problem is that some of your participants w...
6,493,630
I'm binding an ObservableCollection to a control which has a converter to change its visibility depending on if the collection has any values or not: Simplified example: **XAML:** ``` <Window.Resources> <local:MyConverter x:Key="converter"/> </Window.Resources> <Grid x:Name="grid"> <Rectangle Height="100" W...
2011/06/27
[ "https://Stackoverflow.com/questions/6493630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/128837/" ]
OK, so here's how I got around the problem using a `MultiValueConverter` The converter now looks like: ``` public object Convert( object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { ObservableCollection<string> strings = values[0] as Observab...
You must set the DataContext after creating the collection; it is probable that you initialize the "strings"collection to "null", you set the DataContext in the constructor to that value(e.g. null), then you actually create the collection--this way, the DataContext remains null. You must set the DataContext again afte...
6,493,630
I'm binding an ObservableCollection to a control which has a converter to change its visibility depending on if the collection has any values or not: Simplified example: **XAML:** ``` <Window.Resources> <local:MyConverter x:Key="converter"/> </Window.Resources> <Grid x:Name="grid"> <Rectangle Height="100" W...
2011/06/27
[ "https://Stackoverflow.com/questions/6493630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/128837/" ]
I think the converter in a Binding is always called if the Binding source has been updated and notifies about that update (as a DependencyProperty or using INotifyPropertyChanged). However, an ObservableCollection does not raise the PropertyChanged event if an item has been added or removed, but it raises the Collectio...
You must set the DataContext after creating the collection; it is probable that you initialize the "strings"collection to "null", you set the DataContext in the constructor to that value(e.g. null), then you actually create the collection--this way, the DataContext remains null. You must set the DataContext again afte...
6,493,630
I'm binding an ObservableCollection to a control which has a converter to change its visibility depending on if the collection has any values or not: Simplified example: **XAML:** ``` <Window.Resources> <local:MyConverter x:Key="converter"/> </Window.Resources> <Grid x:Name="grid"> <Rectangle Height="100" W...
2011/06/27
[ "https://Stackoverflow.com/questions/6493630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/128837/" ]
OK, so here's how I got around the problem using a `MultiValueConverter` The converter now looks like: ``` public object Convert( object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { ObservableCollection<string> strings = values[0] as Observab...
I think the converter in a Binding is always called if the Binding source has been updated and notifies about that update (as a DependencyProperty or using INotifyPropertyChanged). However, an ObservableCollection does not raise the PropertyChanged event if an item has been added or removed, but it raises the Collectio...
787,449
I have a modem+wireless router that my ISP gave that I use to connect to the internet as well as connect my IP TV box. I just bought a Time Capsule and I want to use it as the wireless access point. Unfortunately I am having difficulty getting the TC to connect to the internet. I have already turned off the wireless ...
2014/07/24
[ "https://superuser.com/questions/787449", "https://superuser.com", "https://superuser.com/users/59789/" ]
Well, as it turns out there IS a way to do this. Connect the TC to the ISP's router using an ethernet cable. This will cause the ISP's router to allocate an IP address for it. Go into your ISP router's settings and find the place where you can reserve an IP. It will probably ask you for the IP and MAC address. You can...
Put the time capsule in bridge mode: <https://discussions.apple.com/message/23393821> that turns off the 2nd router and let's your ISPs device perform router functions.
11,229,627
I have two divs: ``` <div class="dialog large"></div> ``` and ``` <div class="dialog"></div> ``` I have to remove the one with the class "dialog" but keep the one with "dialog large". If I do `$('dialog').remove();` they are both removed. Can anyone help me with this?
2012/06/27
[ "https://Stackoverflow.com/questions/11229627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310276/" ]
``` $('div.dialog:not(.large)').remove(); ``` **[DEMO](http://jsfiddle.net/QStkd/512/)** ### A little explain `div.dialog` will select `div` with `class=dialog` (in this case both div will select). But `div.dialog:not(.large)` will exclude those `div` with `class` `large` and remove them. ### Related Refs * **[:...
Use this: ``` $("div.dialog").not('.large').remove(); ``` [Fiddle](http://jsfiddle.net/v74V4/1/) here...
11,229,627
I have two divs: ``` <div class="dialog large"></div> ``` and ``` <div class="dialog"></div> ``` I have to remove the one with the class "dialog" but keep the one with "dialog large". If I do `$('dialog').remove();` they are both removed. Can anyone help me with this?
2012/06/27
[ "https://Stackoverflow.com/questions/11229627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310276/" ]
``` $('div.dialog:not(.large)').remove(); ``` **[DEMO](http://jsfiddle.net/QStkd/512/)** ### A little explain `div.dialog` will select `div` with `class=dialog` (in this case both div will select). But `div.dialog:not(.large)` will exclude those `div` with `class` `large` and remove them. ### Related Refs * **[:...
There are many many ways to do it. You could also use `filter()` as an alternative maybe suitable for other more complicated cases. ``` $('div.dialog').filter(function(){ return !$(this).is('.large') }) ```
11,229,627
I have two divs: ``` <div class="dialog large"></div> ``` and ``` <div class="dialog"></div> ``` I have to remove the one with the class "dialog" but keep the one with "dialog large". If I do `$('dialog').remove();` they are both removed. Can anyone help me with this?
2012/06/27
[ "https://Stackoverflow.com/questions/11229627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310276/" ]
``` $('div.dialog:not(.large)').remove(); ``` **[DEMO](http://jsfiddle.net/QStkd/512/)** ### A little explain `div.dialog` will select `div` with `class=dialog` (in this case both div will select). But `div.dialog:not(.large)` will exclude those `div` with `class` `large` and remove them. ### Related Refs * **[:...
if you want to remove DIVs where the class is exactly "dialog", try: ``` $('div[class="dialog"]').remove(); ```
18,711,025
i will try to make this as simple as possible. I have a working GUI with *SELECT, INSERT, DELETE and UPDATE* (**CRUD**) buttons and I am required to use a helper class and NOT just have the code running behind the buttons ect. But I have NO IDEA what so EVER on how to even start coding this. I don't understand how I ...
2013/09/10
[ "https://Stackoverflow.com/questions/18711025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2469932/" ]
``` $("#div-my-table").text("<table>"); $.each(data, function (i, item) { $("#div-my-table").append("<tr><td>" + item.EncoderName + "</td><td>" + item.EncoderStatus + "</td></tr>"); }); $("#div-my-table").append("</table>"); ``` `append` does not output the html directly like that. It appends ...
I think this is your problem ``` $("document").ready(function () { ``` remove quotes ``` $(document).ready(function () { ```
18,711,025
i will try to make this as simple as possible. I have a working GUI with *SELECT, INSERT, DELETE and UPDATE* (**CRUD**) buttons and I am required to use a helper class and NOT just have the code running behind the buttons ect. But I have NO IDEA what so EVER on how to even start coding this. I don't understand how I ...
2013/09/10
[ "https://Stackoverflow.com/questions/18711025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2469932/" ]
``` $("#div-my-table").text("<table>"); $.each(data, function (i, item) { $("#div-my-table").append("<tr><td>" + item.EncoderName + "</td><td>" + item.EncoderStatus + "</td></tr>"); }); $("#div-my-table").append("</table>"); ``` `append` does not output the html directly like that. It appends ...
The following section ``` $("#div-my-table").text("<table>"); $.each(data, function(i, item) { $("#div-my-table").append("<tr><td>" + item.EncoderName +"</td><td>" + item.EncoderStatus + "</td></tr>"); }); $("#div-my-table").append("</table>"); ``` should be something like: ``` var $table = $('<table></table>...
18,711,025
i will try to make this as simple as possible. I have a working GUI with *SELECT, INSERT, DELETE and UPDATE* (**CRUD**) buttons and I am required to use a helper class and NOT just have the code running behind the buttons ect. But I have NO IDEA what so EVER on how to even start coding this. I don't understand how I ...
2013/09/10
[ "https://Stackoverflow.com/questions/18711025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2469932/" ]
``` $("#div-my-table").text("<table>"); $.each(data, function (i, item) { $("#div-my-table").append("<tr><td>" + item.EncoderName + "</td><td>" + item.EncoderStatus + "</td></tr>"); }); $("#div-my-table").append("</table>"); ``` `append` does not output the html directly like that. It appends ...
We can Implement **Jquery Template** for easy rendering of JSON data.The usage is as follows 1.Download "**jquery.tmpl.min.js**" file and include in your page. 2.We are considering the table as our container.And the we will define the template need to to be inserted into the container. Example of Template: ``` ...
13,652,386
I have a table of statuses, each of which have a name attribute. Currently I can do: ``` FooStatus.find_by_name("bar") ``` And that's fine. But I'm wondering if I could do: ``` FooStatus.bar ``` So I have this approach: ``` class FooStatus < ActiveRecord::Base def self.method_missing(meth, *args, &block) i...
2012/11/30
[ "https://Stackoverflow.com/questions/13652386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/648538/" ]
I don't know if I'd recommend your approach... seems too magical to me and I worry about what happens when you have a status with a name of 'destroy' or some other method you might legitimately want to call (or that Rails' calls internally that you aren't aware of). But... instead of mucking with method missing, I thi...
Use a scope. ``` class FooStatus < ActiveRecord::Base scope :bar, where(:name => "bar") # etc end ``` Now, you can do `FooStatus.bar` which will return an ActiveRelation object. If you expect this to return a single instance, you could do `FooStatus.bar.first` or if many `FooStatus.bar.all`, or you could put th...
13,652,386
I have a table of statuses, each of which have a name attribute. Currently I can do: ``` FooStatus.find_by_name("bar") ``` And that's fine. But I'm wondering if I could do: ``` FooStatus.bar ``` So I have this approach: ``` class FooStatus < ActiveRecord::Base def self.method_missing(meth, *args, &block) i...
2012/11/30
[ "https://Stackoverflow.com/questions/13652386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/648538/" ]
I agree with Philip Hallstrom's suggestion. If you know allowed\_statuses when the class is built, then just loop through the list and define the methods explicitly: ``` %w(foo bar baz).each do |status| define_singleton_method(status) do where("name = ?", status.titleize).first end end ``` …or if you need th...
I don't know if I'd recommend your approach... seems too magical to me and I worry about what happens when you have a status with a name of 'destroy' or some other method you might legitimately want to call (or that Rails' calls internally that you aren't aware of). But... instead of mucking with method missing, I thi...
13,652,386
I have a table of statuses, each of which have a name attribute. Currently I can do: ``` FooStatus.find_by_name("bar") ``` And that's fine. But I'm wondering if I could do: ``` FooStatus.bar ``` So I have this approach: ``` class FooStatus < ActiveRecord::Base def self.method_missing(meth, *args, &block) i...
2012/11/30
[ "https://Stackoverflow.com/questions/13652386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/648538/" ]
I agree with Philip Hallstrom's suggestion. If you know allowed\_statuses when the class is built, then just loop through the list and define the methods explicitly: ``` %w(foo bar baz).each do |status| define_singleton_method(status) do where("name = ?", status.titleize).first end end ``` …or if you need th...
Use a scope. ``` class FooStatus < ActiveRecord::Base scope :bar, where(:name => "bar") # etc end ``` Now, you can do `FooStatus.bar` which will return an ActiveRelation object. If you expect this to return a single instance, you could do `FooStatus.bar.first` or if many `FooStatus.bar.all`, or you could put th...
191,981
Can a civilization be highly evolved as far as culture, ethics, societal norms, laws, language, literature and arts, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture? They have a culture-religion that is fully integrated with nature, and th...
2020/12/14
[ "https://worldbuilding.stackexchange.com/questions/191981", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/81238/" ]
**Maybe, if they can overcome population density issues.** The key way to develop all of those civilization issues is to have a very high density of people working together on shared ideas, without them needing to mine the landscape and so gaining greater technology as they get better at mining. As such, you need nat...
Yes, technology and advanced civilisation are not related. The most advanced civilisations may have no recognisable technology and be completely integrated with nature, working with it instead of against it, without war, crime, poverty or hatred. Other cultures will sneer at them as mere hippies, or decry the entire c...
191,981
Can a civilization be highly evolved as far as culture, ethics, societal norms, laws, language, literature and arts, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture? They have a culture-religion that is fully integrated with nature, and th...
2020/12/14
[ "https://worldbuilding.stackexchange.com/questions/191981", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/81238/" ]
Maybe in the sea ---------------- I think it is possible, with aquatic species. Ocean is different from land in all the ways that makes rise of sapience possible (hello dolphins), but limits severely what kind of technology they can use. There's no fire, no metals, so your species population density might reach those ...
> > Can a civilization be highly evolved as far as culture, ethics, societal norms, ***laws***, language, ***literature*** and ***arts***, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture? > > > I've added emphasis. How do you expect yo...
191,981
Can a civilization be highly evolved as far as culture, ethics, societal norms, laws, language, literature and arts, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture? They have a culture-religion that is fully integrated with nature, and th...
2020/12/14
[ "https://worldbuilding.stackexchange.com/questions/191981", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/81238/" ]
No, the other way round. ======================== Civilization is the inevitable consequence of technology. Specifically, the technology called "Literacy" As soon as a culture starts storing information for future generations, whether by actual Writing and Literacy or via very strict Oral Traditions, that culture sta...
**Maybe, if they can overcome population density issues.** The key way to develop all of those civilization issues is to have a very high density of people working together on shared ideas, without them needing to mine the landscape and so gaining greater technology as they get better at mining. As such, you need nat...
191,981
Can a civilization be highly evolved as far as culture, ethics, societal norms, laws, language, literature and arts, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture? They have a culture-religion that is fully integrated with nature, and th...
2020/12/14
[ "https://worldbuilding.stackexchange.com/questions/191981", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/81238/" ]
No -- They're both the result of population density exceeding a critical level. Both to cause and maintain. This goes back to [Gobekli Tepe](https://www.smithsonianmag.com/history/gobekli-tepe-the-worlds-first-temple-83613665/) and the stories that go with it. One of them being that it's the first place where populat...
Yes, technology and advanced civilisation are not related. The most advanced civilisations may have no recognisable technology and be completely integrated with nature, working with it instead of against it, without war, crime, poverty or hatred. Other cultures will sneer at them as mere hippies, or decry the entire c...
191,981
Can a civilization be highly evolved as far as culture, ethics, societal norms, laws, language, literature and arts, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture? They have a culture-religion that is fully integrated with nature, and th...
2020/12/14
[ "https://worldbuilding.stackexchange.com/questions/191981", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/81238/" ]
No, the other way round. ======================== Civilization is the inevitable consequence of technology. Specifically, the technology called "Literacy" As soon as a culture starts storing information for future generations, whether by actual Writing and Literacy or via very strict Oral Traditions, that culture sta...
Technology per se is a rather broad term. You can have civilization without certain technologies. The Mayas had a fairly developed civilization with respect to weapons, astronomy, religion, architecture and agriculture, all advanced to a quite good level. Despite that they never came out with the technology of a whee...
191,981
Can a civilization be highly evolved as far as culture, ethics, societal norms, laws, language, literature and arts, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture? They have a culture-religion that is fully integrated with nature, and th...
2020/12/14
[ "https://worldbuilding.stackexchange.com/questions/191981", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/81238/" ]
No, the other way round. ======================== Civilization is the inevitable consequence of technology. Specifically, the technology called "Literacy" As soon as a culture starts storing information for future generations, whether by actual Writing and Literacy or via very strict Oral Traditions, that culture sta...
Technology far predates Civilization (and construction and agriculture) ----------------------------------------------------------------------- Assuming a standard definition that nearly all scholars use for technology, it has existed since humans could first reasonably called humans, and probably even before that. Te...
191,981
Can a civilization be highly evolved as far as culture, ethics, societal norms, laws, language, literature and arts, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture? They have a culture-religion that is fully integrated with nature, and th...
2020/12/14
[ "https://worldbuilding.stackexchange.com/questions/191981", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/81238/" ]
### Maybe, in a magically-powered fantasy universe with inconsistent physics. In fantasy world where the laws of physics behave in an inconsistent fashion but there is sufficient amounts of magic to allow life to function despite that, it might be possible that a society doesn't develop much if any technology if it re...
in my opinion, i think its possible if we are not talking about human as the focus, but alien lifeform or other animals society, especially if they cant manipulate tools and depend on group work. for example ant and bee, at least from quick google they are considered as civilization with their society, and i think ant...
191,981
Can a civilization be highly evolved as far as culture, ethics, societal norms, laws, language, literature and arts, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture? They have a culture-religion that is fully integrated with nature, and th...
2020/12/14
[ "https://worldbuilding.stackexchange.com/questions/191981", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/81238/" ]
Technology is a *prerequisite* for civilization ----------------------------------------------- Civilization means cities. The word in fact [has a common root with city](https://www.etymonline.com/word/civil). To have a city requires a lot of assorted technologies. Building materials. Storage containers. Fire. One of ...
Maybe in the sea ---------------- I think it is possible, with aquatic species. Ocean is different from land in all the ways that makes rise of sapience possible (hello dolphins), but limits severely what kind of technology they can use. There's no fire, no metals, so your species population density might reach those ...