lundi 11 mai 2015

pip install cryptography -> error...failed with exit status 1120

I am trying to install the cryptography module for python yet I keep getting errors and so far I have been able to solve each one as they come including:

  1. error: Unable to find vcvarsall.bat
  2. mysql-python install problem using virtualenv, windows, pip
  3. Installing lxml for Python 3.4 on Windows x 86 (32 bit) with Visual Studio C++ 2010 Express
  4. Failing to run pip install cryptography on Windows 7

However I have ran into an error that no matter how hard I look I find nothing so I decided I shall do what everyone else has done in the past and ask.

What do I need to do to get the error: command 'C:\\Program Files (x86)\\Microsoft\\Visual Studio\\14.0\\VC\\BIN\\amd64\\link.exe' failed with exit status 1120 error to go away so I can install the cryptographic module.

P.S. Yes I have tried easy_install


System Info

  • Windows 7 Home Premium - Service Pack 1 - 64-bit - AMD64x
  • Python 3.5.0a4

Setting up the environment

"C:\Program Files (x86)\Microsoft\Visual Studio\14.0\Common7\Tools\vsvars32.bat"
set INCLUDE=C:\ProgramData\Runtime\OpenSSL\include;%INCLUDE%
set LIB=C:\ProgramData\Runtime\OpenSSL\lib;C:\ProgramData\Runtime\OpenSSL\lib\VC\static;%LIB%


Checking the path

C:\PROGRA~1\Calibre2
C:\PROGRA~1\MICROS~1\120\Tools\Binn\
C:\PROGRA~1\MICROS~2\Dnvm\
C:\PROGRA~2\GNU\GnuPG\pub
C:\PROGRA~2\WI3CF2~1\8.1\WINDOW~1\
C:\PROGRA~3\Oracle\Java\javapath
C:\PROGRA~3\Runtime\JAVASC~1\nodejs
C:\PROGRA~3\Runtime\Perl\STRAWB~1\c\bin
C:\PROGRA~3\Runtime\Perl\STRAWB~1\perl\bin
C:\PROGRA~3\Runtime\Python\
C:\PROGRA~3\Runtime\Python\Scripts\
C:\PROGRA~3\Runtime\libxml2\bin
C:\PROGRA~3\Runtime\libxslt\bin
C:\Program Files (x86)\HTML Help Workshop
C:\Program Files (x86)\MSBuild\14.0\bin
C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\
C:\Program Files (x86)\Microsoft\Visual Studio\14.0\Common7\IDE\
C:\Program Files (x86)\Microsoft\Visual Studio\14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow
C:\Program Files (x86)\Microsoft\Visual Studio\14.0\Common7\Tools
C:\Program Files (x86)\Microsoft\Visual Studio\14.0\Team Tools\Performance Tools
C:\Program Files (x86)\Microsoft\Visual Studio\14.0\VC\BIN
C:\Program Files (x86)\Microsoft\Visual Studio\14.0\VC\VCPackages
C:\Program Files (x86)\Windows Kits\8.1\bin\x86
C:\ProgramData\Runtime\Gradle\bin
C:\ProgramData\Runtime\Lua\bin
C:\ProgramData\Runtime\OpenSSL/bin
C:\Users\Brandon\.dnx\bin
C:\Users\Brandon\AppData\Local\Android\sdk\platform-tools
C:\Windows
C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Windows\system32
S:\xampp\php


pip install cryptography

Collecting cryptography
  Using cached cryptography-0.8.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): pyasn1 in c:\programdata\runtime\python\lib\site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4.1 in c:\programdata\runtime\python\lib\site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\programdata\runtime\python\lib\site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): cffi>=0.8 in c:\programdata\runtime\python\lib\site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): pycparser in c:\programdata\runtime\python\lib\site-packages (from cffi>=0.8->cryptography)
