I'm sure there are many of these snippets out there. Here is yet another one.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[UPDATE 2014-11-17] I am about to eat my own words, because Carl Kleffner has provided openBLAS dynamic libraries and headers that you can use to build NumPy>=1.91. The DLL is compiled using his static mingw-w64 GCC toolchain. From his site download 2014-08-28_OpenBLAS-0.2.12dev_PR440.7z and extract it into numpy/core folder of the NumPy-1.9.1 distribution. Then follow the directions on the OpenBLAS users Google Group. A wheel is my dropbox. You can check it's config in a Python interpreter by importing NumPy and calling numpy.__config__.show(). If you have nose, you can also run its tests by calling numpy.test(). Thanks Carl and Xianyi, this is an important milestone in making powerful numerical software free and open-sourced.
I want you to repeat after me.
"You will never be able to build NumPy on Windows x64 without the Intel Compiler Suite."
OK, was that so hard? You may have briefly entertained pipe dreams of building NumPy with OpenBLAS binaries, but then reality sank in after NumPy fails to load with this sad traceback.
Traceback (most recent call last):
File "", line 1, in
File "c:\.virtualenvs\openblas\lib\site-packages\numpy\__init__.py", line 170, in
from . import add_newdocs
File "c:\.virtualenvs\openblas\lib\site-packages\numpy\add_newdocs.py", line 13, in
from numpy.lib import add_newdoc
File "c:\.virtualenvs\openblas\lib\site-packages\numpy\lib\__init__.py", line 18, in
from .polynomial import *
File "c:\.virtualenvs\openblas\lib\site-packages\numpy\lib\polynomial.py", line 19, in
from numpy.linalg import eigvals, lstsq, inv
File "c:\.virtualenvs\openblas\lib\site-packages\numpy\linalg\__init__.py", line 51, in
from .linalg import *
File "c:\.virtualenvs\openblas\lib\site-packages\numpy\linalg\linalg.py", line 29, in
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: DLL load failed: The specified procedure could not be found
Everyone said, "use dependency walker," which you did, and it told you that ABI incompatibilities meant that NumPy had no idea how to call your libopenblas.dll functions, even though they were exported and supported by libgfortran-3.dll and libgcc_s_seh-1.dll and the right versions of msvcr90.dll which you found buried in winsxs.
When you sit down at a Windows PC and log in, you begin a Console session which differs from the session that starts when you log in remotely. There can only be one Console session, but there can be any number of remote sessions using terminal services. Why is this distinction important? Sometimes, you may need to transfer your login from a remote session to the Console, so that you can fool a service into thinking that you are actively logged into the Console. For example there is a free service named after a certain fish often served in sushi, Yellowtail, that will disconnect if it senses that you are no longer actively connected to a session.
Here's the trick:
Log in remotely to the Console session.
$ mstsc.exe /console /v:your-server-name
Disconnect, but do not log out.
Log in remotely to another session.
$ mstsc.exe /v:your-server-name
View the logged on users.
$ query user
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
my-user-name console 0 Disc none 10/16/2014 9:03 AM
>my-user-name rdp 1 Active none 10/16/2014 9:03 AM
If this doesn't work try qwinsta
$ qwinsta
SESSIONNAME USERNAME ID STATE TYPE DEVICE
console my-user-name 0 Disc
>rdp my-user-name 1 Active
Switch to the console.
$ tscon 1 /dest:console
A dialog window will pop up stating that you have been logged off of the computer, because you have logged in somewhere else (duh, at the console!). You can still log back into the computer using Remote Desktop Connection. If you check the users again, you'll see that you are actively logged in twice! Your console login remains active. Mission accomplished.
Peer-To-Peer Virtual Private Network (P2P VPN)
Also known as SocialVPN, this is a network that is very similar to an ad-hoc or peer-to-peer local network between computers connected via LAN cables or WiFi, but connects instead via a VPN tunnel through the internet. There are several services that purport to offer free (or freemium) P2P VPN services.
Hamachi, named after a certain fish often served in sushi, Yellowtail, may be the most well known freemium P2P VPN service. It is extremely fast and reliable, but the free service is limited to 5 clients and will shut down if it detects that you have disconnected. Paid service offers up to 32 clients starting at $29/year. It is available on Windows, Mac and Linux. Although the Linux version is Beta it works fine.
NeoRouter is a freemium service that at least by their comparison chart, is superior to Hamachi, but I have not tried it. Domain hosting is offered by NeoRouter for $15/month for up to 15 clients, which is a lot more than Hamachi! However, users can set up there own NeoRouter Server, the client and server installation is the same package, which can host the NeoRouter domain. If the server does not have a public IP, then port forwarding must be configured, so there are some hoops to jump through. It is available on all platforms. A Professional version offers support.
Remobo was a free cloud service with a Pro version that offered support, but it is now offline.
Log in to the Windows machine and switch the login to the console leaving it active. You can check its status on your LogMeIn Central profile under My Networks.
Download the beta Hamachi Linux version and install it on your Linux box. For Ubuntu, use the *.deb file and execute sudo dpkg -i logmein-hamachi_VERSION_PLATFORM.deb where VERSION and PLATFORM may differ.
start hamachi
$ sudo hamachi login
logging in ....... ok
$ sudo hamachi join MYNETWORK MYPASSWORD
Joining MYNETWORK ........ ok
$ sudo hamachi list
* [MYNETWORK] capacity 2/5, subscription type: Free, owner: you@your-email.com
123-456-789 MYWINDOWSMACHINE 25.12.34.56 alias: not set
Use the Hamachi network IP address to start remote desktop, my version of Ubuntu already had this installed, but if not use sudo apt-get install rdesktop.
$ rdesktop 25.12.34.56
When the windows opens, log into your windows machine. To get a full screen, use -f option. A graphical client is also available, use sudo apt-get install grdesktop to install.
You can mount a share on the Windows machine.
$ mkdir –p /home/my-linux-profile/winshare
$ sudo mount –t cifs //25.12.34.56/myshare /home/my-profile/winshare \
–o username=myWindowsUsername,password=myWindowsPassword,domain=myWindowsDomain,rw
$ cd /home/my-linux-profile/winshare
You can make an image based mockup with simple Javascript that loops over the images everytime you click. First you need to make a bunch of images, similar to a powerpoint slide deck animation, where one thing is different on each slide. Then as you click through the slides it seems interactive, even though the content is actually static. Save the PNG images as "page1", page2", etc. incrementing the numbers in order. The name and numbering scheme will be used to queue the images in the mockup.
jQuery
jQuery just make's everything easier. Here jQuery binds the tag with the id "content" to a click event, and then changes the tags "src" attribute to the page we want to show using the counter variable and the modulus of the total number of pages. We'll output the new "src" attribute value to the console for troubleshooting. On Chrome you can see the console by rightclicking "Inspect element" or ctrl-shft-c.
Puro JS and bad HTML
This kind of code is frowned upon, but you can actually set the callback function of an event in the HTML.
Puro JS another way
Now we do what we did with jQuery, only with pure JS.
As addressed in issue #10315, Django mapping is not stored in an objects.inv file since the Django documentation is itself a django app evidently, so the content of objects.inv is only returned from the URL conf http://docs.djangoproject.com/en/1.6/_objects/. The following intersphinx_mapping conf works:
But what's in Django's objects.inv file? Navigating to http://docs.djangoproject.com/en/dev/_objects/ shows four header lines:
# Sphinx inventory version 2
# Project: Django
# Version: 1.6
# The remainder of this file is compressed using zlib.
followed by a bunch of binary garbage. Save the file as django.inv and after removing the header lines, use Python to decompress the zlib file and write it out as plain text:
>>> import zlib
>>> # django_zlib.inv is django.inv with 1st four header lines removed
>>> with open('django_zlib.inv', 'rb') as f:
>>> src = zlib.decompress(f.read())
>>> with open('django_txt.inv','w') as f:
>>> f.write(src)
Opening the plain text file shows the structure given in the data table below. The first column is how you should call the cross reference in your documentation. For example, search for collectstatic and you'll see that you can reference it as :std:djadmin:`collectstatic`. The second column is the directive for the reference, and in some cases a domain as well. Django uses many custom directives and adds them all to the standard domain, std. Therefore you will have to add Django's custom extensions to your document tree. The custom directives are in the docs folder of the Django GitHub repository, in a folder called _ext in a file called djangodocs.py. Choose the tag corresponding to your Django release, e.g.: 1.6.5. Make a folder in your docs tree called _ext and copy djangodocs.py there. Then insert the path to _ext in your conf.py and add djangodocs.py to the list of extensions.
Inside djangodocs.py you will find the corresponding role to use for each directive. For example, the reference to collectstatic uses the custom django-admin directive, which has a corresponding role of djadmin. Finally the fourth column in the object inventory is the endpoint of the link to the reference in the Django documentation on the Web. Now you can reference collectstatic in your docs using :std:djadmin:`collectstatic`, and it will link to Django. Voila!
You can also link to cross references in external documents that are listed in the object inventory as std:label and have a flag of -1 by using :ref:`prefix:label` or with alternate text as :ref:`alternate text <prefix:label>`. The prefix is the name of the remote documentation. For example, search for django-settings-module and it can be linked using either :ref:`django:django-settings-module` which displays Designating the Settings or :ref:`Django Settings Module <django:django-settings-module>`.