qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
25,261,647 | Is it possible to encrypt/decrypt data with AES without installing extra modules? I need to send/receive data from `C#`, which is encrypted with the `System.Security.Cryptography` reference.
**UPDATE**
I have tried to use PyAES, but that is too old. I updated some things to make that work, but it didn't.
I've also can... | 2014/08/12 | [
"https://Stackoverflow.com/questions/25261647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3902480/"
] | The available Cryptographic Services available in the Standard Library are [those](https://docs.python.org/3.4/library/crypto.html). As you can see `AES` is not listed, but is suggest to use [`pycrypto`](https://pypi.python.org/pypi/pycrypto) which is an *extra module*.
You just have to install it using *pip*, or *eas... | To add to @enrico.bacis' answer: AES is not implemented in the standard library. It is implemented in the PyCrypto library, which is stable and well tested. If you need AES, add PyCrypto as a dependency of your code.
While the AES primitives are, in theory, simple enough that you could write an implementation of them ... |
25,261,647 | Is it possible to encrypt/decrypt data with AES without installing extra modules? I need to send/receive data from `C#`, which is encrypted with the `System.Security.Cryptography` reference.
**UPDATE**
I have tried to use PyAES, but that is too old. I updated some things to make that work, but it didn't.
I've also can... | 2014/08/12 | [
"https://Stackoverflow.com/questions/25261647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3902480/"
] | I'm using [Cryptography](https://cryptography.io/en/latest/#) library.
>
> Cryptography is an actively developed library that provides
> cryptographic recipes and primitives. It supports Python 2.6-2.7,
> Python 3.3+ and PyPy.
>
>
>
[Here is an example](https://cryptography.io/en/latest/hazmat/primitives/symmet... | The available Cryptographic Services available in the Standard Library are [those](https://docs.python.org/3.4/library/crypto.html). As you can see `AES` is not listed, but is suggest to use [`pycrypto`](https://pypi.python.org/pypi/pycrypto) which is an *extra module*.
You just have to install it using *pip*, or *eas... |
25,261,647 | Is it possible to encrypt/decrypt data with AES without installing extra modules? I need to send/receive data from `C#`, which is encrypted with the `System.Security.Cryptography` reference.
**UPDATE**
I have tried to use PyAES, but that is too old. I updated some things to make that work, but it didn't.
I've also can... | 2014/08/12 | [
"https://Stackoverflow.com/questions/25261647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3902480/"
] | PYAES should work with any version of Python3.x. No need to modify the library.
Here is a complete working example for pyaes CTR mode for Python3.x
(<https://github.com/ricmoo/pyaes>)
```
import pyaes
# A 256 bit (32 byte) key
key = "This_key_for_demo_purposes_only!"
plaintext = "Text may be any length you wish, no ... | Python 3.6 with cryptography module
```
from cryptography.fernet import Fernet
key = Fernet.generate_key()
f = Fernet(key)
token = f.encrypt(b"my deep dark secret")
print(token)
f.decrypt(token)
``` |
25,261,647 | Is it possible to encrypt/decrypt data with AES without installing extra modules? I need to send/receive data from `C#`, which is encrypted with the `System.Security.Cryptography` reference.
**UPDATE**
I have tried to use PyAES, but that is too old. I updated some things to make that work, but it didn't.
I've also can... | 2014/08/12 | [
"https://Stackoverflow.com/questions/25261647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3902480/"
] | PYAES should work with any version of Python3.x. No need to modify the library.
Here is a complete working example for pyaes CTR mode for Python3.x
(<https://github.com/ricmoo/pyaes>)
```
import pyaes
# A 256 bit (32 byte) key
key = "This_key_for_demo_purposes_only!"
plaintext = "Text may be any length you wish, no ... | [Here is a self-contained implementation of AES compatible with Python 3](http://uthcode.googlecode.com/svn-history/r678/trunk/python/py3AES.py).
Example usage:
```
aesmodal = AESModeOfOperation()
key = [143,194,34,208,145,203,230,143,177,246,97,206,145,92,255,84]
iv = [103,35,148,239,76,213,47,118,255,222,123,176,1... |
25,261,647 | Is it possible to encrypt/decrypt data with AES without installing extra modules? I need to send/receive data from `C#`, which is encrypted with the `System.Security.Cryptography` reference.
**UPDATE**
I have tried to use PyAES, but that is too old. I updated some things to make that work, but it didn't.
I've also can... | 2014/08/12 | [
"https://Stackoverflow.com/questions/25261647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3902480/"
] | I'm using [Cryptography](https://cryptography.io/en/latest/#) library.
>
> Cryptography is an actively developed library that provides
> cryptographic recipes and primitives. It supports Python 2.6-2.7,
> Python 3.3+ and PyPy.
>
>
>
[Here is an example](https://cryptography.io/en/latest/hazmat/primitives/symmet... | To add to @enrico.bacis' answer: AES is not implemented in the standard library. It is implemented in the PyCrypto library, which is stable and well tested. If you need AES, add PyCrypto as a dependency of your code.
While the AES primitives are, in theory, simple enough that you could write an implementation of them ... |
17,572,519 | I am working on STM32l151rct6a by stm, I have stumbled upon these MACRO definitions
```
__CC_ARM, __ICCARM__, __GNUC__, __TASKING__
```
Does anyone know what they mean? | 2013/07/10 | [
"https://Stackoverflow.com/questions/17572519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1314467/"
] | These are different compilers for ARM processors, probably these macros are used to hide compiler-dependent stuff in code that's compilable by several compilers.
* `ICCARM` --> [IAR](https://wwwfiles.iar.com/arm/webic/doc/ewarm_developmentguide.enu.pdf) (there will also be a macro `__IAR_SYSTEMS_ICC__` that is set to ... | These are compiler specific MACROS and defined in compiler code.For example \_\_ICC is for IAR and \_\_GNU is for GNU compilers.There are some code given in BSP part for STM platform which have dependency on compilers. |
17,572,519 | I am working on STM32l151rct6a by stm, I have stumbled upon these MACRO definitions
```
__CC_ARM, __ICCARM__, __GNUC__, __TASKING__
```
Does anyone know what they mean? | 2013/07/10 | [
"https://Stackoverflow.com/questions/17572519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1314467/"
] | These are different compilers for ARM processors, probably these macros are used to hide compiler-dependent stuff in code that's compilable by several compilers.
* `ICCARM` --> [IAR](https://wwwfiles.iar.com/arm/webic/doc/ewarm_developmentguide.enu.pdf) (there will also be a macro `__IAR_SYSTEMS_ICC__` that is set to ... | They are macros for identifying the compiler being used to build the code.
A list of such macros, and others for identifying architecture and OS etc. can be found at <http://sourceforge.net/p/predef/wiki/Home/>. It does not however comprehensively cover many compilers from smaller embedded systems vendors (Tasking an... |
17,572,519 | I am working on STM32l151rct6a by stm, I have stumbled upon these MACRO definitions
```
__CC_ARM, __ICCARM__, __GNUC__, __TASKING__
```
Does anyone know what they mean? | 2013/07/10 | [
"https://Stackoverflow.com/questions/17572519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1314467/"
] | They are macros for identifying the compiler being used to build the code.
A list of such macros, and others for identifying architecture and OS etc. can be found at <http://sourceforge.net/p/predef/wiki/Home/>. It does not however comprehensively cover many compilers from smaller embedded systems vendors (Tasking an... | These are compiler specific MACROS and defined in compiler code.For example \_\_ICC is for IAR and \_\_GNU is for GNU compilers.There are some code given in BSP part for STM platform which have dependency on compilers. |
58,760,689 | I'm trying to upgrade AngularJS version from 1.3 to 1.7 in my project. As a part of the upgradation I have upgraded the existing libraries to the respective compatible versions for AngularJS 1.7. However, I'm getting the below error in the console from the angular.js file. Any idea where I might be going wrong?
>
> a... | 2019/11/08 | [
"https://Stackoverflow.com/questions/58760689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10204642/"
] | If you are using the latest version of AngularUI bootstrap, the code needs to inject `$uibModal` instead of `$modal`, as all bootstrap directives and services names are now prepended with the `$uib` prefix.
Same thing will happen with the `$modalInstance` dependency, which needs to be changed to `$uibModalInstance`.
... | Maybe here you have problem
```
systemInformationWarningsService.$inject = ['$rootScope', '$interval', 'ifesModal', 'api', 'platform.ifesSecurity'];
function systemInformationWarningsService($rootScope, $interval, ifesModal, api, ifesSecurity) {
```
You have add `platform.ifesSecurity` in `$inject` and `ifesSecurit... |
26,111,982 | is theres a workaround or any other ways to make this work on Sass 3.4 +
```css
@mixin icon ($name, $code) {
.#{$name}::before {
content: str-slice("\x",1,1) + $code;}
}
@include icon('test', 4556);
```
Code should output
>
> .test::before { content: "\4556"; }
>
>
>
But on 3.4+ the `\` slash is getting remo... | 2014/09/30 | [
"https://Stackoverflow.com/questions/26111982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3507442/"
] | You stumbled across a [currently-debated issue with escape characters in Sass](https://github.com/sass/sass/issues/659). It seems that, currently, Sass will either add too many characters, or winds up putting the unicode character into the output css.
### UPDATE:
```
@mixin icon ($name, $code) {
$withslash: "\"\\#{... | Alternatively, you can use a helper function to delete whitespace from a string:
```
@function nospaces($str) {
@while (str-index($str, ' ') != null) {
$index: str-index($str, ' ');
$str: "#{str-slice($str, 0, $index - 1)}#{str-slice($str, $index + 1)}";
}
@return $str;
}
```
Then the function would l... |
11,315,504 | I'm using Sphinx for code documentation and use several languages within the code, I would like to setup highlighting for all of that code. Sphinx briefly mentions a few of the languages it supports ([on this page](http://sphinx.pocoo.org/markup/code.html)), and then mentions that it uses [Pygments](http://pygments.org... | 2012/07/03 | [
"https://Stackoverflow.com/questions/11315504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/967504/"
] | As far as I can tell, the list is in the file `pygments/lexers/_mapping.py`, in the (autogenerated) dictionary `LEXERS`. In my copy, I see a line
```
'ObjectiveCLexer': ('pygments.lexers.compiled', 'Objective-C', ('objective-c', 'objectivec', 'obj-c', 'objc'), ('*.m',), ('text/x-objective-c',)),
```
I think this sho... | If you install pygments module. You can use this script to get a list of supported highlighters:
```
from pygments.lexers import get_all_lexers
lexers = get_all_lexers()
for lexer in lexers:
print "-\t" + lexer[0] + "\n"
print "\t-\t" + "\n\t-\t".join(lexer[1]) + "\n"
```
First indent level of outpu... |
11,315,504 | I'm using Sphinx for code documentation and use several languages within the code, I would like to setup highlighting for all of that code. Sphinx briefly mentions a few of the languages it supports ([on this page](http://sphinx.pocoo.org/markup/code.html)), and then mentions that it uses [Pygments](http://pygments.org... | 2012/07/03 | [
"https://Stackoverflow.com/questions/11315504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/967504/"
] | `pygmentize -L lexers` lists all supported lexers.
* <http://pygments.org/languages/>
* <http://pygments.org/docs/lexers/>
* <http://pygments.org/docs/cmdline/#getting-help> | If you install pygments module. You can use this script to get a list of supported highlighters:
```
from pygments.lexers import get_all_lexers
lexers = get_all_lexers()
for lexer in lexers:
print "-\t" + lexer[0] + "\n"
print "\t-\t" + "\n\t-\t".join(lexer[1]) + "\n"
```
First indent level of outpu... |
40,496,643 | I would like to know if there is any way to embed native java libraries in maven as dependency or something like that but from the internet not from local.
Like java.util or all that jdk provides.
Example of "pom.xml":
```
<dependency>
<groupId>jdk</groupId>
<artifactId>java.util.arraylist</artifactId>
... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40496643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7133814/"
] | All of the standard, built-in Java classes are available to your build already - you don't need to add them as dependencies.
If you have a jar (possibly home-built) that you need to use in your maven build as a dependency, you can add it to your local maven repository as an artefact and have your pom.xml depend upon i... | Think of Maven as an infrastructure that handles dependencies.
```
mvn install
```
Write to local Maven directory on your machine.
```
mvn deploy
```
Write to an external repository server, e.g. Nexus, so it can be shared with others. (Your local Maven must be configured to recognize this Nexus.)
See <https://ma... |
1,511,716 | I have the following linq query:
```
var files = (from d in new DirectoryInfo(@"c:\program files").GetDirectories()
where d.GetFiles().Count() > 10
where d.GetFiles().Count() < 100
select d
);
```
However, as you can see above, ... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1511716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33690/"
] | Use `let` to assign within the query, like this
```
var files = (from d in new DirectoryInfo(@"c:\program files").GetDirectories()
let f = d.GetFiles().Count()
where f > 10
where f < 100
select d
);
```
As Reed Copsey points out you can merge the two `where` clauses using `&&`.
Also, since `GetFiles` r... | Lambda expressions will not help here, but the let keyword may...
```
var files = from d in new DirectoryInfo(@"c:\program files").GetDirectories()
let c = d.GetFiles().Count()
where c > 10 && c < 100
select d;
``` |
1,511,716 | I have the following linq query:
```
var files = (from d in new DirectoryInfo(@"c:\program files").GetDirectories()
where d.GetFiles().Count() > 10
where d.GetFiles().Count() < 100
select d
);
```
However, as you can see above, ... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1511716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33690/"
] | Use `let` to assign within the query, like this
```
var files = (from d in new DirectoryInfo(@"c:\program files").GetDirectories()
let f = d.GetFiles().Count()
where f > 10
where f < 100
select d
);
```
As Reed Copsey points out you can merge the two `where` clauses using `&&`.
Also, since `GetFiles` r... | With lambda expressions it would look like this:
```
var files = new DirectoryInfo(@"c:\program files").GetDirectories().
Where(x => (x.GetFiles().Count() > 10) && (x.GetFiles().Count() < 100));
```
You also call the `GetFiles()` twice. The lambda expressions don't help solving it.
EDIT: Beside being ugly, it i... |
1,511,716 | I have the following linq query:
```
var files = (from d in new DirectoryInfo(@"c:\program files").GetDirectories()
where d.GetFiles().Count() > 10
where d.GetFiles().Count() < 100
select d
);
```
However, as you can see above, ... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1511716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33690/"
] | Use `let` to assign within the query, like this
```
var files = (from d in new DirectoryInfo(@"c:\program files").GetDirectories()
let f = d.GetFiles().Count()
where f > 10
where f < 100
select d
);
```
As Reed Copsey points out you can merge the two `where` clauses using `&&`.
Also, since `GetFiles` r... | The answer involving the "let" keyword is probably what you will want to use.
I am providing this alternate answer to show you how "=>" could be used to accomplish the same thing.
First, make sure you are `using System.Linq;`
```
var files = new DirectoryInfo(@"c:\program files").GetDirectories().Where(d =>
{
... |
1,511,716 | I have the following linq query:
```
var files = (from d in new DirectoryInfo(@"c:\program files").GetDirectories()
where d.GetFiles().Count() > 10
where d.GetFiles().Count() < 100
select d
);
```
However, as you can see above, ... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1511716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33690/"
] | Lambda expressions will not help here, but the let keyword may...
```
var files = from d in new DirectoryInfo(@"c:\program files").GetDirectories()
let c = d.GetFiles().Count()
where c > 10 && c < 100
select d;
``` | With lambda expressions it would look like this:
```
var files = new DirectoryInfo(@"c:\program files").GetDirectories().
Where(x => (x.GetFiles().Count() > 10) && (x.GetFiles().Count() < 100));
```
You also call the `GetFiles()` twice. The lambda expressions don't help solving it.
EDIT: Beside being ugly, it i... |
1,511,716 | I have the following linq query:
```
var files = (from d in new DirectoryInfo(@"c:\program files").GetDirectories()
where d.GetFiles().Count() > 10
where d.GetFiles().Count() < 100
select d
);
```
However, as you can see above, ... | 2009/10/02 | [
"https://Stackoverflow.com/questions/1511716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33690/"
] | Lambda expressions will not help here, but the let keyword may...
```
var files = from d in new DirectoryInfo(@"c:\program files").GetDirectories()
let c = d.GetFiles().Count()
where c > 10 && c < 100
select d;
``` | The answer involving the "let" keyword is probably what you will want to use.
I am providing this alternate answer to show you how "=>" could be used to accomplish the same thing.
First, make sure you are `using System.Linq;`
```
var files = new DirectoryInfo(@"c:\program files").GetDirectories().Where(d =>
{
... |
41,624,554 | Heroku and my production environment are not loading the jQuery JavaScript Library leading to the following "Failed to load resource: the server responded with a status of 404 (Not Found)".
All the research I have done point to a asset pipeline issues, but i have confirmed the assets are being precompiled localy and d... | 2017/01/12 | [
"https://Stackoverflow.com/questions/41624554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6317543/"
] | It's <http://www.embeddedjs.com/> thanks to [jade template tag bracket percentage definition](https://stackoverflow.com/questions/28256371/jade-template-tag-bracket-percentage-definition)
I originally missed this thread as stackoverflow doesn't recognize <% as a search term. Located the thread via searx. | Might be Twig, it's a templating engine for PHP.
It supports the <% %> syntax and has the number\_format() function
<http://twig.sensiolabs.org/> |
41,624,554 | Heroku and my production environment are not loading the jQuery JavaScript Library leading to the following "Failed to load resource: the server responded with a status of 404 (Not Found)".
All the research I have done point to a asset pipeline issues, but i have confirmed the assets are being precompiled localy and d... | 2017/01/12 | [
"https://Stackoverflow.com/questions/41624554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6317543/"
] | It's <http://www.embeddedjs.com/> thanks to [jade template tag bracket percentage definition](https://stackoverflow.com/questions/28256371/jade-template-tag-bracket-percentage-definition)
I originally missed this thread as stackoverflow doesn't recognize <% as a search term. Located the thread via searx. | Could be twig as mentioned above, is the common .erb syntax in ruby. |
13,590,447 | Can someone suggest what do I have to do with this message?
>
> CA1060 Move P/Invokes to NativeMethods class Because it is a P/Invoke
> method, 'UControl.InternetGetConnectedState(out int, int)' should be
> defined in a class named NativeMethods, SafeNativeMethods, or
> UnsafeNativeMethods. Mega. UControl.xaml.cs ... | 2012/11/27 | [
"https://Stackoverflow.com/questions/13590447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/196919/"
] | To get rid of the warning, just add your `P/Invoke` methods to one of the classes below (usually `NativeMethods`). If you are creating a reusable library, you should put these in either `UnsafeNativeMethods` or `SafeNativeMethods`.
---
The [msdn page](https://msdn.microsoft.com/library/ms182161.aspx) says
>
> To fi... | Oh!
I found an answer
<https://msdn.microsoft.com/library/ms182161.aspx>
```
using System;
using System.Runtime.InteropServices;
namespace DesignLibrary
{
// Violates rule: MovePInvokesToNativeMethodsClass.
internal class UnmanagedApi
{
[DllImport("kernel32.dll")]
... |
7,593,615 | // HANDLER
```
private static final String SCRIPT_CREATE_DATABASE = "create table " + MYDATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_CONTENT1 + " text not null);";
private static final String SCRIPT_CREATE_DATABASE2 = "create table " + MYDATABASE_TABLE2 + " (" + KEY_ID2 + " integer f... | 2011/09/29 | [
"https://Stackoverflow.com/questions/7593615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970474/"
] | To set up on Centos (do all installation as root)
Install pip Download <https://bootstrap.pypa.io/get-pip.py>
```
python get-pip.py
```
Installing selenium
If you have pip on your system, you can simply install or upgrade the Python bindings:
pip install -U selenium
Alternately, you can download the source distri... | requirements:
```
sudo apt-get install xvfb
pip install selenium
pip install PyVirtualDisplay
```
download chrome driver binary from below link and paste into drivers directory: <https://sites.google.com/a/chromium.org/chromedriver/downloads>
code:
```
from selenium import webdriver
from pyvirtualdisplay import Di... |
7,593,615 | // HANDLER
```
private static final String SCRIPT_CREATE_DATABASE = "create table " + MYDATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_CONTENT1 + " text not null);";
private static final String SCRIPT_CREATE_DATABASE2 = "create table " + MYDATABASE_TABLE2 + " (" + KEY_ID2 + " integer f... | 2011/09/29 | [
"https://Stackoverflow.com/questions/7593615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970474/"
] | To set up on Centos (do all installation as root)
Install pip Download <https://bootstrap.pypa.io/get-pip.py>
```
python get-pip.py
```
Installing selenium
If you have pip on your system, you can simply install or upgrade the Python bindings:
pip install -U selenium
Alternately, you can download the source distri... | You can import `Options` if you don't want to open a web browser.
```
from selenium import webdriver # for webdriver
from selenium.webdriver.support.ui import WebDriverWait # for implicit and explict waits
from selenium.webdriver.chrome.options import Options # for suppressing the browser
```
Then in the code:
... |
7,593,615 | // HANDLER
```
private static final String SCRIPT_CREATE_DATABASE = "create table " + MYDATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_CONTENT1 + " text not null);";
private static final String SCRIPT_CREATE_DATABASE2 = "create table " + MYDATABASE_TABLE2 + " (" + KEY_ID2 + " integer f... | 2011/09/29 | [
"https://Stackoverflow.com/questions/7593615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970474/"
] | Since PhantomJS has been deprecated, using headless versions of Firefox would be a viable option.
```
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_argument("--headless")
driver = webdriver.Firefox(options=options)
driver.get('https://www.google.... | requirements:
```
sudo apt-get install xvfb
pip install selenium
pip install PyVirtualDisplay
```
download chrome driver binary from below link and paste into drivers directory: <https://sites.google.com/a/chromium.org/chromedriver/downloads>
code:
```
from selenium import webdriver
from pyvirtualdisplay import Di... |
7,593,615 | // HANDLER
```
private static final String SCRIPT_CREATE_DATABASE = "create table " + MYDATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_CONTENT1 + " text not null);";
private static final String SCRIPT_CREATE_DATABASE2 = "create table " + MYDATABASE_TABLE2 + " (" + KEY_ID2 + " integer f... | 2011/09/29 | [
"https://Stackoverflow.com/questions/7593615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970474/"
] | You can run Selenium headless, take a look at this question/answer: [Is it possible to hide the browser in Selenium RC?](https://stackoverflow.com/questions/1418082/selenium-can-i-hide-the-browser)
Especially for performance load tests, you should have a look at
[Apache JMeter](http://jakarta.apache.org/jmeter). | requirements:
```
sudo apt-get install xvfb
pip install selenium
pip install PyVirtualDisplay
```
download chrome driver binary from below link and paste into drivers directory: <https://sites.google.com/a/chromium.org/chromedriver/downloads>
code:
```
from selenium import webdriver
from pyvirtualdisplay import Di... |
7,593,615 | // HANDLER
```
private static final String SCRIPT_CREATE_DATABASE = "create table " + MYDATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_CONTENT1 + " text not null);";
private static final String SCRIPT_CREATE_DATABASE2 = "create table " + MYDATABASE_TABLE2 + " (" + KEY_ID2 + " integer f... | 2011/09/29 | [
"https://Stackoverflow.com/questions/7593615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970474/"
] | To set up on Centos (do all installation as root)
Install pip Download <https://bootstrap.pypa.io/get-pip.py>
```
python get-pip.py
```
Installing selenium
If you have pip on your system, you can simply install or upgrade the Python bindings:
pip install -U selenium
Alternately, you can download the source distri... | Since PhantomJS has been deprecated, using headless versions of Firefox would be a viable option.
```
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_argument("--headless")
driver = webdriver.Firefox(options=options)
driver.get('https://www.google.... |
7,593,615 | // HANDLER
```
private static final String SCRIPT_CREATE_DATABASE = "create table " + MYDATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_CONTENT1 + " text not null);";
private static final String SCRIPT_CREATE_DATABASE2 = "create table " + MYDATABASE_TABLE2 + " (" + KEY_ID2 + " integer f... | 2011/09/29 | [
"https://Stackoverflow.com/questions/7593615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970474/"
] | You can import `Options` if you don't want to open a web browser.
```
from selenium import webdriver # for webdriver
from selenium.webdriver.support.ui import WebDriverWait # for implicit and explict waits
from selenium.webdriver.chrome.options import Options # for suppressing the browser
```
Then in the code:
... | requirements:
```
sudo apt-get install xvfb
pip install selenium
pip install PyVirtualDisplay
```
download chrome driver binary from below link and paste into drivers directory: <https://sites.google.com/a/chromium.org/chromedriver/downloads>
code:
```
from selenium import webdriver
from pyvirtualdisplay import Di... |
7,593,615 | // HANDLER
```
private static final String SCRIPT_CREATE_DATABASE = "create table " + MYDATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_CONTENT1 + " text not null);";
private static final String SCRIPT_CREATE_DATABASE2 = "create table " + MYDATABASE_TABLE2 + " (" + KEY_ID2 + " integer f... | 2011/09/29 | [
"https://Stackoverflow.com/questions/7593615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970474/"
] | You can run Selenium headless, take a look at this question/answer: [Is it possible to hide the browser in Selenium RC?](https://stackoverflow.com/questions/1418082/selenium-can-i-hide-the-browser)
Especially for performance load tests, you should have a look at
[Apache JMeter](http://jakarta.apache.org/jmeter). | You can import `Options` if you don't want to open a web browser.
```
from selenium import webdriver # for webdriver
from selenium.webdriver.support.ui import WebDriverWait # for implicit and explict waits
from selenium.webdriver.chrome.options import Options # for suppressing the browser
```
Then in the code:
... |
7,593,615 | // HANDLER
```
private static final String SCRIPT_CREATE_DATABASE = "create table " + MYDATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_CONTENT1 + " text not null);";
private static final String SCRIPT_CREATE_DATABASE2 = "create table " + MYDATABASE_TABLE2 + " (" + KEY_ID2 + " integer f... | 2011/09/29 | [
"https://Stackoverflow.com/questions/7593615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970474/"
] | Try this code:
```
op = webdriver.ChromeOptions()
op.add_argument('headless')
driver = webdriver.Chrome(options=op)
``` | Always follow the Documentation. Here is what [selenium doc](http://selenium-python.readthedocs.io/getting-started.html#using-selenium-with-remote-webdriver) says. It provide a [standalone jar](http://selenium-release.storage.googleapis.com/3.7/selenium-server-stand%20alone-3.7.1.jar).
* Download the standalone jar. ... |
7,593,615 | // HANDLER
```
private static final String SCRIPT_CREATE_DATABASE = "create table " + MYDATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_CONTENT1 + " text not null);";
private static final String SCRIPT_CREATE_DATABASE2 = "create table " + MYDATABASE_TABLE2 + " (" + KEY_ID2 + " integer f... | 2011/09/29 | [
"https://Stackoverflow.com/questions/7593615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970474/"
] | It is possible, but not with the standard firefox driver / chrome / etc.
You would need to install PhantomJS. Just assign your WebDriver to an instance of phantomJS driver:
```
driver = webdriver.PhantomJS()
```
If you run your code now, no browser window will be opened. | requirements:
```
sudo apt-get install xvfb
pip install selenium
pip install PyVirtualDisplay
```
download chrome driver binary from below link and paste into drivers directory: <https://sites.google.com/a/chromium.org/chromedriver/downloads>
code:
```
from selenium import webdriver
from pyvirtualdisplay import Di... |
7,593,615 | // HANDLER
```
private static final String SCRIPT_CREATE_DATABASE = "create table " + MYDATABASE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_CONTENT1 + " text not null);";
private static final String SCRIPT_CREATE_DATABASE2 = "create table " + MYDATABASE_TABLE2 + " (" + KEY_ID2 + " integer f... | 2011/09/29 | [
"https://Stackoverflow.com/questions/7593615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970474/"
] | Chrome now has a headless mode:
```
op = webdriver.ChromeOptions()
op.add_argument('headless')
driver = webdriver.Chrome(options=op)
``` | To set up on Centos (do all installation as root)
Install pip Download <https://bootstrap.pypa.io/get-pip.py>
```
python get-pip.py
```
Installing selenium
If you have pip on your system, you can simply install or upgrade the Python bindings:
pip install -U selenium
Alternately, you can download the source distri... |
35,916,511 | I'm currently working on a project for college but i'm having issues with it. I have two pages with a form on each which includes three text fields (des,act,date) I'm trying to make it so that it will add to the text document the information from the forms but at the minute all it is doing is overwriting it. Anyone kno... | 2016/03/10 | [
"https://Stackoverflow.com/questions/35916511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6044749/"
] | [fopen()](http://php.net/manual/en/function.fopen.php) with a mode of `'w'`
>
> Open for writing only; **place the file pointer at the beginning of the file and truncate the file to zero length**. If the file does not exist, attempt to create it.
>
>
>
fopen() with a mode of `'a'`
>
> Open for writing only; pl... | Use `file_put_contents` function with `FILE_APPEND` flag.
>
> This function is identical to calling fopen(), fwrite() and fclose()
> successively to write data to a file.
>
>
> **FILE\_APPEND** : If file filename already exists, append the data to the file instead of overwriting it.
>
>
>
```
...
if... |
35,916,511 | I'm currently working on a project for college but i'm having issues with it. I have two pages with a form on each which includes three text fields (des,act,date) I'm trying to make it so that it will add to the text document the information from the forms but at the minute all it is doing is overwriting it. Anyone kno... | 2016/03/10 | [
"https://Stackoverflow.com/questions/35916511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6044749/"
] | [fopen()](http://php.net/manual/en/function.fopen.php) with a mode of `'w'`
>
> Open for writing only; **place the file pointer at the beginning of the file and truncate the file to zero length**. If the file does not exist, attempt to create it.
>
>
>
fopen() with a mode of `'a'`
>
> Open for writing only; pl... | Use file\_put\_content
```
if (isset($_POST['submit'])) {
file_put_contents("Observation.txt", $content, FILE_APPEND);
... your code here
}
```
Here third parameter in file\_put\_content "FILE\_APPEND" will append your file every time with new content in your previous code it was overwrite one content with another ... |
35,916,511 | I'm currently working on a project for college but i'm having issues with it. I have two pages with a form on each which includes three text fields (des,act,date) I'm trying to make it so that it will add to the text document the information from the forms but at the minute all it is doing is overwriting it. Anyone kno... | 2016/03/10 | [
"https://Stackoverflow.com/questions/35916511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6044749/"
] | Use `file_put_contents` function with `FILE_APPEND` flag.
>
> This function is identical to calling fopen(), fwrite() and fclose()
> successively to write data to a file.
>
>
> **FILE\_APPEND** : If file filename already exists, append the data to the file instead of overwriting it.
>
>
>
```
...
if... | Use file\_put\_content
```
if (isset($_POST['submit'])) {
file_put_contents("Observation.txt", $content, FILE_APPEND);
... your code here
}
```
Here third parameter in file\_put\_content "FILE\_APPEND" will append your file every time with new content in your previous code it was overwrite one content with another ... |
28,036,820 | In legacy ASP.Net and .Net in general, sending mail was accomplished via `System.Net.Mail` classes which resided in `System.dll`. Now with KRE, vNext doesn't seem to have `System.Net.Mail` as a separate package.
Referencing the `"net453"` framework in `project.json`
```
"frameworks": {
"aspnet50": { },
"aspne... | 2015/01/20 | [
"https://Stackoverflow.com/questions/28036820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/244353/"
] | To use `System.Net.Mail` your app can target only `aspnet50`. The `aspnetcore50` target has no such support (at least, not right now, as far as I know).
You shouldn't ever have your app target `net453` (which, as Luca mentioned in a comment, has since been renamed anyway) because ASP.NET 5 apps don't run on that platf... | To follow up... .NET team has stated that porting System.Net.Mail will be less than straightforward and will likely take a while. That's a bummer since a production website usually does more than a little email sending.
In the meantime, someone just released a Core-Clr compatible email API called MailKit. You can read... |
60,386,944 | I just start learning about adding items in set (Python), but then I don't understand why this happens
```
thisset = {"apple", "banana", "cherry"}
thisset.update("durian", "mango", "orange")
print(thisset)
```
and I get the output like this:
```
{'i', 'o', 'r', 'm', 'cherry', 'n', 'u', 'a', 'apple', 'banana', 'd'... | 2020/02/25 | [
"https://Stackoverflow.com/questions/60386944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12213279/"
] | According to the reference, `set.update(*others)` will update the set, adding elements from all others, what it does is `set |= other | ...`. So in your case, what `thisset.update("durian", "mango", "orange")` does is `thisset |= set("marian") | set("mango") | set("orange")`. To accomplish what you want, you need to pa... | You need to put curly braces inside `update`:
```
>>> thisset = {"apple", "banana", "cherry"}
>>> thisset.update({"durian", "mango", "orange"})
>>> thisset
{'orange', 'banana', 'mango', 'apple', 'cherry', 'durian'}
>>>
``` |
31,189,098 | I am trying to access the custom annotation values from jointCut. But I couldn't find a way.
My sample code :
```
@ComponentValidation(input1="input1", typeOfRule="validation", logger=Log.EXCEPTION)
public boolean validator(Map<String,String> mapStr) {
//blah blah
}
```
Trying to access `@Aspect` class.
But, i... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31189098",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/399426/"
] | While the answer by *Jama Asatillayev* is correct from a plain Java perspective, it involves reflection.
But the question was specifically about Spring AOP or AspectJ, and there is a much simpler and more canonical way to bind matched annotations to aspect advice parameters with AspectJ syntax - without any reflection... | For getting values, use below:
```
ComponentValidation validation = methodSignature.getMethod().getAnnotation(ComponentValidation.class);
```
you can call `validation.getInput1()`, assuming you have this method in `ComponentValidation` custom annotation. |
31,189,098 | I am trying to access the custom annotation values from jointCut. But I couldn't find a way.
My sample code :
```
@ComponentValidation(input1="input1", typeOfRule="validation", logger=Log.EXCEPTION)
public boolean validator(Map<String,String> mapStr) {
//blah blah
}
```
Trying to access `@Aspect` class.
But, i... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31189098",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/399426/"
] | While the answer by *Jama Asatillayev* is correct from a plain Java perspective, it involves reflection.
But the question was specifically about Spring AOP or AspectJ, and there is a much simpler and more canonical way to bind matched annotations to aspect advice parameters with AspectJ syntax - without any reflection... | For example if you have defined a method in Annotation interface like below :
```
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface AspectParameter {
String passArgument() default "";
}
```
then you can access the class and the method va... |
33,218,509 | I have strings that I need to remove the trailing characters from. There are several types, here are some examples:
"82.882ft"
"101in"
"15.993ft³"
"10.221mm"
Etc. I need to remove the length delimiters so I will be left with strings:
"82.882"
"101"
"15.993"
"10.221"
Ideas? | 2015/10/19 | [
"https://Stackoverflow.com/questions/33218509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3482896/"
] | Try using a replaceAll on the string, specifying all characters that are not a decimal point or number:
```
myString = myString.replaceAll("[^0-9\\.]","");
```
"^0-9\." means all characters that are not a number 0 through 9, or a decimal. The reason why we put two slashes are to escape the period, as it has a differ... | Just use regex:
```
String result = input.replaceAll("[^0-9.]", "");
``` |
33,218,509 | I have strings that I need to remove the trailing characters from. There are several types, here are some examples:
"82.882ft"
"101in"
"15.993ft³"
"10.221mm"
Etc. I need to remove the length delimiters so I will be left with strings:
"82.882"
"101"
"15.993"
"10.221"
Ideas? | 2015/10/19 | [
"https://Stackoverflow.com/questions/33218509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3482896/"
] | Just use regex:
```
String result = input.replaceAll("[^0-9.]", "");
``` | Regular Expressions probably works best for this.
```
Pattern lp = Pattern.compile("([\\d.]+)(.*)");
// Optional cleanup using Apache Commons StringUtils
currentInput = StringUtils.upperCase(
StringUtils.deleteWhitespace(currentInput));
Matcher lpm = lp.matcher(currentInput);
if( lpm.... |
33,218,509 | I have strings that I need to remove the trailing characters from. There are several types, here are some examples:
"82.882ft"
"101in"
"15.993ft³"
"10.221mm"
Etc. I need to remove the length delimiters so I will be left with strings:
"82.882"
"101"
"15.993"
"10.221"
Ideas? | 2015/10/19 | [
"https://Stackoverflow.com/questions/33218509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3482896/"
] | Try using a replaceAll on the string, specifying all characters that are not a decimal point or number:
```
myString = myString.replaceAll("[^0-9\\.]","");
```
"^0-9\." means all characters that are not a number 0 through 9, or a decimal. The reason why we put two slashes are to escape the period, as it has a differ... | Regular Expressions probably works best for this.
```
Pattern lp = Pattern.compile("([\\d.]+)(.*)");
// Optional cleanup using Apache Commons StringUtils
currentInput = StringUtils.upperCase(
StringUtils.deleteWhitespace(currentInput));
Matcher lpm = lp.matcher(currentInput);
if( lpm.... |
36,380,157 | I have two seperated machines
1. Ubuntu Server 12.04 maven Instaled (Apache Maven 3.0.4)
2. Windows Server 2008 R2 nexus installed (Nexus Repository Manager OSS 2.12.0-01)
I create a simple java project with maven and i'm unable to deploy it on remote nexus repository.
MY pom.xml :
```
<project xmlns="http://mav... | 2016/04/03 | [
"https://Stackoverflow.com/questions/36380157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1358417/"
] | The brackets are documentation notation indicating that those parameters are optional, and can be omitted from any given invocation.
They are not indicative of syntax you should be using in your program.
Both of these styles should work, given that documentation. The callback being optional.
```
makeOffer({ ... });
... | ~~`makeOffer(accessToken[, itemsFromThem])` is not JavaScript syntax. It's just common notation that's used to indicate that the function can take any number of arguments, like so:~~
```
makeOffer(accessToken, something, somethingElse);
makeOffer(accessToken, something, secondThing, thirdThing);
makeOffer(accessToken)... |
36,380,157 | I have two seperated machines
1. Ubuntu Server 12.04 maven Instaled (Apache Maven 3.0.4)
2. Windows Server 2008 R2 nexus installed (Nexus Repository Manager OSS 2.12.0-01)
I create a simple java project with maven and i'm unable to deploy it on remote nexus repository.
MY pom.xml :
```
<project xmlns="http://mav... | 2016/04/03 | [
"https://Stackoverflow.com/questions/36380157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1358417/"
] | The brackets are documentation notation indicating that those parameters are optional, and can be omitted from any given invocation.
They are not indicative of syntax you should be using in your program.
Both of these styles should work, given that documentation. The callback being optional.
```
makeOffer({ ... });
... | I don't have full code of what You've done.
But I'll give necessary part of it.
Look here:
```
var SteamTradeOffers = require('steam-tradeoffers');
var offers = new SteamTradeOffers();
// look at api, it needs 2 arguments
// 1. offer object, that consist of params like this:
var offer = {
partnerAccountId: 'stea... |
36,380,157 | I have two seperated machines
1. Ubuntu Server 12.04 maven Instaled (Apache Maven 3.0.4)
2. Windows Server 2008 R2 nexus installed (Nexus Repository Manager OSS 2.12.0-01)
I create a simple java project with maven and i'm unable to deploy it on remote nexus repository.
MY pom.xml :
```
<project xmlns="http://mav... | 2016/04/03 | [
"https://Stackoverflow.com/questions/36380157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1358417/"
] | ~~`makeOffer(accessToken[, itemsFromThem])` is not JavaScript syntax. It's just common notation that's used to indicate that the function can take any number of arguments, like so:~~
```
makeOffer(accessToken, something, somethingElse);
makeOffer(accessToken, something, secondThing, thirdThing);
makeOffer(accessToken)... | I don't have full code of what You've done.
But I'll give necessary part of it.
Look here:
```
var SteamTradeOffers = require('steam-tradeoffers');
var offers = new SteamTradeOffers();
// look at api, it needs 2 arguments
// 1. offer object, that consist of params like this:
var offer = {
partnerAccountId: 'stea... |
3,293,134 | I hear that Visual Studio 2010 has "Multi-Monitor Support". Yet now that I am using it, I see no difference from VS2008.
I still have to resize all my windows when switching from one monitor to two and back again.
Is there somekind of Profile or setting I am missing? For example, Delphi lets you save desktop profiles... | 2010/07/20 | [
"https://Stackoverflow.com/questions/3293134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16241/"
] | Multi-monitor support refers to the ability for you to undock a code window and drag it to another monitor. Try dragging on the tab of a code window into your other monitor.
ScottGu has an excellent blog post on this subject
* <http://weblogs.asp.net/scottgu/archive/2009/08/31/multi-monitor-support-vs-2010-and-net-4... | Just drag the editor tabs out and onto your other monitor and witness the glory. |
3,293,134 | I hear that Visual Studio 2010 has "Multi-Monitor Support". Yet now that I am using it, I see no difference from VS2008.
I still have to resize all my windows when switching from one monitor to two and back again.
Is there somekind of Profile or setting I am missing? For example, Delphi lets you save desktop profiles... | 2010/07/20 | [
"https://Stackoverflow.com/questions/3293134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16241/"
] | Just drag the editor tabs out and onto your other monitor and witness the glory. | In VS2008 you could detach things like the solution explorer and put them onto a different monitor, but source code pages were forced to stay on one monitor. |
3,293,134 | I hear that Visual Studio 2010 has "Multi-Monitor Support". Yet now that I am using it, I see no difference from VS2008.
I still have to resize all my windows when switching from one monitor to two and back again.
Is there somekind of Profile or setting I am missing? For example, Delphi lets you save desktop profiles... | 2010/07/20 | [
"https://Stackoverflow.com/questions/3293134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16241/"
] | Multi-monitor support refers to the ability for you to undock a code window and drag it to another monitor. Try dragging on the tab of a code window into your other monitor.
ScottGu has an excellent blog post on this subject
* <http://weblogs.asp.net/scottgu/archive/2009/08/31/multi-monitor-support-vs-2010-and-net-4... | In VS2008 you could detach things like the solution explorer and put them onto a different monitor, but source code pages were forced to stay on one monitor. |
36,635,298 | My problem is this, in the app when a user clicks somewhere not important an alertView is raised that's ok, I can find the call to that view, but then is showing again and again empty and I have placed breakpoint everywhere I see a call to any alert. But the ghost alert is not breaking anywhere I have no idea who is th... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36635298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1423656/"
] | For testing only:
Subclass `UIAlertView` i.e. `@interface MyAlertView : UIAlertView`
Then replace all instances of `UIAlertView` from `MyAlertView`
i.e. `MyAlertView *someAlert = [[MyAlertView alloc] init.......];`
Then override
```
-(void)show {
[super show];
//Your breakpoint here
OR
NSLog([NSThread callSta... | Check your viewcontroller that has an uialertviewdelegate.
1. Log your alertview.delegate
2. Check your super class of a viewcontroller that it doesn't call uialertviewdelegate function.
3. If it is an UIAlertController, check viewwillappear, viewdidappear, viewwilldisappear (super class too) and find out they don't c... |
36,635,298 | My problem is this, in the app when a user clicks somewhere not important an alertView is raised that's ok, I can find the call to that view, but then is showing again and again empty and I have placed breakpoint everywhere I see a call to any alert. But the ghost alert is not breaking anywhere I have no idea who is th... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36635298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1423656/"
] | For testing only:
Subclass `UIAlertView` i.e. `@interface MyAlertView : UIAlertView`
Then replace all instances of `UIAlertView` from `MyAlertView`
i.e. `MyAlertView *someAlert = [[MyAlertView alloc] init.......];`
Then override
```
-(void)show {
[super show];
//Your breakpoint here
OR
NSLog([NSThread callSta... | You can catch the content of your AlertView, if it has no content at all, don't present it!
To do this check the message you are passing to the method that presents the alertView.
However, I can't seem to find your method `showAreYouReadyToSubmitFormMsg`. |
36,635,298 | My problem is this, in the app when a user clicks somewhere not important an alertView is raised that's ok, I can find the call to that view, but then is showing again and again empty and I have placed breakpoint everywhere I see a call to any alert. But the ghost alert is not breaking anywhere I have no idea who is th... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36635298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1423656/"
] | For testing only:
Subclass `UIAlertView` i.e. `@interface MyAlertView : UIAlertView`
Then replace all instances of `UIAlertView` from `MyAlertView`
i.e. `MyAlertView *someAlert = [[MyAlertView alloc] init.......];`
Then override
```
-(void)show {
[super show];
//Your breakpoint here
OR
NSLog([NSThread callSta... | Why you take enum for alertview ? just make instance of `UIAlertView` where it require's to show. you can make one method in which you can pass two string parameters alertview massage and title and method shows alertview with this title and massage. |
14,573,466 | I am trying to write a balancer tool for Hbase which could balance regions across regionServers for a table by region count and/or region size (sum of storeFile sizes). I could not find any Hbase API class which returns the regions size or related info. I have already checked a few of the classes which could be used to... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14573466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1231731/"
] | I use this to do managed splits of regions, but, you could leverage it to load-balance on your own. I also load-balance myself to spread the regions ( of a given table ) evenly across our nodes so that MR jobs are evenly distributed.
Perhaps the code-snippet below is useful?
```
final HBaseAdmin admin = new HBaseAdmi... | What's wrong with the default [Load Balancer](http://hbase.apache.org/book/master.html#master.processes.loadbalancer)?
From the Wiki:
*The balancer is a periodic operation which is run on the master to redistribute regions on the cluster. It is configured via `hbase.balancer.period` and defaults to 300000 (5 minutes... |
6,505,067 | I have a code like that:
```
$('#lol').css({ position: "absolute",
marginLeft: 0, marginTop: 0,
top: 0, left: 0});
```
The problem is that my div is positioned relatively, so it is point 0 of a div rather than the entire window. Why is that? | 2011/06/28 | [
"https://Stackoverflow.com/questions/6505067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295815/"
] | >
> Why is that?
>
>
>
If you want to use `position: absolute` relatively to the entire window, you need to make sure that your `#lol` has no parent elements also positioned `absolute`, `fixed`, or `relative`.
Otherwise, any positioning you specify will take place relative to them. | That's just how positioning works. If you have any parent elements with any position specified the absolute positioning will happen relative to them.
If you want it to the window but can't do away with any of the other elements' positioning you'll need to remove the item from regular page flow either manually or with ... |
6,505,067 | I have a code like that:
```
$('#lol').css({ position: "absolute",
marginLeft: 0, marginTop: 0,
top: 0, left: 0});
```
The problem is that my div is positioned relatively, so it is point 0 of a div rather than the entire window. Why is that? | 2011/06/28 | [
"https://Stackoverflow.com/questions/6505067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295815/"
] | As pointed out in the other answers, at least one of the parent element of `#lol` has a `position` set, that causes your element to be positioned within the parent.
A solution with jQuery would be to attach the element directly to body.
```
$('#lol').css({
position: "absolute",
marginLeft: 0, marginTop: 0,
... | >
> Why is that?
>
>
>
If you want to use `position: absolute` relatively to the entire window, you need to make sure that your `#lol` has no parent elements also positioned `absolute`, `fixed`, or `relative`.
Otherwise, any positioning you specify will take place relative to them. |
6,505,067 | I have a code like that:
```
$('#lol').css({ position: "absolute",
marginLeft: 0, marginTop: 0,
top: 0, left: 0});
```
The problem is that my div is positioned relatively, so it is point 0 of a div rather than the entire window. Why is that? | 2011/06/28 | [
"https://Stackoverflow.com/questions/6505067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295815/"
] | >
> Why is that?
>
>
>
If you want to use `position: absolute` relatively to the entire window, you need to make sure that your `#lol` has no parent elements also positioned `absolute`, `fixed`, or `relative`.
Otherwise, any positioning you specify will take place relative to them. | If you want to use **absolute:position** on an element relative to the entire window screen than any parent of that element should not given any position values like absolute,fixed or relative,because the element will take the position relative to its parent if any position attribute is given to it.
Hope it answer you... |
6,505,067 | I have a code like that:
```
$('#lol').css({ position: "absolute",
marginLeft: 0, marginTop: 0,
top: 0, left: 0});
```
The problem is that my div is positioned relatively, so it is point 0 of a div rather than the entire window. Why is that? | 2011/06/28 | [
"https://Stackoverflow.com/questions/6505067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295815/"
] | Elements that have `position: relative` or `position: absolute` will be positioned relative to the closest parent that has `position: relative` or `position: absolute`. So, if you want your element to be positioned relative to the entire window, keep it outside of any parent wrappers with relative or absolute positions... | That's just how positioning works. If you have any parent elements with any position specified the absolute positioning will happen relative to them.
If you want it to the window but can't do away with any of the other elements' positioning you'll need to remove the item from regular page flow either manually or with ... |
6,505,067 | I have a code like that:
```
$('#lol').css({ position: "absolute",
marginLeft: 0, marginTop: 0,
top: 0, left: 0});
```
The problem is that my div is positioned relatively, so it is point 0 of a div rather than the entire window. Why is that? | 2011/06/28 | [
"https://Stackoverflow.com/questions/6505067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295815/"
] | As pointed out in the other answers, at least one of the parent element of `#lol` has a `position` set, that causes your element to be positioned within the parent.
A solution with jQuery would be to attach the element directly to body.
```
$('#lol').css({
position: "absolute",
marginLeft: 0, marginTop: 0,
... | Elements that have `position: relative` or `position: absolute` will be positioned relative to the closest parent that has `position: relative` or `position: absolute`. So, if you want your element to be positioned relative to the entire window, keep it outside of any parent wrappers with relative or absolute positions... |
6,505,067 | I have a code like that:
```
$('#lol').css({ position: "absolute",
marginLeft: 0, marginTop: 0,
top: 0, left: 0});
```
The problem is that my div is positioned relatively, so it is point 0 of a div rather than the entire window. Why is that? | 2011/06/28 | [
"https://Stackoverflow.com/questions/6505067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295815/"
] | Elements that have `position: relative` or `position: absolute` will be positioned relative to the closest parent that has `position: relative` or `position: absolute`. So, if you want your element to be positioned relative to the entire window, keep it outside of any parent wrappers with relative or absolute positions... | If you want to use **absolute:position** on an element relative to the entire window screen than any parent of that element should not given any position values like absolute,fixed or relative,because the element will take the position relative to its parent if any position attribute is given to it.
Hope it answer you... |
6,505,067 | I have a code like that:
```
$('#lol').css({ position: "absolute",
marginLeft: 0, marginTop: 0,
top: 0, left: 0});
```
The problem is that my div is positioned relatively, so it is point 0 of a div rather than the entire window. Why is that? | 2011/06/28 | [
"https://Stackoverflow.com/questions/6505067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295815/"
] | As pointed out in the other answers, at least one of the parent element of `#lol` has a `position` set, that causes your element to be positioned within the parent.
A solution with jQuery would be to attach the element directly to body.
```
$('#lol').css({
position: "absolute",
marginLeft: 0, marginTop: 0,
... | That's just how positioning works. If you have any parent elements with any position specified the absolute positioning will happen relative to them.
If you want it to the window but can't do away with any of the other elements' positioning you'll need to remove the item from regular page flow either manually or with ... |
6,505,067 | I have a code like that:
```
$('#lol').css({ position: "absolute",
marginLeft: 0, marginTop: 0,
top: 0, left: 0});
```
The problem is that my div is positioned relatively, so it is point 0 of a div rather than the entire window. Why is that? | 2011/06/28 | [
"https://Stackoverflow.com/questions/6505067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295815/"
] | As pointed out in the other answers, at least one of the parent element of `#lol` has a `position` set, that causes your element to be positioned within the parent.
A solution with jQuery would be to attach the element directly to body.
```
$('#lol').css({
position: "absolute",
marginLeft: 0, marginTop: 0,
... | If you want to use **absolute:position** on an element relative to the entire window screen than any parent of that element should not given any position values like absolute,fixed or relative,because the element will take the position relative to its parent if any position attribute is given to it.
Hope it answer you... |
299,349 | i want to buy a portable 1TB HDD, which should be supportable in Ubuntu as well as Microsoft windows (xp and above). Can any one suggest me a good HDD? | 2013/05/24 | [
"https://askubuntu.com/questions/299349",
"https://askubuntu.com",
"https://askubuntu.com/users/150344/"
] | Ubuntu will support any HDD you buy and almost all HDD's available in market mentions compatibility with Windows. | Go with ***Transcend*** *Storejet* (R). It has real value for money plus the compatibilities you're looking for and added features.
Source : My experience :) :) |
132,738 | Windows Server 2008 R2, IIS7. We have an SSL cert from Go Daddy. It's a wildcard cert, so it will work across subdomains (e.g. \*.domain.com). I followed the instructions located at <http://support.godaddy.com/help/article/4801/installing-an-ssl-certificate-in-microsoft-iis-7> for installing the certificate. I get to t... | 2010/04/15 | [
"https://serverfault.com/questions/132738",
"https://serverfault.com",
"https://serverfault.com/users/18496/"
] | The certificate was not exportable, so I was unable to use Roberts suggestion. Ultimately, I had to rekey the certificate at the Go Daddy account management page, and install it on both servers again. Some of the options during the wizard for the install on IIS6 were grayed out for me, and my initial attempt on that se... | As far as I can tell from having these issues today, if you have a certificate with multiple SANs (or I guess a wildcard) and run multiple servers, you need to rekey in Godaddy every time you install on a different machine.
This is easy enough - generate a CSR (2048 bit encryption), paste it on the Rekey page in Goda... |
132,738 | Windows Server 2008 R2, IIS7. We have an SSL cert from Go Daddy. It's a wildcard cert, so it will work across subdomains (e.g. \*.domain.com). I followed the instructions located at <http://support.godaddy.com/help/article/4801/installing-an-ssl-certificate-in-microsoft-iis-7> for installing the certificate. I get to t... | 2010/04/15 | [
"https://serverfault.com/questions/132738",
"https://serverfault.com",
"https://serverfault.com/users/18496/"
] | try importing into Intermediate Certificate Stores. If you view the certificate there, you will find that "you have a private key that corresponds to this certificate". Simply export to .pfx, then import into IIS. Worked for me :) | I had the same problem today, and fixed it by repairing the key store and providing the serial number of the public certificate. See my answer [here](https://serverfault.com/a/785649/335855) or go directly to [this link](http://www.entrust.net/knowledge-base/technote.cfm?tn=7905) which explains how to repair the key st... |
132,738 | Windows Server 2008 R2, IIS7. We have an SSL cert from Go Daddy. It's a wildcard cert, so it will work across subdomains (e.g. \*.domain.com). I followed the instructions located at <http://support.godaddy.com/help/article/4801/installing-an-ssl-certificate-in-microsoft-iis-7> for installing the certificate. I get to t... | 2010/04/15 | [
"https://serverfault.com/questions/132738",
"https://serverfault.com",
"https://serverfault.com/users/18496/"
] | try importing into Intermediate Certificate Stores. If you view the certificate there, you will find that "you have a private key that corresponds to this certificate". Simply export to .pfx, then import into IIS. Worked for me :) | I've found the problem can be reproduced when the leaf certificate has been installed under Intermediate Certification Authorities. Removing it (and leaving any real intermediate, if applicable) then completing the wizard corrects the problem. |
132,738 | Windows Server 2008 R2, IIS7. We have an SSL cert from Go Daddy. It's a wildcard cert, so it will work across subdomains (e.g. \*.domain.com). I followed the instructions located at <http://support.godaddy.com/help/article/4801/installing-an-ssl-certificate-in-microsoft-iis-7> for installing the certificate. I get to t... | 2010/04/15 | [
"https://serverfault.com/questions/132738",
"https://serverfault.com",
"https://serverfault.com/users/18496/"
] | Try exporting the certificate from the IIS6 server using these instructions: <http://www.sslshopper.com/move-or-copy-an-ssl-certificate-from-a-windows-server-to-another-windows-server.html>
That will ensure that the certificate has a private key. | I had the same problem today, and fixed it by repairing the key store and providing the serial number of the public certificate. See my answer [here](https://serverfault.com/a/785649/335855) or go directly to [this link](http://www.entrust.net/knowledge-base/technote.cfm?tn=7905) which explains how to repair the key st... |
132,738 | Windows Server 2008 R2, IIS7. We have an SSL cert from Go Daddy. It's a wildcard cert, so it will work across subdomains (e.g. \*.domain.com). I followed the instructions located at <http://support.godaddy.com/help/article/4801/installing-an-ssl-certificate-in-microsoft-iis-7> for installing the certificate. I get to t... | 2010/04/15 | [
"https://serverfault.com/questions/132738",
"https://serverfault.com",
"https://serverfault.com/users/18496/"
] | The certificate was not exportable, so I was unable to use Roberts suggestion. Ultimately, I had to rekey the certificate at the Go Daddy account management page, and install it on both servers again. Some of the options during the wizard for the install on IIS6 were grayed out for me, and my initial attempt on that se... | I had the same problem today, and fixed it by repairing the key store and providing the serial number of the public certificate. See my answer [here](https://serverfault.com/a/785649/335855) or go directly to [this link](http://www.entrust.net/knowledge-base/technote.cfm?tn=7905) which explains how to repair the key st... |
132,738 | Windows Server 2008 R2, IIS7. We have an SSL cert from Go Daddy. It's a wildcard cert, so it will work across subdomains (e.g. \*.domain.com). I followed the instructions located at <http://support.godaddy.com/help/article/4801/installing-an-ssl-certificate-in-microsoft-iis-7> for installing the certificate. I get to t... | 2010/04/15 | [
"https://serverfault.com/questions/132738",
"https://serverfault.com",
"https://serverfault.com/users/18496/"
] | The certificate was not exportable, so I was unable to use Roberts suggestion. Ultimately, I had to rekey the certificate at the Go Daddy account management page, and install it on both servers again. Some of the options during the wizard for the install on IIS6 were grayed out for me, and my initial attempt on that se... | I've found the problem can be reproduced when the leaf certificate has been installed under Intermediate Certification Authorities. Removing it (and leaving any real intermediate, if applicable) then completing the wizard corrects the problem. |
132,738 | Windows Server 2008 R2, IIS7. We have an SSL cert from Go Daddy. It's a wildcard cert, so it will work across subdomains (e.g. \*.domain.com). I followed the instructions located at <http://support.godaddy.com/help/article/4801/installing-an-ssl-certificate-in-microsoft-iis-7> for installing the certificate. I get to t... | 2010/04/15 | [
"https://serverfault.com/questions/132738",
"https://serverfault.com",
"https://serverfault.com/users/18496/"
] | The certificate was not exportable, so I was unable to use Roberts suggestion. Ultimately, I had to rekey the certificate at the Go Daddy account management page, and install it on both servers again. Some of the options during the wizard for the install on IIS6 were grayed out for me, and my initial attempt on that se... | I ran into this issue as well. Rekeying the cert resolved the issue, but the *reason* was that I was using a UCC cert, and the SARs had been changed *AFTER* the cert had last been re-keyed. Re-keying the cert again resolved the issue. I spent 2 hours on the phone with a tech there before I found that out <:( |
132,738 | Windows Server 2008 R2, IIS7. We have an SSL cert from Go Daddy. It's a wildcard cert, so it will work across subdomains (e.g. \*.domain.com). I followed the instructions located at <http://support.godaddy.com/help/article/4801/installing-an-ssl-certificate-in-microsoft-iis-7> for installing the certificate. I get to t... | 2010/04/15 | [
"https://serverfault.com/questions/132738",
"https://serverfault.com",
"https://serverfault.com/users/18496/"
] | The certificate was not exportable, so I was unable to use Roberts suggestion. Ultimately, I had to rekey the certificate at the Go Daddy account management page, and install it on both servers again. Some of the options during the wizard for the install on IIS6 were grayed out for me, and my initial attempt on that se... | Try exporting the certificate from the IIS6 server using these instructions: <http://www.sslshopper.com/move-or-copy-an-ssl-certificate-from-a-windows-server-to-another-windows-server.html>
That will ensure that the certificate has a private key. |
132,738 | Windows Server 2008 R2, IIS7. We have an SSL cert from Go Daddy. It's a wildcard cert, so it will work across subdomains (e.g. \*.domain.com). I followed the instructions located at <http://support.godaddy.com/help/article/4801/installing-an-ssl-certificate-in-microsoft-iis-7> for installing the certificate. I get to t... | 2010/04/15 | [
"https://serverfault.com/questions/132738",
"https://serverfault.com",
"https://serverfault.com/users/18496/"
] | Try exporting the certificate from the IIS6 server using these instructions: <http://www.sslshopper.com/move-or-copy-an-ssl-certificate-from-a-windows-server-to-another-windows-server.html>
That will ensure that the certificate has a private key. | I ran into this issue as well. Rekeying the cert resolved the issue, but the *reason* was that I was using a UCC cert, and the SARs had been changed *AFTER* the cert had last been re-keyed. Re-keying the cert again resolved the issue. I spent 2 hours on the phone with a tech there before I found that out <:( |
132,738 | Windows Server 2008 R2, IIS7. We have an SSL cert from Go Daddy. It's a wildcard cert, so it will work across subdomains (e.g. \*.domain.com). I followed the instructions located at <http://support.godaddy.com/help/article/4801/installing-an-ssl-certificate-in-microsoft-iis-7> for installing the certificate. I get to t... | 2010/04/15 | [
"https://serverfault.com/questions/132738",
"https://serverfault.com",
"https://serverfault.com/users/18496/"
] | try importing into Intermediate Certificate Stores. If you view the certificate there, you will find that "you have a private key that corresponds to this certificate". Simply export to .pfx, then import into IIS. Worked for me :) | As far as I can tell from having these issues today, if you have a certificate with multiple SANs (or I guess a wildcard) and run multiple servers, you need to rekey in Godaddy every time you install on a different machine.
This is easy enough - generate a CSR (2048 bit encryption), paste it on the Rekey page in Goda... |
633,391 | Given a finite set $S = \{A\_1,A\_2,A\_3...\}$ containing an arbitrary number of finite sets such that for any $A\_i{}\in{}S$ and $A\_j{}\in{}S$, $| A\_i{} | = | A\_j{} |$, and given that for every $A\_i{}\in{}S$, and for every $x\in{}A\_i$, $x$ is a finite real number, could it ever be the case that for any $i$ and $j... | 2014/01/10 | [
"https://math.stackexchange.com/questions/633391",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/110798/"
] | Let $a\_i=\{i,-i\}$, for each $i=1,2,\ldots$. Then each $a\_i$ has mean $0$, and cardinality $2$.
And $S=\{a\_1, a\_2,\ldots\}=\{\{1,-1\},\{2,-2\},\{3,-3\},\ldots\}$. | A simple example would be the sets $A\_1 = \{1,4\}$ and $A\_2 = \{2,3\}$.
This covers the case of the counting numbers, and can be generalized to sets of any size comprised of real numbers. |
10,103,672 | I need to create a folder for some images, I'm doing it right now using "New Group", inside the Project Navigator of my Xcode Project.
The problem comes when I see the contents of the `.app` package, and inside it the images are with all the other files (not inside my folder)
How can I create a folder that will be in... | 2012/04/11 | [
"https://Stackoverflow.com/questions/10103672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550034/"
] | **1.** Create a folder with the images.
**2.** While adding into the Xcode you drag and drop the folder and choose the option "Create folder references for any added folders".
The folder will be in **blue** color, not yellow. | Create a folder in you project folder, add image to that folder and then add them to Xcode. |
97,870 | This puzzle relates to [Prime to Prime: Get all first 25 Prime Numbers using up to 4 Primes](https://puzzling.stackexchange.com/questions/91841/prime-to-prime-get-all-first-25-prime-numbers-using-up-to-4-primes) and its sequel [Prime to Prime Sequel](https://puzzling.stackexchange.com/questions/91891/prime-to-prime-seq... | 2020/05/04 | [
"https://puzzling.stackexchange.com/questions/97870",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/34419/"
] | It might be more fun to fill the whole table. I've started with a few examples:
$$\require{begingroup}\begingroup
\def\\*{\times }
\begin{array}{|c|c|c|c|c|}
\hline
n& 2,3,5 & 2,3,7 & 2,5,7 & 3,5,7 \\
\hline
1& 2\\*3-5 & 7-2\\*3 & \frac{2+5}{7} & 3+5-7 \\
2& (3!-5)\\*2 & 7-3-2 & \sqrt{(7-5)\\*2} & \frac{3+7}5 \\
3... | I tried writing a generator. I can get everything from 1 to 24 inclusive, for all 4 combinations. I can get 0 to 33 for one combination. The first ungeneratable counting number is 68.
$$\begin{array}{|c|c|c|c|c|}
\hline
n& 2,3,5 & 2,3,7 & 2,5,7 & 3,5,7 \\
\hline
0 & (5-(2+3)) & (3-\sqrt{(2+7)}) & (7-(2+5)) & - \\
1 & ... |
67,620,475 | I am getting error while renaming a column, is there anyway i can rename it, as there are space in column name
`df=df.withColumnRenamed("std deviation","stdDeviation")`
`Error:AnalysisException: Attribute name "std deviation" contains invalid character(s) among " ,;{}()\n\t=". Please use alias to rename it.`
I tried... | 2021/05/20 | [
"https://Stackoverflow.com/questions/67620475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15513020/"
] | What your script does is:
1. Try to get element with id "100" (btw. starting ids with a number is bad practice although it might work in some browsers — see [What are valid values for the id attribute in HTML?](https://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html#answer-79022)).... | remarks are in the comment in code snippet.
```html
<html>
<body>
<p id="A100"> </p>
<script>
var dictionary,lower;
function start(){dictionary="house";
lower=dictionary.toString().toLowerCase();
//you need to return something for the function output to be consumed somewhere else
return lower;
}
//you use start outpu... |
18,277,192 | I want to use certain operations (like clearing the screen etc.) in C programs in Linux platform and I am informed that it can be done including **curses.h** header-file. But this doesn't seem to be available along with **gcc** package.
Please, tell me how can I install it? | 2013/08/16 | [
"https://Stackoverflow.com/questions/18277192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2689842/"
] | Try this:
```
sudo apt-get install libncurses5-dev
``` | On RHEL / Fedora / CentOS Linux, type the following yum command at a shell prompt as root user:
```
yum install ncurses-devel ncurses
``` |
18,277,192 | I want to use certain operations (like clearing the screen etc.) in C programs in Linux platform and I am informed that it can be done including **curses.h** header-file. But this doesn't seem to be available along with **gcc** package.
Please, tell me how can I install it? | 2013/08/16 | [
"https://Stackoverflow.com/questions/18277192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2689842/"
] | Try this:
```
sudo apt-get install libncurses5-dev
``` | On Debian/Ubuntu/Deepin,use the following command:
`sudo apt install libncurses5-dev`
man document:
`sudo apt install ncurses-doc`
then:
`man ncurses` |
48,412,108 | I've got a procedure within a SPARK module that calls the standard `Ada-Text_IO.Put_Line`.
During proving I get the following warning `warning: no Global contract available for "Put_Line"`.
I do already know how to add the respective data dependency contract to procedures and functions written by myself but how do I ... | 2018/01/23 | [
"https://Stackoverflow.com/questions/48412108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7962239/"
] | This means that the analyzer cannot "see" whether global variables might be affected when this function is called. It therefore assumes this call is not modifying anything (otherwise all other proofs could be refuted immediately). This is likely a valid assumption for your specific example, but it might not be valid on... | I think you just can't add Spark contracts on code you don't own, especially code from the Ada standard.
About *Text\_Io*, I found [something](http://docs.adacore.com/spark2014-docs/html/lrm/the-standard-library.html#the-package-text-io-a-10-1) that may be valuable to you in the reference manual.
**EDIT**
Another so... |
48,412,108 | I've got a procedure within a SPARK module that calls the standard `Ada-Text_IO.Put_Line`.
During proving I get the following warning `warning: no Global contract available for "Put_Line"`.
I do already know how to add the respective data dependency contract to procedures and functions written by myself but how do I ... | 2018/01/23 | [
"https://Stackoverflow.com/questions/48412108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7962239/"
] | Wrapper packages for use in development of SPARK applications may be found here:
<https://github.com/joakim-strandberg/aida_2012> | I think you just can't add Spark contracts on code you don't own, especially code from the Ada standard.
About *Text\_Io*, I found [something](http://docs.adacore.com/spark2014-docs/html/lrm/the-standard-library.html#the-package-text-io-a-10-1) that may be valuable to you in the reference manual.
**EDIT**
Another so... |
48,412,108 | I've got a procedure within a SPARK module that calls the standard `Ada-Text_IO.Put_Line`.
During proving I get the following warning `warning: no Global contract available for "Put_Line"`.
I do already know how to add the respective data dependency contract to procedures and functions written by myself but how do I ... | 2018/01/23 | [
"https://Stackoverflow.com/questions/48412108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7962239/"
] | This means that the analyzer cannot "see" whether global variables might be affected when this function is called. It therefore assumes this call is not modifying anything (otherwise all other proofs could be refuted immediately). This is likely a valid assumption for your specific example, but it might not be valid on... | Wrapper packages for use in development of SPARK applications may be found here:
<https://github.com/joakim-strandberg/aida_2012> |
32,325 | I want to get some spare inner tubes for my new road bike, but I'm unsure what size to get. On my tire it says the size is 700 x 25c and I know that 25 is the max width of the inner tube. So should I get 700x20-25c or 700x25-32c? I'm guessing 700x20-25c would be the safer option, correct? | 2015/07/29 | [
"https://bicycles.stackexchange.com/questions/32325",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/20788/"
] | As long as it is in the range you are good. You can even cheat outside the stated range a bit. Too big and you can fold. Too small and you stretch. If it is spare you are going to carry on the bike then the smaller. | Either of those inner tubes are fine for that tyre. I'd recommend the smaller size since it's easier to get in the tyre without folds or twists. |
28,134,755 | I am creating a web API to extract data from SAP service. My Team lead has asked me to make a odata enabled web API. I read few articles but there is no strong reason which can tell that odata has great advantage if we are consuming an asmx service into web API which in turn will be used by Sharepoint client. | 2015/01/25 | [
"https://Stackoverflow.com/questions/28134755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3387733/"
] | There are a couple of reasons why I'd recommend to choosing OData over general WebApi:
1. OData provide a level of discoverability that is not present out of the box with a generic WebApi solution. For example, if you have an entity "Widget", one can query the Odata root and it will be listed, along with all the other... | The BI service API permits the extraction and direct access to data from SAP systems in standardized form. This can be SAP application systems or SAP NetWeaver BI systems. The data request is controlled from the SAP NetWeaver BI system. More about you'll find there: <http://help.sap.com/saphelp_erp60_sp/helpdata/en/46/... |
35,473,352 | How to read the below xml using php?
```
<?xml version="1.0" encoding="UTF-8"?>
<video>
<youtube> youtube video url </youtube>
</video>
```
I tried the code below but seems not working:
```
$dom = new DOMDocument();
$dom->load('new_result.xml');
$results = $dom->documentElement;
foreach( $results as $result)... | 2016/02/18 | [
"https://Stackoverflow.com/questions/35473352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4935959/"
] | try this :
```
if (file_exists('result.xml')) {
$xml = simplexml_load_file('result.xml');
echo $xml->youtube;
} else {
exit('Failed to open result.xml.');
}
``` | No need for anything fancy, just use `->getElementsByTagName()` method after you've loaded it up:
```
$dom->load('new_result.xml'); // load the file
// use ->getElementsByTagName() right away
$youtube = $dom->getElementsByTagName('youtube');
if($youtube->length > 0) { // if there are youtube nodes indeed
foreach($... |
35,473,352 | How to read the below xml using php?
```
<?xml version="1.0" encoding="UTF-8"?>
<video>
<youtube> youtube video url </youtube>
</video>
```
I tried the code below but seems not working:
```
$dom = new DOMDocument();
$dom->load('new_result.xml');
$results = $dom->documentElement;
foreach( $results as $result)... | 2016/02/18 | [
"https://Stackoverflow.com/questions/35473352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4935959/"
] | try this :
```
if (file_exists('result.xml')) {
$xml = simplexml_load_file('result.xml');
echo $xml->youtube;
} else {
exit('Failed to open result.xml.');
}
``` | The `DOMDocument::documentElement` is the root element node. In your XML, this would be the `video` element node. It is not a node list, but the actual node, so `foreach` will not work.
Just remove the outer `foreach`
```
$dom = new DOMDocument();
$dom->load('new_result.xml');
$video = $dom->documentElement;
foreach... |
35,473,352 | How to read the below xml using php?
```
<?xml version="1.0" encoding="UTF-8"?>
<video>
<youtube> youtube video url </youtube>
</video>
```
I tried the code below but seems not working:
```
$dom = new DOMDocument();
$dom->load('new_result.xml');
$results = $dom->documentElement;
foreach( $results as $result)... | 2016/02/18 | [
"https://Stackoverflow.com/questions/35473352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4935959/"
] | No need for anything fancy, just use `->getElementsByTagName()` method after you've loaded it up:
```
$dom->load('new_result.xml'); // load the file
// use ->getElementsByTagName() right away
$youtube = $dom->getElementsByTagName('youtube');
if($youtube->length > 0) { // if there are youtube nodes indeed
foreach($... | The `DOMDocument::documentElement` is the root element node. In your XML, this would be the `video` element node. It is not a node list, but the actual node, so `foreach` will not work.
Just remove the outer `foreach`
```
$dom = new DOMDocument();
$dom->load('new_result.xml');
$video = $dom->documentElement;
foreach... |
35,786,199 | I have a multi-project SBT build. There is a root which does not have anything, it just aggregates all sub projects.
```
lazy val aaRoot = (project in file(".")).settings(commonSettings: _*).settings(
libraryDependencies ++= appDependencies
).enablePlugins(PlayJava).aggregate(foo, bar)
lazy val foo: Project = (proj... | 2016/03/04 | [
"https://Stackoverflow.com/questions/35786199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1300669/"
] | None of the build tools I know allow for cyclic dependencies... and in my experience that is a symptom of a issue with the design of the application or modules, rather than a 'missing' feature from the tools. It's even seen as something bad when this happens at the package level in the same module/jar.
Can you merge t... | As @Augusto suggested, I have re-organized my classes into three different sub-modules and using my Dependency Injection little more wisely. This solved my problem and gave much more abstraction than what I initially had.
Three sub-projects:
* api (Just interfaces)
* foo (depends on api)
* bar (depends on api)
* aaRo... |
57,509,957 | I'm new to fairly new to Javascript and I need some help solving the 804. Unique Morse Code Words - Leetcode problem.
I figured how to search return the morse code by using the index of each letter from a word and using it to concatenate the codes at those specific index in the morse code array. The problem is I can't... | 2019/08/15 | [
"https://Stackoverflow.com/questions/57509957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11849190/"
] | Inside your function, create a Set:
```
const resultSet = new Set();
```
Then when each `result` is built up (when you log it), add the resulting morse code to that Set:
```
resultSet.add(result);
```
Then you can finally `return` that Set, or its `.size`. | I think this should solve your problem. Take an obj, and store the result in that and check if the result is repeating then don't push that result into that array. And the time complexity in this operation would be O(1), so you don't have to worry about it if you want to scale your algorithm.
```
var letters = ["a", "... |
62,595 | I have to describe what it means, when a function is discontinuous in a. I also have to use quantification notation.
I have tried following:
$$\exists \varepsilon > 0, \exists \delta > 0 : |x-a| < \delta \Rightarrow |f(x)-f(a)| \geq \varepsilon$$
But when I went to the classes they used a different notation. But is ... | 2011/09/07 | [
"https://math.stackexchange.com/questions/62595",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/15552/"
] | Consider what a pure strategy for X will actually look like. It must have two components: it must specify X’s Round 1 move, and it must specify what X is to do in Round 3 for every possible response by Y in Round 2. The Round 1 component can obviously be chosen in $4$ ways. Suppose that it’s been chosen. Then Y’s $3$ p... | I'm a beginner myself, but I think the difference boils down to the fact that the generalized statement mentioned (and information sets concept) apply to imperfect information games, while the example given is one with perfect information because the players know the complete history of the game.
This means that the n... |
62,595 | I have to describe what it means, when a function is discontinuous in a. I also have to use quantification notation.
I have tried following:
$$\exists \varepsilon > 0, \exists \delta > 0 : |x-a| < \delta \Rightarrow |f(x)-f(a)| \geq \varepsilon$$
But when I went to the classes they used a different notation. But is ... | 2011/09/07 | [
"https://math.stackexchange.com/questions/62595",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/15552/"
] | Consider what a pure strategy for X will actually look like. It must have two components: it must specify X’s Round 1 move, and it must specify what X is to do in Round 3 for every possible response by Y in Round 2. The Round 1 component can obviously be chosen in $4$ ways. Suppose that it’s been chosen. Then Y’s $3$ p... | OP is correct.
First, we define an information set: an informations set is a node or possibly collection of nodes at which a player makes a decision, and for which the player cannot distinguish between multiple nodes in the informations set. Hence the player has the same available actions at each node in an informati... |
7,576 | I would like to have help in producing examples of mathematicians that, in some sense I'll explain below,turned their career into failure. I am mainly interested in examples from XIX and XXth century.
I'd like to hear of mathematicians that:
* started their career in a very promising manner and then turned to pseudos... | 2018/08/04 | [
"https://hsm.stackexchange.com/questions/7576",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/1689/"
] | One possibility is Ted Kaczynski, the [Unabomber](https://en.wikipedia.org/wiki/Ted_Kaczynski). He has been described as a mathematical prodigy and [Allen Shields](https://en.wikipedia.org/wiki/Allen_Shields), his doctoral adviser, once told that Kaczynski was the best doctoral student he ever directed. | Two examples come to my mind but they are not to be taken too *seriously*.
Our set theory professor in his lectures introduced [Bertrand Russell](https://www.youtube.com/watch?v=1bZv3pSaLtY) jokingly by saying that he had started off as a mathematician, then became a philosopher, then became a peace activist. The impl... |
7,576 | I would like to have help in producing examples of mathematicians that, in some sense I'll explain below,turned their career into failure. I am mainly interested in examples from XIX and XXth century.
I'd like to hear of mathematicians that:
* started their career in a very promising manner and then turned to pseudos... | 2018/08/04 | [
"https://hsm.stackexchange.com/questions/7576",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/1689/"
] | One possibility is Ted Kaczynski, the [Unabomber](https://en.wikipedia.org/wiki/Ted_Kaczynski). He has been described as a mathematical prodigy and [Allen Shields](https://en.wikipedia.org/wiki/Allen_Shields), his doctoral adviser, once told that Kaczynski was the best doctoral student he ever directed. | [Isaac Newton](https://en.wikipedia.org/wiki/Religious_views_of_Isaac_Newton) devoted much of his later life to religious speculations that even most religious people regard as having dubious value. In particular, he spent a lot of time on what are now generally termed [occult studies](https://en.wikipedia.org/wiki/Isa... |
7,576 | I would like to have help in producing examples of mathematicians that, in some sense I'll explain below,turned their career into failure. I am mainly interested in examples from XIX and XXth century.
I'd like to hear of mathematicians that:
* started their career in a very promising manner and then turned to pseudos... | 2018/08/04 | [
"https://hsm.stackexchange.com/questions/7576",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/1689/"
] | [Alexander Abian](https://en.wikipedia.org/wiki/Alexander_Abian) may fit the bill here.
His most notable contribution to mathematics was proving consistency and independence of four of the Zermelo-Fraenkel axioms. [source: Wolfram Mathworld](http://mathworld.wolfram.com/Zermelo-FraenkelAxioms.html).
They are : *Exte... | Two examples come to my mind but they are not to be taken too *seriously*.
Our set theory professor in his lectures introduced [Bertrand Russell](https://www.youtube.com/watch?v=1bZv3pSaLtY) jokingly by saying that he had started off as a mathematician, then became a philosopher, then became a peace activist. The impl... |
7,576 | I would like to have help in producing examples of mathematicians that, in some sense I'll explain below,turned their career into failure. I am mainly interested in examples from XIX and XXth century.
I'd like to hear of mathematicians that:
* started their career in a very promising manner and then turned to pseudos... | 2018/08/04 | [
"https://hsm.stackexchange.com/questions/7576",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/1689/"
] | Lucjan Emil Böttcher (1872–1937) might fit the bill. He got his PhD in Leipzig in 1898 under Sophus Lie and lectured at Lwow Polytechnics from 1901 until his retrement in 1935. His publications, starting with his PhD thesis, are full of ideas anticipating holomorphic dynamics (developed about 20 years later by Pierre F... | Two examples come to my mind but they are not to be taken too *seriously*.
Our set theory professor in his lectures introduced [Bertrand Russell](https://www.youtube.com/watch?v=1bZv3pSaLtY) jokingly by saying that he had started off as a mathematician, then became a philosopher, then became a peace activist. The impl... |
7,576 | I would like to have help in producing examples of mathematicians that, in some sense I'll explain below,turned their career into failure. I am mainly interested in examples from XIX and XXth century.
I'd like to hear of mathematicians that:
* started their career in a very promising manner and then turned to pseudos... | 2018/08/04 | [
"https://hsm.stackexchange.com/questions/7576",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/1689/"
] | [Isaac Newton](https://en.wikipedia.org/wiki/Religious_views_of_Isaac_Newton) devoted much of his later life to religious speculations that even most religious people regard as having dubious value. In particular, he spent a lot of time on what are now generally termed [occult studies](https://en.wikipedia.org/wiki/Isa... | Two examples come to my mind but they are not to be taken too *seriously*.
Our set theory professor in his lectures introduced [Bertrand Russell](https://www.youtube.com/watch?v=1bZv3pSaLtY) jokingly by saying that he had started off as a mathematician, then became a philosopher, then became a peace activist. The impl... |
7,576 | I would like to have help in producing examples of mathematicians that, in some sense I'll explain below,turned their career into failure. I am mainly interested in examples from XIX and XXth century.
I'd like to hear of mathematicians that:
* started their career in a very promising manner and then turned to pseudos... | 2018/08/04 | [
"https://hsm.stackexchange.com/questions/7576",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/1689/"
] | [Alexander Abian](https://en.wikipedia.org/wiki/Alexander_Abian) may fit the bill here.
His most notable contribution to mathematics was proving consistency and independence of four of the Zermelo-Fraenkel axioms. [source: Wolfram Mathworld](http://mathworld.wolfram.com/Zermelo-FraenkelAxioms.html).
They are : *Exte... | [Isaac Newton](https://en.wikipedia.org/wiki/Religious_views_of_Isaac_Newton) devoted much of his later life to religious speculations that even most religious people regard as having dubious value. In particular, he spent a lot of time on what are now generally termed [occult studies](https://en.wikipedia.org/wiki/Isa... |
7,576 | I would like to have help in producing examples of mathematicians that, in some sense I'll explain below,turned their career into failure. I am mainly interested in examples from XIX and XXth century.
I'd like to hear of mathematicians that:
* started their career in a very promising manner and then turned to pseudos... | 2018/08/04 | [
"https://hsm.stackexchange.com/questions/7576",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/1689/"
] | Lucjan Emil Böttcher (1872–1937) might fit the bill. He got his PhD in Leipzig in 1898 under Sophus Lie and lectured at Lwow Polytechnics from 1901 until his retrement in 1935. His publications, starting with his PhD thesis, are full of ideas anticipating holomorphic dynamics (developed about 20 years later by Pierre F... | [Isaac Newton](https://en.wikipedia.org/wiki/Religious_views_of_Isaac_Newton) devoted much of his later life to religious speculations that even most religious people regard as having dubious value. In particular, he spent a lot of time on what are now generally termed [occult studies](https://en.wikipedia.org/wiki/Isa... |
29,436,804 | I have a string which is very long. I would like to split this string into substrings 16 characters long, skipping one character every time (e.g. substring1=first 16 elements of the string, substring2 from element 18 to element 34 and so on) and list them.
I wrote the following code:
```
string="abcd..."
list=[]
for ... | 2015/04/03 | [
"https://Stackoverflow.com/questions/29436804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4743279/"
] | It seems to me that you have to customise the admin-view for your models. It is a task that you have to do for your models if they are not displayed correctly "out of the box".
In most of the cases you don't have to fully rewrite the views. In most of the cases it will be enough to customise built-in views.
I don't h... | ```
import time
sentence = "ASK NOT WHAT YOUR COUNTRY CAN DO FOR YOU ASK WHAT YOU CAN DO FOR YOUR COUNTRY"
s = sentence.split()
another = [0]
time.sleep(0.5)
print(sentence)
for count, i in enumerate(s):
if s.count(i) < 2:
another.append(max(another) + 1)
else:
another.append(s.index(i) +... |
69,209,618 | I am trying to make a `GET` request to the [International Space station REST API](https://api.wheretheiss.at/v1/satellites/25544) as a test from PLSQL, but it is giving me a `ORA-29273: HTTP request failed` error.
My code is this:
```
declare
l_url varchar2(32767) := 'https://api.wheretheiss.at/v1/satellit... | 2021/09/16 | [
"https://Stackoverflow.com/questions/69209618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/941397/"
] | Depending on how the webpack based code does manage the tab handling of resources one possible solution was to wrap own code around `window.open` or even entirely replace it with an own implementation.
As for the wrapping, based on the intercepted data, one could decide of whether one does suppress the url-handling en... | Probably the logic in the `onClick()` does something like `window.open(url, [params])`. You can change this to setting `window.location.href = url;` and the url will be loaded in the same window. |
21,251,875 | I'm unit testing my application and I get a `NotFoundHttpException` when trying to call controller actions with `TestCase::callSecure()` and the `route()` helper.
For those tests (only a few) I have also enabled filters with `Route::enableFilters`.
My filters.php:
```
App::before(
function ($request) {
/... | 2014/01/21 | [
"https://Stackoverflow.com/questions/21251875",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985521/"
] | The [route()](http://laravel.com/docs/helpers#urls) helper will generate a [URL](http://en.wikipedia.org/wiki/Uniform_resource_locator) (including the relevant protocol, i.e. http/s) for the given named route. In your case, it'll return something like:
>
> <https://example.com/login>
>
>
>
Which isn't what you wa... | The `route()` helper does not create relative URLs, which is what you really want.
To generate a relative URL, you can use `URL::route` as it allows you to pass a `$absolute` parameter which defaults to true. So to get your relative url using a named route, you could do
```
$credentials = [
// ...
];
$route = URL::ro... |
54,902,157 | I am trying to make an audio-only player using python for a small project. The script I am using is as follows:
```
#!/usr/bin/env python
import re ... | 2019/02/27 | [
"https://Stackoverflow.com/questions/54902157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4873946/"
] | The problem seems to be related to two versions of vlc package (32 bit vs 64bit). There are two ways to install it as well: python-vlc vs vlc. Please check which system version you have and install the correct package version for it. You may still experience the same problem I had where I was missing some DLLs.
I hope... | For simplicity, place the `vlc.py` program in the same directory as your program.
Then this is the simplest form of getting `vlc` to play something
```
url = "file:///home/rolf/GWPE.mp4"
import vlc
playing = set([1,2,3,4])
instance=vlc.Instance()
player=instance.media_player_new()
player.set_mrl(url)
player.play(... |
46,257,489 | I'm very much a beginning programmer, trying to grasp the details of event handling. And I'm breaking my head over a problem. See below:
```
public class Knop_ClickEventArgs : System.EventArgs
{
//Here comes code that still needs to be written.
}
static void Knop_Click(object sender, Knop_ClickEventArgs e)
{
Ca... | 2017/09/16 | [
"https://Stackoverflow.com/questions/46257489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8620027/"
] | When you add a handler to the `Click` event of a control, (in this case, a `Button` that you call `Knop`,) the `Button` will be invoking your handler passing it `object sender, System.EventArgs e`. This means that:
* it is impossible to define your handler as accepting your own event class instead of `System.EventArgs... | You are getting it all wrong. you just need a appropriate event handler attached to Click event.
```
static void Knop_Click(object sender, EventArgs e)
{
}
// ...
Knop.Click += Knop_Click;
```
Now this method will be called when Button fires Click event. you can not change signature because that's how button fires t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.