Installing collected packages: cryptography
  Running setup.py install for cryptography
    Complete output from command C:\ProgramData\Runtime\Python\python.exe -c "import setuptools, tokenize;__file__='S:\\Temp\\Local\\pip-build-j3dfyfa3\\cryptography\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record S:\Temp\Local\pip-igpv1y8a-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.5
    creating build\lib.win-amd64-3.5\cryptography
    copying src\cryptography\exceptions.py -> build\lib.win-amd64-3.5\cryptography
    copying src\cryptography\fernet.py -> build\lib.win-amd64-3.5\cryptography
    copying src\cryptography\utils.py -> build\lib.win-amd64-3.5\cryptography
    copying src\cryptography\x509.py -> build\lib.win-amd64-3.5\cryptography
    copying src\cryptography\__about__.py -> build\lib.win-amd64-3.5\cryptography
    copying src\cryptography\__init__.py -> build\lib.win-amd64-3.5\cryptography
    creating build\lib.win-amd64-3.5\cryptography\hazmat
    copying src\cryptography\hazmat\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat
    creating build\lib.win-amd64-3.5\cryptography\hazmat\backends
    copying src\cryptography\hazmat\backends\interfaces.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends
    copying src\cryptography\hazmat\backends\multibackend.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends
    copying src\cryptography\hazmat\backends\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends
    creating build\lib.win-amd64-3.5\cryptography\hazmat\bindings
    copying src\cryptography\hazmat\bindings\utils.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings
    copying src\cryptography\hazmat\bindings\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings
    creating build\lib.win-amd64-3.5\cryptography\hazmat\primitives
    copying src\cryptography\hazmat\primitives\cmac.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives
    copying src\cryptography\hazmat\primitives\constant_time.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives
    copying src\cryptography\hazmat\primitives\hashes.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives
    copying src\cryptography\hazmat\primitives\hmac.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives
    copying src\cryptography\hazmat\primitives\padding.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives
    copying src\cryptography\hazmat\primitives\serialization.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives
    copying src\cryptography\hazmat\primitives\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives
    creating build\lib.win-amd64-3.5\cryptography\hazmat\backends\commoncrypto
    copying src\cryptography\hazmat\backends\commoncrypto\backend.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\commoncrypto
    copying src\cryptography\hazmat\backends\commoncrypto\ciphers.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\commoncrypto
    copying src\cryptography\hazmat\backends\commoncrypto\hashes.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\commoncrypto
    copying src\cryptography\hazmat\backends\commoncrypto\hmac.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\commoncrypto
    copying src\cryptography\hazmat\backends\commoncrypto\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\commoncrypto
    creating build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\backend.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\ciphers.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\cmac.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\dsa.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\ec.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\hashes.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\hmac.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\rsa.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\utils.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\x509.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    copying src\cryptography\hazmat\backends\openssl\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\backends\openssl
    creating build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\binding.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\cf.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\common_cryptor.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\common_digest.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\common_hmac.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\common_key_derivation.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\secimport.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\secitem.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\seckey.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\seckeychain.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\sectransform.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    copying src\cryptography\hazmat\bindings\commoncrypto\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\commoncrypto
    creating build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\aes.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\asn1.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\bignum.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\binding.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\bio.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\cmac.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\cms.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\conf.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\crypto.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\dh.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\dsa.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\ec.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\ecdh.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\ecdsa.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\engine.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\err.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\evp.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\hmac.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\nid.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\objects.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\opensslv.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\osrandom_engine.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\pem.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\pkcs12.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\pkcs7.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\rand.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\rsa.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\ssl.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\x509.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\x509name.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\x509v3.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\x509_vfy.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    copying src\cryptography\hazmat\bindings\openssl\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\openssl
    creating build\lib.win-amd64-3.5\cryptography\hazmat\primitives\asymmetric
    copying src\cryptography\hazmat\primitives\asymmetric\dh.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\asymmetric
    copying src\cryptography\hazmat\primitives\asymmetric\dsa.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\asymmetric
    copying src\cryptography\hazmat\primitives\asymmetric\ec.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\asymmetric
    copying src\cryptography\hazmat\primitives\asymmetric\padding.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\asymmetric
    copying src\cryptography\hazmat\primitives\asymmetric\rsa.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\asymmetric
    copying src\cryptography\hazmat\primitives\asymmetric\utils.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\asymmetric
    copying src\cryptography\hazmat\primitives\asymmetric\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\asymmetric
    creating build\lib.win-amd64-3.5\cryptography\hazmat\primitives\ciphers
    copying src\cryptography\hazmat\primitives\ciphers\algorithms.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\ciphers
    copying src\cryptography\hazmat\primitives\ciphers\base.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\ciphers
    copying src\cryptography\hazmat\primitives\ciphers\modes.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\ciphers
    copying src\cryptography\hazmat\primitives\ciphers\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\ciphers
    creating build\lib.win-amd64-3.5\cryptography\hazmat\primitives\interfaces
    copying src\cryptography\hazmat\primitives\interfaces\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\interfaces
    creating build\lib.win-amd64-3.5\cryptography\hazmat\primitives\kdf
    copying src\cryptography\hazmat\primitives\kdf\hkdf.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\kdf
    copying src\cryptography\hazmat\primitives\kdf\pbkdf2.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\kdf
    copying src\cryptography\hazmat\primitives\kdf\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\kdf
    creating build\lib.win-amd64-3.5\cryptography\hazmat\primitives\twofactor
    copying src\cryptography\hazmat\primitives\twofactor\hotp.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\twofactor
    copying src\cryptography\hazmat\primitives\twofactor\totp.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\twofactor
    copying src\cryptography\hazmat\primitives\twofactor\__init__.py -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\twofactor
    running egg_info
    writing entry points to src\cryptography.egg-info\entry_points.txt
    writing top-level names to src\cryptography.egg-info\top_level.txt
    writing requirements to src\cryptography.egg-info\requires.txt
    writing dependency_links to src\cryptography.egg-info\dependency_links.txt
    writing src\cryptography.egg-info\PKG-INFO

    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'src\cryptography.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    no previously-included directories found matching 'docs\_build'
    warning: no previously-included files matching '*' found under directory 'vectors'
    writing manifest file 'src\cryptography.egg-info\SOURCES.txt'
    creating build\lib.win-amd64-3.5\cryptography\hazmat\bindings\__pycache__
    copying src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_15f8accfx62b488b1.c -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\__pycache__
    copying src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.c -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\__pycache__
    copying src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_c4c16865xffc7b1ce.c -> build\lib.win-amd64-3.5\cryptography\hazmat\bindings\__pycache__
    creating build\lib.win-amd64-3.5\cryptography\hazmat\primitives\src
    copying src\cryptography\hazmat\primitives\src\constant_time.c -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\src
    copying src\cryptography\hazmat\primitives\src\constant_time.h -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\src
    copying src\cryptography\hazmat\primitives\src\padding.c -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\src
    copying src\cryptography\hazmat\primitives\src\padding.h -> build\lib.win-amd64-3.5\cryptography\hazmat\primitives\src
    running build_ext

    building '_Cryptography_cffi_89292e72x399b1113' extension
    creating build\temp.win-amd64-3.5
    creating build\temp.win-amd64-3.5\Release
    creating build\temp.win-amd64-3.5\Release\src
    creating build\temp.win-amd64-3.5\Release\src\cryptography
    creating build\temp.win-amd64-3.5\Release\src\cryptography\hazmat
    creating build\temp.win-amd64-3.5\Release\src\cryptography\hazmat\bindings
    creating build\temp.win-amd64-3.5\Release\src\cryptography\hazmat\bindings\__pycache__

    C:\Program Files (x86)\Microsoft\Visual Studio\14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\ProgramData\Runtime\Python\include -IC:\ProgramData\Runtime\Python\include /Tcsrc\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.c /Fobuild\temp.win-amd64-3.5\Release\src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.obj
    _Cryptography_cffi_89292e72x399b1113.c
    src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.c(2539): warning C4048: different array subscripts: 'unsigned char (*)[0]' and 'unsigned char (*)[32]'
    src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.c(2540): warning C4048: different array subscripts: 'unsigned char (*)[0]' and 'unsigned char (*)[32]'
    src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.c(2567): warning C4048: different array subscripts: 'unsigned char (*)[0]' and 'unsigned char (*)[48]'
    C:\Program Files (x86)\Microsoft\Visual Studio\14.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\ProgramData\Runtime\Python\libs /LIBPATH:C:\ProgramData\Runtime\Python\PCbuild\amd64 libeay32mt.lib ssleay32mt.lib advapi32.lib crypt32.lib gdi32.lib user32.lib ws2_32.lib /EXPORT:PyInit__Cryptography_cffi_89292e72x399b1113 build\temp.win-amd64-3.5\Release\src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.obj /OUT:build\lib.win-amd64-3.5\cryptography\_Cryptography_cffi_89292e72x399b1113.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.cp35-win_amd64.lib /MANIFESTFILE:build\temp.win-amd64-3.5\Release\src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.cp35-win_amd64.pyd.manifest_Cryptography_cffi_89292e72x399b1113.obj : warning LNK4197: export 'PyInit__Cryptography_cffi_89292e72x399b1113' specified multiple times; using first specification
        Creating library build\temp.win-amd64-3.5\Release\src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.cp35-win_amd64.lib and object build\temp.win-amd64-3.5\Release\src\cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_89292e72x399b1113.cp35-win_amd64.exp
        libeay32mt.lib(cryptlib.obj) : error LNK2019: unresolved external symbol sscanf referenced in function OPENSSL_cpuid_setup
        libeay32mt.lib(v3_utl.obj) : error LNK2001: unresolved external symbol sscanf
        libeay32mt.lib(cryptlib.obj) : error LNK2019: unresolved external symbol _vsnwprintf referenced in function OPENSSL_showfatal
        libeay32mt.lib(cryptlib.obj) : error LNK2019: unresolved external symbol _vsnprintf referenced in function OPENSSL_showfatal
        ssleay32mt.lib(t1_enc.obj) : error LNK2001: unresolved external symbol __iob_func
        libeay32mt.lib(txt_db.obj) : error LNK2001: unresolved external symbol __iob_func
        libeay32mt.lib(gost_eng.obj) : error LNK2001: unresolved external symbol __iob_func
        libeay32mt.lib(ui_openssl.obj) : error LNK2001: unresolved external symbol __iob_func
        ssleay32mt.lib(s3_srvr.obj) : error LNK2001: unresolved external symbol __iob_func
        ssleay32mt.lib(d1_both.obj) : error LNK2001: unresolved external symbol __iob_func
        libeay32mt.lib(cryptlib.obj) : error LNK2001: unresolved external symbol __iob_func
        libeay32mt.lib(eng_openssl.obj) : error LNK2001: unresolved external symbol __iob_func
        libeay32mt.lib(pem_lib.obj) : error LNK2001: unresolved external symbol __iob_func
        libeay32mt.lib(e_capi.obj) : error LNK2001: unresolved external symbol __iob_func
        ssleay32mt.lib(s3_srvr.obj) : error LNK2019: unresolved external symbol fprintf referenced in function ssl3_accept
        ssleay32mt.lib(d1_both.obj) : error LNK2001: unresolved external symbol fprintf
        ssleay32mt.lib(t1_enc.obj) : error LNK2001: unresolved external symbol fprintf
        libeay32mt.lib(txt_db.obj) : error LNK2001: unresolved external symbol fprintf
        libeay32mt.lib(eng_openssl.obj) : error LNK2001: unresolved external symbol fprintf
        libeay32mt.lib(pem_lib.obj) : error LNK2001: unresolved external symbol fprintf
        libeay32mt.lib(gost_eng.obj) : error LNK2001: unresolved external symbol fprintf
        libeay32mt.lib(ui_openssl.obj) : error LNK2001: unresolved external symbol fprintf
        libeay32mt.lib(gost_eng.obj) : error LNK2019: unresolved external symbol printf referenced in function bind_gost
        libeay32mt.lib(pqueue.obj) : error LNK2001: unresolved external symbol printf
        libeay32mt.lib(e_cswift.obj) : error LNK2019: unresolved external symbol sprintf referenced in function cswift_mod_exp
        libeay32mt.lib(dso_win32.obj) : error LNK2001: unresolved external symbol sprintf
        build\lib.win-amd64-3.5\cryptography\_Cryptography_cffi_89292e72x399b1113.cp35-win_amd64.pyd : fatal error LNK1120: 7 unresolved externals

    error: command 'C:\\Program Files (x86)\\Microsoft\\Visual Studio\\14.0\\VC\\BIN\\amd64\\link.exe' failed with exit status 1120

    ----------------------------------------
    Command "C:\ProgramData\Runtime\Python\python.exe -c "import setuptools, tokenize;__file__='S:\\Temp\\Local\\pip-build-j3dfyfa3\\cryptography\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record S:\Temp\Local\pip-igpv1y8a-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in S:\Temp\Local\pip-build-j3dfyfa3\cryptography

Windows user creation error due to special characters or signs

I want to create a local user in windows which the user name contains "@". Lets say this way I want to use somebody's email address and create a local windows account with his email address like "foo(at)bar.com". Is there any work around to bypass the windows error for the "@" and "." issue? I've tried this with the windows GUI and command line but still getting the same error, My Os is Windows 2008 R2.

How to open a file WinAPI, (Visual c++)

really simple, open a file using winapi, like this guy https://www.youtube.com/watch?v=6jR78lp8Ar0 . but he is doing in windows form application, i would like to know for win32 console application

USB-Printer printing progress information

I need to write a program that finds all connected USB-printers of a Windows PC and send a file to a selected printer from this list. These two points are no problem and work pretty fine

First point

        var printerQuery = new ManagementObjectSearcher("SELECT * from Win32_Printer");
        i = 1;
        foreach (var printer in printerQuery.Get())
        {
            var name = printer.GetPropertyValue("Name");
            var status = printer.GetPropertyValue("Status");
            var isDefault = printer.GetPropertyValue("Default");
            var isNetworkPrinter = printer.GetPropertyValue("Network");
            var PortName = printer.GetPropertyValue("PortName");
            bool Connected = (bool)printer.GetPropertyValue("WorkOffline");
            var Caption = printer.GetPropertyValue("Caption");

            string s = "Name: " + name;
            string nbr = "";
            if (i.ToString().Length < 2) nbr = "0";
            nbr += i.ToString();
            listBoxUSBInfo.Items.Add(nbr + ": " + s);
            listBoxUSBInfo.Items.Add("      Status: " + status);
            listBoxUSBInfo.Items.Add("      Default: " + isDefault);
            listBoxUSBInfo.Items.Add("      Network: " + isNetworkPrinter);
            listBoxUSBInfo.Items.Add("      PortName: " + PortName);
            if ( Connected) listBoxUSBInfo.Items.Add("      Connected: True");
            if (!Connected) listBoxUSBInfo.Items.Add("      Connected: False");
            listBoxUSBInfo.Items.Add("      Caption: " + Caption);

            i++;
        }

Second point

Is quite easy:

The class "RawPrinterHelper" is well known in this forum, I think

RawPrinterHelper.SendFileToPrinter("PrinterName", "FileName");

But now my problem.

I must print very large files (more than 100.000 pages) and the operator wants to see, how many pages are currently printed. Is it possible to get this information? For example every 3 seconds, so that I can display at on the screen.

Netbeans Become very Slow when pc are connected through internet

i am using netbeans IDE 7.3.1 . but when ever i run a java web based project and connect internet to my pc, then my browser and netbeans IDE both become very slow . how can i resolve this issue ? is there any solution ? is there hardware issue regarding slowness ??

Delphi: Creating and Reading a text file is causing an I/O 32 error. Should this be prevented using sleep?

I am currently working on a program that needs to be able to report whether or not Windows has been activated.

function TSoftwareReport.getLicenceInfo : String;
var
  Activated : String;
  LicenceFile : TextFile;
begin
  // redirect command output to txt file
  ShellExecute(0,nil,'cmd.exe', '/C cscript %windir%\system32\slmgr.vbs/xpr > C:\Activated.txt', nil, SW_HIDE);
  //Read the file
  Sleep(1000);
  AssignFile(LicenceFile, 'C:\Activated.txt');
  Reset(LicenceFile);
  while not Eof(LicenceFile) do
  begin
    ReadLn(LicenceFile,Activated);
    if AnsiContainsText(Activated, 'Permanently') then
    begin
      Activated := 'Permanent';
      Break;
    end;
  end;
  //cleanup file
  CloseFile(LicenceFile);
  DelDir('C:\Activated.txt');
  Result := Activated;
end;

Currently I am using the ShellExecute and redirecting the output to a text file, that I then want to read in order to find out if Windows has been activated.

The problem I am having is that when I go to do the ShellExecute line followed by the AssignFile line I get an I/O 32 error. I suspect that this is due to ShellExecute not closing the file before I attempt to access it with "AssignFile". Which is why I now have the Sleep() line in. The problem with this is that I don't know how long I should be sleeping for as performance will be different across machines.

I tried writing code that would try running the AssignFile line and if that fails, then sleep() and try again but now I'm throwing exceptions on purpose. The whole thing just feels hacky and badly written. I already feel bad about having to redirect the output from shellexecute to a text file.

So the question is, Should I be using sleep, and if so how do I decide how long to sleep for? Should I be using an alternative?

Git on Windows not working with remote because of "SSL protocol" errors

tl;dr

Git on Windows stops connecting to github because of mysterious "SSL protocol" errors. Halp!

The Issue

I'm developing on Windows, using a private GitHub repo for source control. When I first boot my system, I'm able to access the remote repo without issue - pull, push, fetch, etc. all work just fine.

After some amount of time(*), this stops, and I get the following error:

fatal: unable to access 'http://ift.tt/1JC7YVi': Unknown SSL protocol error in connection to github.com:443

(*) The amount of time seems variable - I've witnessed as little as an hour or two, up to a whole day. Usually after coming back from the system sleeping, it seems to be an issue, but I don't know if it's caused by a time delay or by the system sleeping.

Checking via cURL, I get

λ curl -v "http://ift.tt/1JC7YVi"
*   Trying 192.30.252.130...
* Connected to github.com (192.30.252.130) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
  CApath: none
* TLSv1.0, TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to github.com:443
* Closing connection 0
curl: (35) Unknown SSL protocol error in connection to github.com:443

Using set GIT_CURL_VERBOSE=1 with git pull shows similar information. Sometimes it succeeds (see below), but most of the time it fails.

Further Notes

There's a little bit of a sporadic nature to it - sometimes I can get requests to succeed, but once it starts exploding, it's generally broken 9 out of 10 requests or more.

A successful cURL request looks like:

λ curl -v "http://ift.tt/1JC7YVi"
*   Trying 192.30.252.130...
* Connected to github.com (192.30.252.130) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
  CApath: none
* TLSv1.0, TLS handshake, Client hello (1):
* TLSv1.0, TLS handshake, Server hello (2):
* TLSv1.0, TLS handshake, CERT (11):
* TLSv1.0, TLS handshake, Server finished (14):
* TLSv1.0, TLS handshake, Client key exchange (16):
* TLSv1.0, TLS change cipher, Client hello (1):
* TLSv1.0, TLS handshake, Finished (20):
* TLSv1.0, TLS change cipher, Client hello (1):
* TLSv1.0, TLS handshake, Finished (20):
* SSL connection using TLSv1.0 / AES128-SHA
* Server certificate:
*        subject: businessCategory=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; serialNumber=5157550; street=548 4th Street; postalCode=94107; C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com
*        start date: 2014-04-08 00:00:00 GMT
*        expire date: 2016-04-12 12:00:00 GMT
*        subjectAltName: github.com matched
*        issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
*        SSL certificate verify ok.
> GET /our-team/private-repo.git/ HTTP/1.1
> User-Agent: curl/7.41.0
> Host: github.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: GitHub.com
< Date: Mon, 11 May 2015 15:19:43 GMT
< Content-Type: text/html
< Content-Length: 178
< Location: http://ift.tt/1Pe36wi
< Vary: Accept-Encoding
< X-Served-By: 76f8aa18dab86a06db6e70a0421dc28c
<
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
* Connection #0 to host github.com left intact

The Question

I've googled a good bit on trying to find this (over the course of several weeks, so I don't have links), but most suggestions seem to point at certificate errors or OpenSSL version mismatches / bugs (which wouldn't be sporadic like this AFAIK).

What might be causing this failure, and how can I resolve it?

Relevant Software:

λ git --version
git version 1.9.5.msysgit.1

λ curl --version
curl 7.41.0 (i386-pc-win32) libcurl/7.41.0 OpenSSL/0.9.8zf zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz

assembly - Calling dll functions

I wish to know how can I call a function of a .dll from assembly code, how do I get the address, and where the value returned from the function is stored. Thanks in advance.

import comma separated text data to java database table

I have several large MS Access databases (e.g. 1gb each file), which I want to import to JavaDB Derby database so that whole application can be switched to Java platform. I'm using Windows 7 64 bit/ Netbeans 8.0 (which no more supports JDBC-ODBC). I am using "ucanaccess" to connect to such a large MS access database, now the problem is that the system either takes infinitely long or stops responding, while trying to connet to the MS access database. Is there any other faster and more efficient way to import/ convert such large Access databases (almost 200 databases, 1gb each).

How to execute code during windows form [C++]

I was wondering how I'd Execute my network code during the form is running because if I put it in the comment area where it says "Code To Execute here" it will run AFTER the form exists but not DURING when it's running.

#include "Mouse.h"
#include <SFML\System.hpp>
#include <SFML\Network.hpp>
#include <SFML\Audio.hpp>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <Windows.h>

using namespace std;
using namespace System;
using namespace System::Windows::Forms;

[STAThread]

int main(array<String^>^ arg) {
    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false);

    Administration::Mouse form;
    Application::Run(%form)

    /* code i wanted to execute goes here */

}

Thanks in Advance

How to kill a process in python 2.5 on windows 64bit platform?

I have a python script by which i am opening three executable files as follows:

Aa=subprocess.Popen([r"..\location\learning\A.exe"])
Bb=subprocess.Popen([r"..\location\learning\new\B.bat"])
Cc=subprocess.Popen([r"..\location\learning\new\B.bat"])

All the three files are getting opened. Now,next step i want kill these three opened modules.So, firstly i tried to kill "Aa" as follows:

PROCESS_TERMINATE= 1
k = ctypes.windll.kernel32klll
handle = k.OpenProcess(PROCESS_TERMINATE, False,Aa.pid)
k.TerminateProcess(handle, -1)
k.CloseHandle(handle)

But after adding these piece of lines the three modules 'Aa','Bb' and 'Cc' they don't gets opened.So,i want to know some clean solution so that firstly all the three modules gets executed and then after a while they get closed itself. As,i am using python 2.5 on windows 64 bit platform so kindly suggest solution accordingly.

For loop reading file names with spaces

I'm trying to scan files in directorys for text inside, but whenever I come across a file that has the ' - Copy' added to the end of it from windows, the program will not read it. I've tried using quotes within the name being passed, but no dice.

FOR /R %%F in (*.CDP) do (
    for /f "tokens=*" %%a in (%%~nxF) do (

I've been using this code and have no issues with the typical files Im seeing. however if its something like dummy_file - Copy, I will get an error from the program saying 'System cannot find the file dummy_file.' period included. If I use

FOR /R %%F in (*.CDP) do (
        for /f "tokens=*" %%a in ("%%~nxF") do (

Then the second for loop gets skipped, and the program proceeds on. I thought this would made the loop take it as a string literal, but apparently the for loop has its own way of reading things.

Is it possible to accept files in this loop that have a - Copy in them? Will I be able to use dummy_file - Copy.cdp here?

Windows Phone 8.1 Development - Get data from a list to populate answers on a page

I'm attempting to build a sort of quiz for Windows Phone 8.1 using C# and XAML, and I want to add questions and answers to a list/array, and then on the page each line from that list/array populates the buttons and textblocks on the page.

I originally wanted to do this from a text file instead of a list or array but this seemed a lot more complicated than I first thought.

I'm wondering if anyone can point me in the right direction?

Thanks.

Alternative of subInACL to grant permissions to a service ?

Here I have a scenario where I can use subInACL to grant START/STOP/PAUSE permissions to MSSQLSERVER and SQLSERVERAGENT with "NT AUTHORITY\NETWORK SERVICE" account .

subinacl.exe /service MSSQLSERVER /grant="NT AUTHORITY\MSSQLSERVER"=PTO

subinacl.exe /service SQLSERVERAGENT /grant="NT AUTHORITY\SQLSERVERAGENT"=PTO

The above two commands work fine and resolve the Access Denied issue when I start/stop the service using xp_servicecontrol .

However I was looking for an alternative to do the same without having to donwload subInACL and then use it . Any help on this will be much appreciated!

C# Windows Store App can't seem to execute Bat.file

I'm in the middle of creating a POS app, which is meant to run in Kiosk mode on a device with no keyboard (both normal and on-screen).

Therefore it is very important for me, to be able to do 2 things from inside the app.

  1. Shutdown Windows

and

  1. Restart Windows

To my understanding it's not possible to access process.Start - Hence I created 2 batch files, which is working perfect when double-clicked on my desktop.

c# file not found exeption after app starts on startup

I have problem with my app. When i run it by myself all works perfect. But when my app start from startup I have System.IO.FileNotFoundException. I add my app on startup by following code:

RegistryKey wowNode = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Run", true);

wowNode.SetValue("myApp", System.Reflection.Assembly.GetEntryAssembly().Location);

and when my app start after reboot I have System.IO.FileNotFoundException all files are in the same directory with .exe file

Can someone help me with this?

code I use for read file:

names = File.ReadAllLines("name.txt");

Frame navigation issue while using Drawer Layout in windows phone 8.1

I am developing a Windows Phone App 8.1 using a third party DrawerLayout. My problem is when I have design the page using draweralayout. I need to pass the same layout to each other pages in my application. but when i use bold Frame.navigate(typeof(Page1)); the application is crashed. I am unable to debug the problem. please help!!!

My Xaml Code is

<Grid x:Name="Rootlayout">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>
    <!-- title bar-->
    <Grid x:Name="TitleBar" Height="50" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Background="SkyBlue">
        <Image  Source="/Assets/fs-logo.png" Height="50" HorizontalAlignment="Left" Margin="10,0,0,0"/>
    </Grid>
    <!--Drawer Layout-->
    <drawer:DrawerLayout x:Name="DrawerLayout" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
        <!--Main Layout-->
        <Grid x:Name="mainLayout" Background="White" >
            <ScrollViewer>
                <Grid Margin="5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Image x:Name="mainImage" Grid.Row="0" Source="{Binding }"></Image>
                    <GridView x:Name="grdView" Grid.Row="1" ItemsSource="{Binding }" ItemContainerStyle="{StaticResource GridViewItemContainer}" Tapped="grdView_Tapped" >
                        <GridView.ItemTemplate>
                            <DataTemplate>
                                <Border BorderThickness="1" BorderBrush="Blue">
                                <Grid Height="{Binding Size}"
                                      Width="{Binding Size}">
                                    <Image Height="120" Width="150" Source="{Binding sImageURL}" Stretch="Fill">

                                    </Image>
                                    <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Bottom" Foreground="Black" FontSize="18"/>
                                </Grid>
                                </Border>
                            </DataTemplate>
                        </GridView.ItemTemplate>
                        <GridView.ItemsPanel>
                            <ItemsPanelTemplate>
                                <ItemsWrapGrid Orientation="Horizontal"></ItemsWrapGrid>
                            </ItemsPanelTemplate>
                        </GridView.ItemsPanel>
                    </GridView>
                </Grid>
            </ScrollViewer>
        </Grid>
        <!--Drawer Layout-->
        <Grid x:Name="listFragment" FlowDirection="LeftToRight" >
            <ListView x:Name="listItem" SelectionChanged="listItem_SelectionChanged">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" FontSize="20" Foreground="Black" Margin="10" VerticalAlignment="Center" HorizontalAlignment="Left"/>      
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </Grid>
    </drawer:DrawerLayout>
    <Image Grid.Row="1" Grid.Column="0" Height="50" Width="50" Source="/Assets/appbar.right.png" Tapped="chevlon_Tapped">

    </Image>
</Grid>

My MainPage.cs

 public sealed partial class MainPage : Page
{
    private NavigationHelper navigationHelper;
    private ObservableDictionary defaultViewModel = new ObservableDictionary();

    List<Services.Company> companyData;
    List<Services.Category> categoryData;

    public MainPage()
    {
        this.InitializeComponent();

        Loaded += MainPage_Loaded;
        this.navigationHelper = new NavigationHelper(this);
        this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
        this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
        this.NavigationCacheMode = NavigationCacheMode.Required;
    }

   async void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
       await  Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();


      // SetGridViewItemSize();        
            //throw new NotImplementedException();
    }
   /// <summary>
   /// Gets the <see cref="NavigationHelper"/> associated with this <see cref="Page"/>.
   /// </summary>
   public NavigationHelper NavigationHelper
   {
       get { return this.navigationHelper; }
   }

   /// <summary>
   /// Gets the view model for this <see cref="Page"/>.
   /// This can be changed to a strongly typed view model.
   /// </summary>
   public ObservableDictionary DefaultViewModel
   {
       get { return this.defaultViewModel; }
   }

   private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
   {
       if (e.PageState != null)
       {

          // this.DefaultViewModel["MainPage"] = (MainPage)e.PageState["MainPage"];
           // Restore scroll offset
           var index = (int)e.PageState["FirstVisibleItemIndex"];
           var container = grdView.ContainerFromIndex(index);
           grdView.ScrollIntoView(container);



       }
       else
       {
           //Load Data for the First time

           DrawerLayout.InitializeDrawerLayout();
           var company = await Services.CompCatInfo.GetCompaniesAsync(App.compId);
           companyData = company.ToList();
           if (companyData.Count > 0)
           {
               mainImage.Source = new BitmapImage(new Uri(companyData.ElementAt(0).LogoImgUrl, UriKind.Absolute));
           }
           var category = await Services.CompCatInfo.GetCategoriesAsync(App.compId);
           categoryData = category.ToList();

           SetGridViewItemSize();
           if (categoryData.Count > 0)
           {
               grdView.ItemsSource = categoryData;
           }


       }

   }
   private void NavigationHelper_SaveState(object sender, SaveStateEventArgs e)
   {
       var isp = (ItemsWrapGrid)grdView.ItemsPanelRoot;
       int firstVisibleItem = isp.FirstVisibleIndex;
       e.PageState["FirstVisibleItemIndex"] = firstVisibleItem;
      // e.PageState["HomePage"] = this.Frame.CurrentSourcePageType;
       // This must be serializable according to the SuspensionManager
       //e.PageState["MainPage"] = this.DefaultViewModel["MainPage"];
   }
   private void SetGridViewItemSize()
   {
       //var viewModel = (DataContext as ViewModel1);

       var width = Math.Truncate((grdView.ActualWidth - 10));
       var height = Math.Truncate((grdView.ActualHeight - 10));

       // total left + right margin for each tile (ItemContainerStyle)
       var margin = 10;
       var twoColumnGridPortrait = (width / 2) - margin;
     //  var threeColumnGridPortrait = (width / 3) - margin;
       var twoColumnGridLandscape = (height / 2) - margin;
       var threeColumnGridLandscape = (height / 3) - margin;
       double portrait;
       double landscape;
       portrait = twoColumnGridPortrait;
       landscape = threeColumnGridLandscape;

       Application.Current.Resources["GridViewItemPortrait"] = Math.Round(portrait, 2);
       Application.Current.Resources["GridViewItemLandscape"] = Math.Round(landscape, 2);

       if (DisplayInformation.GetForCurrentView().CurrentOrientation == DisplayOrientations.Portrait)
       {
           Measure((double)Application.Current.Resources["GridViewItemPortrait"]);
       }
       else
       {
           Measure((double)Application.Current.Resources["GridViewItemLandscape"]);
       }
      // throw new NotImplementedException();
   }

   private void Measure(double size)
   {
       for (int i = 0; i < categoryData.Count; i++)
       {
           var item = categoryData[i];
           item.Size = size;
       }
       //throw new NotImplementedException();
   }
   #region NavigationHelper registration
   /// <summary>
    /// Invoked when this page is about to be displayed in a Frame.
    /// </summary>
    /// <param name="e">Event data that describes how this page was reached.
    /// This parameter is typically used to configure the page.</param>
    protected override void OnNavigatedTo(NavigationEventArgs e)
   {
       this.navigationHelper.OnNavigatedTo(e);




        //if (e.NavigationMode == NavigationMode.New)
        //{
        //    DrawerLayout.InitializeDrawerLayout();
        //    var company = await Services.CompCatInfo.GetCompaniesAsync(App.compId);
        //    companyData = company.ToList();
        //    if (companyData.Count > 0)
        //    {
        //        mainImage.Source = new BitmapImage(new Uri(companyData.ElementAt(0).LogoImgUrl, UriKind.Absolute));
        //    }
        //    var category = await Services.CompCatInfo.GetCategoriesAsync(App.compId);
        //    categoryData = category.ToList();
        //    SetGridViewItemSize();
        //    grdView.ItemsSource = categoryData;
        //}
        //else 
        //{
        //   // this.Frame.Content = e.Content;

        //}
        // TODO: Prepare page for display here.

        // TODO: If your application contains multiple pages, ensure that you are
        // handling the hardware Back button by registering for the
        // Windows.Phone.UI.Input.HardwareButtons.BackPressed event.
        // If you are using the NavigationHelper provided by some templates,
        // this event is handled for you.
    }

    protected override void OnNavigatedFrom(NavigationEventArgs e)
    {
        this.navigationHelper.OnNavigatedFrom(e);
    }

   #endregion

    private void chevlon_Tapped(object sender, TappedRoutedEventArgs e)
    {
        string[] list = new string[] { "Services","Solutions","Technologies","About Us"};
        listItem.ItemsSource = list.ToList();
        if(DrawerLayout.IsDrawerOpen)
        {
            DrawerLayout.CloseDrawer();
        }
        else
        {
            DrawerLayout.OpenDrawer();
        }
    }

    private void listItem_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (listItem.SelectedItem != null)
        {
            var selecteditem = listItem.SelectedValue as string;
           // DetailsTxtBlck.Text = "SelectedItem is: " + selecteditem;
            DrawerLayout.CloseDrawer();
            listItem.SelectedItem = null;
        }

    }

    private void grdView_Tapped(object sender, TappedRoutedEventArgs e)
    {
        DrawerLayout.CloseDrawer();
        if(e.OriginalSource.GetType().ToString()=="Windows.UI.Xaml.Controls.Image"||e.OriginalSource.GetType().ToString()=="Windows.UI.Xaml.Controls.TextBlock")
        {
            var catObj = (sender as GridView).SelectedItem as Services.Category;
            ////Frame rootFrame = Window.Current.Content as Frame;
            ////rootFrame.Navigate(typeof(Page2),catObj);
           Frame.Navigate(typeof(Page2),catObj);

        }

    }
}

Windows Authentication in Microsoft Edge (Spartan) Does Not Prompt for Credentials

I have started to take a look at some of my apps on Microsoft Edge in the Windows 10 Preview build. The biggest issue I had up front, was that any of my internal sites that used Windows Authentication are not accessible (and these sites are recently developed applications that should be Spartan friendly from technology and layout perspective, which is why I want to utilize them in the latest browser).

For sites with Windows Authentication (which work fine on Chrome, Firefox, etc), I receive the following server error: 401 - Unauthorized: Access is denied due to invalid credentials.

This error is normal if I input the incorrect windows credentials in Chrome / Firefox / IE. However, on Edge I am never prompted for Windows credentials?

Is this functionality just not complete on Edge? Not planned for Edge? A bug? Or did I miss a setting somewhere that I overlooked on Edge?

Targeting the MONO Runtime causes Xamarin Build to fail

After creating a simple .NET console application in Xamarin Studio, I can build/debug fine if the default Target Runtime is set to 'Microsoft .NET'.

If I set the runtime to MONO ('Mono 4.0.1'), then my project no longer builds.

The error is:

Error: Unknown MSBuild failure. Please try building the project again

The build output window shows everything succeeding up until the last line, which displays Build: 1 error, 0 warnings":

Is targeting the MONO Runtime in this way not valid? A related question here indicates that it is...

What am I doing wrong?

Running Windows7 (64 bit), Xamarin Studio 5.9. Mono 4.0.1, .NET 4.5

The build output is as follows:

Cleaning Solution: XamarinTest (Debug)

Cleaning: XamarinTest (Debug)

Build started 05/08/2015 16:57:03. __________________________________________________ Project "C:\Development\Test\XamarinTest\XamarinTest\XamarinTest.csproj" (Clean target(s)): Target CoreClean: Deleting file 'C:\Development\Test\XamarinTest\XamarinTest\obj\Debug.NETFramework,Version=v4.5.AssemblyAttribute.cs' Deleting file 'C:\Development\Test\XamarinTest\XamarinTest\bin\Debug\XamarinTest.dll.mdb' Deleting file 'C:\Development\Test\XamarinTest\XamarinTest\bin\Debug\XamarinTest.dll' Deleting file 'C:\Development\Test\XamarinTest\XamarinTest\obj\Debug\XamarinTest.dll' Deleting file 'C:\Development\Test\XamarinTest\XamarinTest\obj\Debug\XamarinTest.dll.mdb' Deleting file 'C:\Development\Test\XamarinTest\XamarinTest\obj\Debug\XamarinTest.csproj.FilesWrittenAbsolute.txt' Done building project "C:\Development\Test\XamarinTest\XamarinTest\XamarinTest.csproj".

Build succeeded. 0 Error(s) 0 Warning(s)

Time Elapsed 00:00:00.1350135

Cleaning: XamConsole (Debug)

Build started 05/08/2015 16:57:04. __________________________________________________ Project "C:\Development\Test\XamarinTest\XamConsole\XamConsole.csproj" (Clean target(s)): Target CoreClean: Deleting file 'C:\Development\Test\XamarinTest\XamConsole\obj\Debug\XamConsole.exe' Done building project "C:\Development\Test\XamarinTest\XamConsole\XamConsole.csproj".

Build succeeded. 0 Warning(s) 0 Error(s)

Time Elapsed 00:00:00.0170017

Building Solution: XamarinTest (Debug)

Building: XamarinTest (Debug)

Build started 05/08/2015 16:57:04. __________________________________________________ Project "C:\Development\Test\XamarinTest\XamarinTest\XamarinTest.csproj" (Build target(s)): Target PrepareForBuild: Configuration: Debug Platform: AnyCPU Target GenerateSatelliteAssemblies: No input files were specified for target GenerateSatelliteAssemblies, skipping. Target CoreCompile: Tool C:\Program Files (x86)\Mono\lib\mono\4.5\mcs.exe execution started with arguments: /noconfig /debug:full /debug+ /optimize- /out:obj\Debug\XamarinTest.dll MyClass.cs Properties\AssemblyInfo.cs obj\Debug.NETFramework,Version=v4.5.AssemblyAttribute.cs /target:library /define:DEBUG /nostdlib /reference:"C:\Program Files (x86)\Mono\lib\mono\4.5..\xbuild-frameworks.NETFramework\v4.5\RedistList........\4.5\System.dll" /reference:"C:\Program Files (x86)\Mono\lib\mono\4.5..\xbuild-frameworks.NETFramework\v4.5\RedistList........\4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Mono\lib\mono\4.5\mscorlib.dll" /warn:4 Target DeployOutputFiles: Copying file from 'C:\Development\Test\XamarinTest\XamarinTest\obj\Debug\XamarinTest.dll.mdb' to 'C:\Development\Test\XamarinTest\XamarinTest\bin\Debug\XamarinTest.dll.mdb' Copying file from 'C:\Development\Test\XamarinTest\XamarinTest\obj\Debug\XamarinTest.dll' to 'C:\Development\Test\XamarinTest\XamarinTest\bin\Debug\XamarinTest.dll' Done building project "C:\Development\Test\XamarinTest\XamarinTest\XamarinTest.csproj".

Build succeeded. 0 Warning(s) 0 Error(s)

Time Elapsed 00:00:08.6528652

---------------------- Done ----------------------

Build: 1 error, 0 warnings

C# admin service: log user into desktop, spawn a process that can interact with the desktop

I'm having a difficult time getting a very specific use case to work. The application in question has two components: a Windows service, which needs to run in a privileged context outside of the desktop (i.e. to accept connections while a user is logged in or not) and a client Winforms app. The service accepts websocket connections, and should the connection request succeed, it is supposed to log the user in interactively (into the desktop) and spawn a process as that user with desktop access. I've used the following links, and while they are able to impersonate a user, they don't actually log the user into the desktop, i.e. if I watch the system using VNC, or if I test it on my local system, the user doesn't get logged in. The process does, however, get spawned as the user, but obviously not with desktop access.

Does anyone have a code sample that will log a user into the desktop?

The links and code I've tried:

Using Process.Start() to start a process as a different user from within a Windows Service

How to use LogonUser properly to impersonate domain user from workgroup client public

Launch a process under another user's credentials

http://ift.tt/1QBszNw

The current code is:

using Cassia;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.DirectoryServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Security.Principal;
using System.ServiceProcess;

namespace program
{
    public partial class service
    {
        #region Interop

        [StructLayout(LayoutKind.Sequential)]
        public struct LUID
        {
            public UInt32 LowPart;
            public Int32 HighPart;
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct LUID_AND_ATTRIBUTES
        {
            public LUID Luid;
            public UInt32 Attributes;
        }

        public struct TOKEN_PRIVILEGES
        {
            public UInt32 PrivilegeCount;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
            public LUID_AND_ATTRIBUTES[] Privileges;
        }

        enum TOKEN_INFORMATION_CLASS
        {
            TokenUser = 1,
            TokenGroups,
            TokenPrivileges,
            TokenOwner,
            TokenPrimaryGroup,
            TokenDefaultDacl,
            TokenSource,
            TokenType,
            TokenImpersonationLevel,
            TokenStatistics,
            TokenRestrictedSids,
            TokenSessionId,
            TokenGroupsAndPrivileges,
            TokenSessionReference,
            TokenSandBoxInert,
            TokenAuditPolicy,
            TokenOrigin,
            TokenElevationType,
            TokenLinkedToken,
            TokenElevation,
            TokenHasRestrictions,
            TokenAccessInformation,
            TokenVirtualizationAllowed,
            TokenVirtualizationEnabled,
            TokenIntegrityLevel,
            TokenUIAccess,
            TokenMandatoryPolicy,
            TokenLogonSid,
            MaxTokenInfoClass
        }

        [Flags]
        enum CreationFlags : uint
        {
            CREATE_BREAKAWAY_FROM_JOB = 0x01000000,
            CREATE_DEFAULT_ERROR_MODE = 0x04000000,
            CREATE_NEW_CONSOLE = 0x00000010,
            CREATE_NEW_PROCESS_GROUP = 0x00000200,
            CREATE_NO_WINDOW = 0x08000000,
            CREATE_PROTECTED_PROCESS = 0x00040000,
            CREATE_PRESERVE_CODE_AUTHZ_LEVEL = 0x02000000,
            CREATE_SEPARATE_WOW_VDM = 0x00001000,
            CREATE_SUSPENDED = 0x00000004,
            CREATE_UNICODE_ENVIRONMENT = 0x00000400,
            DEBUG_ONLY_THIS_PROCESS = 0x00000002,
            DEBUG_PROCESS = 0x00000001,
            DETACHED_PROCESS = 0x00000008,
            EXTENDED_STARTUPINFO_PRESENT = 0x00080000
        }

        public enum TOKEN_TYPE
        {
            TokenPrimary = 1,
            TokenImpersonation
        }

        public enum SECURITY_IMPERSONATION_LEVEL
        {
            SecurityAnonymous,
            SecurityIdentification,
            SecurityImpersonation,
            SecurityDelegation
        }

        [Flags]
        enum LogonFlags
        {
            LOGON_NETCREDENTIALS_ONLY = 2,
            LOGON_WITH_PROFILE = 1
        }

        enum LOGON_TYPE
        {
            LOGON32_LOGON_INTERACTIVE = 2,
            LOGON32_LOGON_NETWORK,
            LOGON32_LOGON_BATCH,
            LOGON32_LOGON_SERVICE,
            LOGON32_LOGON_UNLOCK = 7,
            LOGON32_LOGON_NETWORK_CLEARTEXT,
            LOGON32_LOGON_NEW_CREDENTIALS
        }

        enum LOGON_PROVIDER
        {
            LOGON32_PROVIDER_DEFAULT,
            LOGON32_PROVIDER_WINNT35,
            LOGON32_PROVIDER_WINNT40,
            LOGON32_PROVIDER_WINNT50
        }

        struct SECURITY_ATTRIBUTES
        {
            public uint Length;
            public IntPtr SecurityDescriptor;
            public bool InheritHandle;
        }

        [Flags]
        enum SECURITY_INFORMATION : uint
        {
            OWNER_SECURITY_INFORMATION = 0x00000001,
            GROUP_SECURITY_INFORMATION = 0x00000002,
            DACL_SECURITY_INFORMATION = 0x00000004,
            SACL_SECURITY_INFORMATION = 0x00000008,
            UNPROTECTED_SACL_SECURITY_INFORMATION = 0x10000000,
            UNPROTECTED_DACL_SECURITY_INFORMATION = 0x20000000,
            PROTECTED_SACL_SECURITY_INFORMATION = 0x40000000,
            PROTECTED_DACL_SECURITY_INFORMATION = 0x80000000
        }

        [StructLayoutAttribute(LayoutKind.Sequential)]
        struct SECURITY_DESCRIPTOR
        {
            public byte revision;
            public byte size;
            public short control; // public SECURITY_DESCRIPTOR_CONTROL control;
            public IntPtr owner;
            public IntPtr group;
            public IntPtr sacl;
            public IntPtr dacl;
        }

        struct STARTUPINFO
        {
            public uint cb;
            [MarshalAs(UnmanagedType.LPTStr)]
            public string Reserved;
            [MarshalAs(UnmanagedType.LPTStr)]
            public string Desktop;
            [MarshalAs(UnmanagedType.LPTStr)]
            public string Title;
            public uint X;
            public uint Y;
            public uint XSize;
            public uint YSize;
            public uint XCountChars;
            public uint YCountChars;
            public uint FillAttribute;
            public uint Flags;
            public ushort ShowWindow;
            public ushort Reserverd2;
            public byte bReserverd2;
            public IntPtr StdInput;
            public IntPtr StdOutput;
            public IntPtr StdError;
        }

        [StructLayout(LayoutKind.Sequential)]
        struct PROCESS_INFORMATION
        {
            public IntPtr Process;
            public IntPtr Thread;
            public uint ProcessId;
            public uint ThreadId;
        }

        [DllImport("advapi32.dll", SetLastError = true)]
        static extern bool InitializeSecurityDescriptor(IntPtr pSecurityDescriptor, uint dwRevision);
        const uint SECURITY_DESCRIPTOR_REVISION = 1;

        [DllImport("advapi32.dll", SetLastError = true)]
        static extern bool SetSecurityDescriptorDacl(ref SECURITY_DESCRIPTOR sd, bool daclPresent, IntPtr dacl, bool daclDefaulted);

        [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        extern static bool DuplicateTokenEx(
            IntPtr hExistingToken,
            uint dwDesiredAccess,
            ref SECURITY_ATTRIBUTES lpTokenAttributes,
            SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
            TOKEN_TYPE TokenType,
            out IntPtr phNewToken);

        [DllImport("advapi32.dll", SetLastError = true)]
        public static extern bool LogonUser(
            string lpszUsername,
            string lpszDomain,
            string lpszPassword,
            int dwLogonType,
            int dwLogonProvider,
            out IntPtr phToken
            );

        [DllImport("advapi32.dll", SetLastError = true)]
        static extern bool GetTokenInformation(
            IntPtr TokenHandle,
            TOKEN_INFORMATION_CLASS TokenInformationClass,
            IntPtr TokenInformation,
            int TokenInformationLength,
            out int ReturnLength
            );

        [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        static extern bool CreateProcessAsUser(
            IntPtr Token,
            [MarshalAs(UnmanagedType.LPTStr)] string ApplicationName,
            [MarshalAs(UnmanagedType.LPTStr)] string CommandLine,
            ref SECURITY_ATTRIBUTES ProcessAttributes,
            ref SECURITY_ATTRIBUTES ThreadAttributes,
            bool InheritHandles,
            uint CreationFlags,
            IntPtr Environment,
            [MarshalAs(UnmanagedType.LPTStr)] string CurrentDirectory,
            ref STARTUPINFO StartupInfo,
            out PROCESS_INFORMATION ProcessInformation);

        [DllImport("Kernel32.dll")]
        extern static int CloseHandle(IntPtr handle);

        [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
        internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen);

        [DllImport("advapi32.dll", SetLastError = true)]
        internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid);

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        internal struct TokPriv1Luid
        {
            public int Count;
            public long Luid;
            public int Attr;
        }

        internal const int SE_PRIVILEGE_ENABLED = 0x00000002;
        internal const int TOKEN_QUERY = 0x00000008;
        internal const int TOKEN_DUPLICATE = 0x0002;
        internal const int TOKEN_ASSIGN_PRIMARY = 0x0001;

        #endregion

        public static bool LoginUser(string domain, string username, string password, string program, string workingDir)
        {
            IntPtr token = IntPtr.Zero;
            IntPtr primaryToken = IntPtr.Zero;

            try
            {
                bool result = LogonUser(username, domain, password, (int)LOGON_TYPE.LOGON32_LOGON_NETWORK, (int)LOGON_PROVIDER.LOGON32_PROVIDER_DEFAULT, out token);
                if (!result)
                {
                    int winError = Marshal.GetLastWin32Error();
                    Console.WriteLine("LoginUser unable to login user " + username + ", error: " + winError);
                    return false;
                }

                SECURITY_ATTRIBUTES processAttributes = new SECURITY_ATTRIBUTES();
                SECURITY_DESCRIPTOR sd = new SECURITY_DESCRIPTOR();
                IntPtr ptr = Marshal.AllocCoTaskMem(Marshal.SizeOf(sd));
                Marshal.StructureToPtr(sd, ptr, false);
                InitializeSecurityDescriptor(ptr, SECURITY_DESCRIPTOR_REVISION);
                sd = (SECURITY_DESCRIPTOR)Marshal.PtrToStructure(ptr, typeof(SECURITY_DESCRIPTOR));

                result = SetSecurityDescriptorDacl(ref sd, true, IntPtr.Zero, false);
                if (!result)
                {
                    int winError = Marshal.GetLastWin32Error();
                }

                primaryToken = new IntPtr();
                result = DuplicateTokenEx(token, 0, ref processAttributes, SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation, TOKEN_TYPE.TokenPrimary, out primaryToken);
                if (!result)
                {
                    int winError = Marshal.GetLastWin32Error();
                }

                processAttributes.SecurityDescriptor = ptr;
                processAttributes.Length = (uint)Marshal.SizeOf(sd);
                processAttributes.InheritHandle = true;

                SECURITY_ATTRIBUTES threadAttributes = new SECURITY_ATTRIBUTES();
                threadAttributes.SecurityDescriptor = IntPtr.Zero;
                threadAttributes.Length = 0;
                threadAttributes.InheritHandle = false;

                bool inheritHandles = true;
                IntPtr environment = IntPtr.Zero;

                STARTUPINFO startupInfo = new STARTUPINFO();
                startupInfo.Desktop = "";

                PROCESS_INFORMATION processInformation;

                result = CreateProcessAsUser(
                    primaryToken,
                    program,
                    program, 
                    ref processAttributes, 
                    ref threadAttributes, 
                    inheritHandles, 
                    16, 
                    environment, 
                    workingDir,
                    ref startupInfo, 
                    out processInformation);

                if (!result)
                {
                    int winError = Marshal.GetLastWin32Error();
                    Console.WriteLine("LoginUser unable to create process as user " + username + ", error: " + winError);
                    return false;
                }

                return true;
            } 
            catch (Exception e) 
            {
                Console.WriteLine("LoginUser exception encountered: " + e.Message());
                return false;
            } 
            finally
            {
                if (token != IntPtr.Zero)
                {
                    int x = CloseHandle(token);
                    if (x == 0)
                        throw new Win32Exception(Marshal.GetLastWin32Error());
                    x = CloseHandle(primaryToken);
                    if (x == 0)
                        throw new Win32Exception(Marshal.GetLastWin32Error());
                }
            }
        }

        public static SecureString securePassword(string password)
        {
            if (string_null(password)) return null;
            SecureString secure = new SecureString();
            foreach (char c in password)
            {
                secure.AppendChar(c);
            }
            return secure;
        }
    }
}

And my goal is to be able to call it simply as:

if (!LoginUser("machinename", "username", "password", "c:\\path\\to\\program.exe", "c:\\path\\to"))
{
  // error
}
else
{
  // success, user is logged into desktop and app is launch
  // as user with desktop access
}

JAX-WS Kerberos authentication from WebSphere

I'm trying to write a small servlet which is a plugin in a WebSphere application on Linux. The servlet will make web services calls to a service hosted on a Windows server that's part of an AD domain & uses Integrated authentication.

I'll be using JAX-WS and would like to use WS-Security with Kerberos Token authentication. The Kerberos authentication is being mandated by the Windows service because it relies on Windows Auth - something I can't change.

The authentication will be for a single service account in the AD domain - an account dedicated to the servlet which is permissioned within the AD domain.

Does anyone have some pointers on this? I've read the sg247771 (Implementing Kerberos on WAS), but can't locate a scenario which matches the above - same for the WAS docs online. I suspect I'm just missing something obvious. Alternatively any other docs that would explain the configuration I'm after would be great. It's entirely possible that my googling skills have failed and I'm using completely the wrong keywords.....!

Open a window on an extended monitor in windows 8

How do I open a new window on the second screen in a dual monitor setup? This will be initiated from the primary screen.

Windows Command line sort

I have a requirement where I want to read one file content, sort the content and write the sorted content into the same file. Like sorting the file.

I know less about Windows command. I know Windows sort command will help and but I am not aware of writing into the same file.

Need your expert help guys.

Windows Desktop Cordova App Crashing Instalty with no error messages

I'm using Visual Studio 2015 RC to create a Cordova App, it works great on Windows Phone Device, Android Emulator and Device, iOS Ripple, but with Windows Desktop it just bombs out instantly with no indication of what went wrong.

Any idea how to debug this?

Microsoft Band exception: 0xA0D4000A

I recently started a Microsoft Band application for Windows Phone 8.1. The application basically uses UV sensors. But the problem here is not the UV, rather just sending the notification.

The code that sends the notification to the Band looks like (And where it goes to the exception):

await bandClient.NotificationManager.SendMessageAsync(tileGuid, "Title", "Body", DateTimeOffset.Now, MessageFlags.ShowDialog);

The full exception is:

(Exception parameter is below this question)
Handled = false
"Device status code: 0xA0D4000A received"

It is thrown from file App.g.i.cs:

#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
        UnhandledException += (sender, e) =>
        {
            if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
        };
#endif

I searched the web for this exception, but no result. Weird part is, that actually at one point this code worked and sent the notification. It has also sent some exception about "Transport" and "Stream" something, but I cannot re-product those exceptions again right now.

I have done:

  1. Factory reset the Band and reconnect (Unregister and stuff also).
  2. Restart the phone and try other phones.
  3. Moved the notification to be thrown later or earlier in code.

Does anyone happen to have any ideas or such, what could be done and what could be wrong

Exception parameter:

+       Exception   {Microsoft.Band.BandOperationException: Device status code: 0xA0D4000A received.
   at Microsoft.Band.BandClient.CheckStatus(CargoStatus status, CommandStatusHandling statusHandling)
   at Microsoft.Band.BandClient.SendNotification[T](UInt16 notificationId, Guid& tileId, T& notificationInfo, PooledBuffer payload)
   at Microsoft.Band.BandClient.SendMessage(Guid& tileId, String title, String body, DateTimeOffset timestamp, MessageFlags flags, CancellationToken token)
   at Microsoft.Band.BandClient.<>c__DisplayClass11.<SendMessageAsync>b__10()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Uvicorn.PivotPage.<ThrowNotification>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)
   at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()}    System.Exception {Microsoft.Band.BandOperationException}

Cucumber (Java) via Windows command line works via batch, but not pom

I'm running through the examples in the Cucumber For Java book on the Windows command line. I can execute it fine from a Windows batch file, but when attempting to do it from Maven, I'm getting "No sources to compile" and "No tests to run". What is needed in the pom to point to the same classes/features as in the batch?

Full output:

[C:\data_jeffy\code\java\cucumber\learning_cucumber\first_taste\checkout]mvn clean test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Checkout Groceries Example 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ checkout-groceries-example ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ checkout-groceries-example --
-
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platf
orm dependent!
[INFO] skip non existing resourceDirectory C:\data_jeffy\code\java\cucumber\learning_cucumber\first
_taste\checkout\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ checkout-groceries-example ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ checkout-groceries-ex
ample ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platf
orm dependent!
[INFO] skip non existing resourceDirectory C:\data_jeffy\code\java\cucumber\learning_cucumber\first
_taste\checkout\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ checkout-groceries-example
 ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.2:test (default-test) @ checkout-groceries-example ---
[INFO] No tests to run.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.727 s
[INFO] Finished at: 2015-05-10T13:45:48-04:00
[INFO] Final Memory: 8M/155M
[INFO] ------------------------------------------------------------------------

checkout/pom.xml:

<!--
 ! Excerpted from "The Cucumber for Java Book",
 ! published by The Pragmatic Bookshelf.
 ! Copyrights apply to this code. It may not be used to create training material,
 ! courses, books, articles, and the like. Contact us if you are in doubt.
 ! We make no guarantees that this code is fit for any purpose.
 ! Visit http://ift.tt/1H83gOA for more book information.
-->
<project xmlns="http://ift.tt/IH78KX" xmlns:xsi="http://ift.tt/ra1lAU"
    xsi:schemaLocation="http://ift.tt/IH78KX http://ift.tt/HBk9RF">
    <modelVersion>4.0.0</modelVersion>

    <groupId>uk.co.claysnow</groupId>
    <version>1.0</version>
    <packaging>jar</packaging>
    <name>Checkout Groceries Example</name>
    <artifactId>checkout-groceries-example</artifactId>

    <properties>
        <cucumber.version>1.2.0</cucumber.version>
        <junit.version>4.11</junit.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>${cucumber.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>${cucumber.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.2</version>
                <configuration>
                    <argLine>-Duser.language=en</argLine>
                    <argLine>-Xmx1024m</argLine>
                    <argLine>-XX:MaxPermSize=256m</argLine>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                    <useFile>false</useFile>
                </configuration>
             </plugin>
        </plugins>
    </build>

</project>

checkout/features/checkout.feature:

Feature: Checkout
    Scenario: Checkout a banana
        Given the price of a "banana" is 40c
        When I checkout 1 "banana"
        Then the total price should be 40c
    Scenario Outline: Checkout bananas
        Given the price of a "banana" is 40c
        When I checkout <count> "banana"
        Then the total price should be <total>c
        Examples:
        | count | total |
        | 1     | 40    |
        | 2     | 80    |
    Scenario: Two bananas scanned separately
        Given the price of a "banana" is 40c
        When I checkout 1 "banana"
        And I checkout 1 "banana"
        Then the total price should be 80c
    Scenario: A banana and an apple
        Given the price of a "banana" is 40c
        When I checkout 1 "banana"
        And I checkout 1 "apple"
        Then the total price should be 65c

checkout/checkout.bat:

@(
set JAR_DIR=C:\data_jeffy\code\java\cucumber\learning_cucumber\first_taste\checkout\jars\
set CLASSPATH=%JAR_DIR%gherkin-2.12.2.jar;%JAR_DIR%cucumber-jvm-deps-1.0.3.jar;%JAR_DIR%cucumber-java-1.2.2.jar;%JAR_DIR%cucumber-core-1.2.2.jar;%JAR_DIR%junit-4.11.jar;.
)
javac -cp %CLASSPATH% step_definitions/CheckoutSteps.java implementation/Checkout.java
@(
REM java -cp %CLASSPATH% cucumber.api.cli.Main --help
)
java -cp %CLASSPATH% cucumber.api.cli.Main -p progress --snippets camelcase -g step_definitions features

Code for detecting available sd card devices is working for windows phone 8.1 but not for windows desktop 8.1

I have a usb modem in which sd card is there. I am trying to write a code which detects that sd card .

StorageFolder externalDevices = Windows.Storage.KnownFolders.RemovableDevices;

// Get the first child folder, which represents the SD card.

StorageFolder sdCard =(await externalDevices.GetFolderAsync()).FirstorDefault();

In the above code, error is coming at 2 places. In the 1st line, Windows.Storage is giving error and in the 4th line, FirstorDefault is giving error. This is working fine for windows phone 8.1. Please give ur suggestions to let this code work for windows 8.1 too.

How to launch a jar file on windows startup from the registry?

I am trying to launch a jar file on Windows Server 2008 R2 startup.

I tried to add a key\value to

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

I tried as a value several alternatives:

 java -jar c:\jcm\jcm.jar
 "java -jar c:\jcm\jcm.jar"
 c:\program files(x86)\java\jre1.8.31\bin\java.exe -jar c:\jcm\jcm.exe
 "c:\program files(x86)\java\jre1.8.31\bin\java.exe -jar c:\jcm\jcm.exe"
 "c:\program files(x86)\java\jre1.8.31\bin\java.exe" -jar c:\jcm\jcm.exe

But none of them launched the program.

Can you advise please?

Thank you.

Common C++ code to access PostgreSQL database on Windows and Linux

I want to write common C++ code to access PostgreSQL database on Windows and Linux. I want to know what library should I used other than ODBC?

Thanks in advance, Vijay Kumar Singh EDISPHERE Software

MPNS messages are not working

i have made an windows phone 8.1 application using cordova(Phonegap). i am using PushPlugin for notification. it works perfectly fine for Android and iOS, but for Windows phone 8.1 it doesnt work. actually it works randomly. i am using Toast notification for windows. so some times i receive toast notification some times i dont. i am successfully genrating channel and registering at MPNS notification uri is something like given below.

http://ift.tt/1bJXBD4........

  • CASE I.

server side implementation is in PHP. when i receive Toast Notification on windows device response at server is

[HTTP/1.1 200 OK
Cache-Control: private
Server: Microsoft-IIS/8.0
X-Server: RD000D3A107A1E
X-DeviceConnectionStatus: Connected
X-NotificationStatus: Received
X-SubscriptionStatus: Active
X-MessageID: 00000000-0000-0000-0000-000000000000
X-AspNet-Version: 4.0.30319
Date: Wed, 06 May 2015 11:00:45 GMT
Content-Length: 0]

  • CASE II.

But when I dont recive a Toast notification, response at server is Blank Array( [] ). I am wondering why response is blank array instead of any proper response as describe above?

i have tried both cases with Wifi and Data Connection, but result is same.

how to compile Leptonica library for windows x64 bit using VS2010?

I can build Leptonica libraries(DLL) for 32-bit windows using VS2010 by the help of http://ift.tt/1KX2IfT . But when I change the Target into x64, I got below errors. How can I resolve this? Is it possible to compile the 32-bit source files in 64 bit?

2>tiffio.obj : error LNK2019: unresolved external symbol TIFFReadRGBAImageOriented referenced in function pixReadFromTiffStream 2>tiffio.obj : error LNK2019: unresolved external symbol TIFFReadScanline referenced in function pixReadFromTiffStream 2>tiffio.obj : error LNK2019: unresolved external symbol TIFFScanlineSize referenced in function pixReadFromTiffStream 2>tiffio.obj : error LNK2019: unresolved external symbol TIFFGetField referenced in function pixReadFromTiffStream

How to make python code written in windows to run on linux

I have made a GUI application in python3.4 on windows. It is working fine on windows. Here are the list of packages I have used in windows :-

  1. python3.4
  2. python Win for 3.4
  3. Pillow-2.7.0.win32-py3.4

Now I want to run this application on linux. Could you all please suggest the packages corresponding to the mentioned above in linux and how can I run the gui application on linux??

How to save layout settings of MFC application?

I understand there are functions that can easily write windows registry, however I found out that in new MFC project created with wizard, some information (like split bar position, visibility of controls) gets stored automatically (or at least I found no CWinApp::Write* calls in the project). Since I have also older projects that don't have this behaviour I need to figure out how to make this without help of project wizard. Would anyone please know how does this work?

Binding to a list inside parents datacontext

On a Windows Store app project i have the following control

<ListView x:Name="MyMeetsRow"  Grid.Column="0" ItemsSource="{Binding Source={StaticResource cvsActivities}}" Style="{StaticResource MyMeetingsRowUsers}" GroupStyleSelector="{StaticResource listGroupStyleSelector}" />

with these styles:

<DataTemplate x:Key="MyMeetingUser">
    <Grid Margin="0,0,0,10" >
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Height="78" Width="875">
            <StackPanel.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0,1"  >
                    <GradientStop Color="#FF0072C6" Offset="0"/>
                    <GradientStop Color="#FF008FD4" Offset="1"/>
                </LinearGradientBrush>
            </StackPanel.Background>
            <Grid >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="90"/>
                    <ColumnDefinition Width="65"/>
                    <ColumnDefinition Width="388"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <TextBlock x:Name="MyMeetingRowDayNumber" Grid.Column="0" Text="{Binding MyMeetingRowDayNumber}" Style="{StaticResource MyMeetingsRowDay}"   />
                <Grid Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" x:Name="MyMeetingRowDayText" Text="{Binding MyMeetingRowDayText}" Style="{StaticResource MyMeetingsRowDayText}" Height="28"></TextBlock>
                    <TextBlock Grid.Row="1" x:Name="MyMeetingRowDayHour" Text="{Binding MyMeetingRowDayHour}" Style="{StaticResource MyMeetingsRowDayHour}" ></TextBlock>
                </Grid>
                <TextBlock Grid.Column="2" x:Name="MyMeetingsRowTitle" Text="{Binding MyMeetingsRowTitle}" Style="{StaticResource MyMeetingsRowTitle}" />
                <!--<ScrollViewer Grid.Column="3" HorizontalScrollBarVisibility="Auto" DataContext="{Binding Item}" VerticalScrollBarVisibility="Disabled" HorizontalScrollMode="Auto" VerticalScrollMode="Disabled">
                    <GridView DataContext="{Binding Invitees}">
                        <GridView.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding status}"/>
                            </DataTemplate>
                        </GridView.ItemTemplate>
                    </GridView>
                </ScrollViewer>-->
            </Grid>
        </StackPanel>
    </Grid>
</DataTemplate>

<GroupStyle x:Key="listViewGroupStyle">
    <GroupStyle.HeaderTemplate>
        <DataTemplate>
            <Grid Background="#8e8e8e" Width="805" Height="75" Margin="0,0,0,13">
                <TextBlock Text='{Binding Key}' Foreground="White" Margin="10,10,0,0" FontFamily="Segoe UI Light" FontSize="55" FontWeight="Light" FontStyle="Normal"/>
            </Grid>
        </DataTemplate>
    </GroupStyle.HeaderTemplate>
</GroupStyle>

<Style x:Key="MyMeetingsRowUsers" TargetType="ListView" >
    <Setter Property="HorizontalContentAlignment" Value="Right" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="TabNavigation" Value="Local"/>
    <Setter Property="IsHoldingEnabled" Value="True"/>
    <Setter Property="Margin" Value="44,36,0,0" />
    <Setter Property="SelectionMode" Value="None" />
    <Setter Property="ItemTemplate" Value="{StaticResource MyMeetingUser}" />
    <Setter Property="Transitions">
        <Setter.Value>
            <TransitionCollection>
                <EntranceThemeTransition />
            </TransitionCollection>
        </Setter.Value>
    </Setter>
</Style>

and the items im binding to it is this List

    private ObservableCollection<MeetingRow<Meeting>> myMeet = new ObservableCollection<MeetingRow<Meeting>>();

...

var result = from m in MyMeets group m by m.FullMonth into grp orderby grp.Key select grp;
            cvsActivities.Source = result;

as for the class Meeting row, it looks like this:

public class MeetingRow<T> : BindableBase
{
    private T item;
    public T Item
    {
        get { return item; }
        set { SetProperty(ref item, value); }
    }

    private string myMeetingRowDayNumber;
    public string MyMeetingRowDayNumber
    {
        get { return myMeetingRowDayNumber; }
        set { SetProperty(ref myMeetingRowDayNumber, value); }
    }

    private string myMeetingRowDayText;
    public string MyMeetingRowDayText
    {
        get { return myMeetingRowDayText; }
        set { SetProperty(ref myMeetingRowDayText, value); }
    }

    private string myMeetingRowDayHour;
    public string MyMeetingRowDayHour
    {
        get { return myMeetingRowDayHour; }
        set { SetProperty(ref myMeetingRowDayHour, value); }
    }

    private string myMeetingsRowTitle;
    public string MyMeetingsRowTitle
    {
        get { return myMeetingsRowTitle; }
        set { SetProperty(ref myMeetingsRowTitle, value); }
    }

    private string fullMonth;
    public string FullMonth
    {
        get { return fullMonth; }
        set { SetProperty(ref fullMonth, value); }
    }
}

and my Meeting Class

public class Meeting
{
    public string Id { get; set; }
    public string Organizer { get; set; }
    public string Organization { get; set; }
    public string Name { get; set; }
    public string MeetingType { get; set; }
    public string Description { get; set; }
    public Point Address { get; set; } //X = LAT; Y=LNG
    public DateTime StartDate { get; set; }
    public DateTime EndTime { get; set; }
    public string Status { get; set; }
    public List<MeetingPoint> MeetingPoints { get; set; }
    public List<MeetingInvitee> Invitees { get; set; }
}

after i fill my cvsActivities variable to put in the ListView ItemSource it displays the info correctly, but now i need to access the List<MeetingInvitee> inside the Item parameter in each MeetingRow that is on the cvsActivities List to fill the commented ScrollViewer. Basically i want to access a List inside each item on the parent ItemSource.

any ideias how i can do this? thanks.

Proper way to distribute Bonjour enabled Windows application

I am quite confused as to the proper way of distributing Bonjour as a part of a Windows application that would publish a service for a client iOS app.

No matter how much I google around, I cannot find a clear how-to guide. It would be great if someone could provide guidelines.

The main reasons of my confusion are:

  • Is it mandatory to distribute the entire bonjour Win SDK as a part of my Win application?
  • Since Apple provides source code to build mDNSResponder.exe, is it sufficient to only distribute such file along with dns-sd.dll?
  • What is the intended purpose of providing sources for mDNSResponder.exe otherwise?
  • What is the recommended way to handle the possibility of having Bonjour already installed on the system?
  • Also, where can I find the latest Bonjour SDK (3.x I guess?), I can only find 2.0.4. Is it only accessible if I am enrolled in the OSX developer program? (I am enrolled in iOS developer program for now.)

Many thanks.

JMX Authentication files path in windows environment

I am trying to add JMX auth in windows environment. I am referring : http://ift.tt/1DuYlaz

My usecase is that there are 100 odd desktop clients which we distribute via jar's. I want to package jmxaccess and jmxpassword file along with it. However my initial impression is (according to oracle doc) that i need to set up the password file in the JRE_HOME/lib/management directory. This will be very tedious to do for each user. Can someone please help me understand if we can provide custom paths in windows env. (similar to unix)?

Thank you.

phoenix framework - invalid argument at new Socket - windows

I'm not able to run a new phoenix app. This is the error I'm getting; I'm not sure what the reason could be.

I tried changing the port, which didn't change the behaviour. Also, it seems like I'm able to run node correctly.

Compiled web/views/error_view.ex
Compiled web/controllers/page_controller.ex
Compiled web/views/page_view.ex
Compiled web/views/layout_view.ex
Compiled lib/test_phoenix/endpoint.ex
Generated test_phoenix app
[info] Running TestPhoenix.Endpoint with Cowboy on port 4000 (http)

net.js:156
    this._handle.open(options.fd);
                 ^
Error: EINVAL, invalid argument
  at new Socket (net.js:156:18)
  at process.stdin (node.js:664:19)
  at bindWatcherEvents (c:\Desarrollo\Phoenix\test_phoenix\node_modules\brunch\l
ib\watch.js:597:12)
  at c:\******\Phoenix\test_phoenix\node_modules\brunch\lib\watch.js:667:9
  at c:\******\Phoenix\test_phoenix\node_modules\brunch\lib\watch.js:557:16
  at c:\******\Phoenix\test_phoenix\node_modules\brunch\lib\watch.js:188:12
  at c:\******\Phoenix\test_phoenix\node_modules\brunch\node_modules\async-e
ach\index.js:24:44
  at c:\******\Phoenix\test_phoenix\node_modules\brunch\lib\watch.js:175:14
  at Object.cb [as oncomplete] (fs.js:168:19)

How to allow Windows 7 accept UDP messages from an external device with address "127.0.0.2"?

My firm produces some devices with a network interface. The devices are sent with a IP address = 0.0.0.0. The customers plugs the device on the private net in the field and, by using a tiny app written with VB6, discover it and set the correct IP address. This working by using UDP messages: the app broadcast a "Who's there?" UDP message, read back the answer(s) containing the MAC address of the device(s), and the the user send another UDP message containing the new IP address for target MAC.

Now, for some unknown reasons, one of these device get its IP address set to 127.0.0.2. The problem is that now the VB app can't find (via UDP) the device anymore, making it impossible to change the IP address to a valid one.

Further analisys revealed than if the app is running on Windows XP it sees the device, but if the app is running on Windows 7 the UDP message does'nt arrive to to the "socket" (while Wireshark can see the answer from the device).

Now, there a solution to allow Win7 to let "pass" an UDP message sent from a 127.0.0.2 external address? If yes, we could avoid to ship around the world a replacement device with a correct IP address and all the trouble of phisically mounting it in the field.

Here's a Wireshark capture of the "question" and the "answer" not "detected" by the VB app: cap.pcapng