在OS X上运行Java 6有哪些选择?
我有一台运行Mac OS X 10.4的MacBook Pro Intel Core Duo.我是否有在此硬件和操作系统上运行Java 6的任何选项?
相关问题:哪些Mac(当前或即将推出)支持64位计算?是否有任何具有64位架构的Apple笔记本电脑(当前或即将推出)?
任何相关链接将不胜感激.
我正在寻找一个可以处理Callables或Runnables 的通用异步Java作业执行框架.它类似于java.util.concurrent.ExecutorService(并且可能包装ExecutorService),但它也具有以下特征:
在作业正在服务时应用程序停机的情况下将作业持久保存到数据库的能力,并能够重新启动未完成的作业.(我明白我的工作可能要实施Serializable哪个好.)
使用UUID使客户端能够获取作业令牌并查询作业状态.(在引擎盖下,此信息也将持久保存到数据库中.)
我已经开始通过构建来开始自己的工作ExecutorService,但我更喜欢开箱即用的开源解决方案,如果存在的话.
可以在Spring Framework中运行的东西是理想的.
我一直在努力寻找答案或制定解决方案.我试图找出如何在Clojure中创建代码的代码.对于我的第一个专长,我想要一个函数,它将打印到stdout符号的名称及其值,对调试很有用.例:
(def mysymbol 5)
(debugging-function mysymbol)
mysymbol: 5
Run Code Online (Sandbox Code Playgroud)
那有意义吗?谢谢你的帮助.
发布讨论更新
以下是@amalloy的答案:
(defmacro ?
"A useful debugging tool when you can't figure out what's going on:
wrap a form with ?, and the form will be printed alongside
its result. The result will still be passed along."
[val]
`(let [x# ~val]
(prn '~val '~'is x#)
x#))
Run Code Online (Sandbox Code Playgroud)
所以:
(? myvariable)
我正在尝试在OS X上安装netCDF4 pip install netCDF4,我收到以下错误:
------------------------------------------------------------
/usr/local/bin/pip run on Wed Aug 7 23:02:37 2013
Downloading/unpacking netCDF4
Running setup.py egg_info for package netCDF4
HDF5_DIR environment variable not set, checking some standard locations ..
checking /Users/mc ...
checking /usr/local ...
checking /sw ...
checking /opt ...
checking /opt/local ...
checking /usr ...
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip-build/netCDF4/setup.py", line 114, in <module>
raise ValueError('did not find HDF5 headers')
ValueError: did not find HDF5 headers …Run Code Online (Sandbox Code Playgroud) 我有一些我想用Cartopy显示的卫星图像数据.我已成功按照此处详述的图像示例进行操作.导致此代码:
import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig = plt.figure(figsize=(12, 12))
img_extent = (-77, -59, 9, 26)
ax = plt.axes(projection=ccrs.PlateCarree())
# image data coming from server, code not shown
ax.imshow(img, origin='upper', extent=img_extent)
ax.set_xmargin(0.05)
ax.set_ymargin(0.10)
# mark a known place to help us geo-locate ourselves
ax.plot(-117.1625, 32.715, 'bo', markersize=7)
ax.text(-117, 33, 'San Diego')
ax.coastlines()
ax.gridlines()
plt.show()
Run Code Online (Sandbox Code Playgroud)
此代码生成以下图像 
我的问题是卫星图像数据不在PlateCarree投影中,而是墨卡托投影.
但是当我得到轴对象时
ax = plt.axes(projection=ccrs.Mercator())
Run Code Online (Sandbox Code Playgroud)
我失去了海岸线.

我在这里看到了这个问题.但
ax.set_global()
Run Code Online (Sandbox Code Playgroud)
得到这张图片的结果:

数据不存在,圣地亚哥位置错误.纬度/经度范围也发生了变化.我究竟做错了什么?
发布讨论更新
主要问题是我没有使用该transform_points方法在目标投影中正确指定图像范围.我还必须具体说明 …
我在clojure中定义了以下内容:
(def ax '(fn x [] (+ 1 z)))
(let [z 4]
(str (eval ax))
)
Run Code Online (Sandbox Code Playgroud)
:但不是返回:
5
Run Code Online (Sandbox Code Playgroud)
:我得到:
Unable to resolve symbol: z in this context
Run Code Online (Sandbox Code Playgroud)
:我已经尝试将"let"更改为"绑定"但这仍然无效.有人知道这里有什么问题吗?
我试图通过循环设置向量的每个元素等于3.我明白了:
java.lang.ClassCastException:clojure.lang.PersistentVector无法强制转换为java.lang.Number
这是代码.
(def w [1 2 3])
(defn update [index value]
(assoc w index value))
(loop [i -1]
(if (< (count w) i)
w
(recur (update (+ i 1) 3))))
Run Code Online (Sandbox Code Playgroud) 我在使用Cartopy重新投影图像时遇到问题.
我有以下代码(从这里找到的示例修改):
import os
import matplotlib.pyplot as plt
from cartopy import config
import cartopy.crs as ccrs
import cartopy.feature as cfeature
fig = plt.figure(figsize=(8, 10))
img_extent = (-120.67660000000001, -106.32104523100001, 13.2301484511245, 30.766899999999502)
img = plt.imread('/tmp/Miriam.A2012270.2050.2km.jpg')
ax = plt.axes(projection=ccrs.PlateCarree())
plt.title('Hurricane Miriam from the Aqua/MODIS satellite\n'
'2012 09/26/2012 20:50 UTC')
ax.set_extent([-125, -105, 10, 35], ccrs.Geodetic())
ax.imshow(img, origin='upper', extent=img_extent, transform=ccrs.PlateCarree())
ax.coastlines(resolution='50m', color='black', linewidth=1)
ax.gridlines()
plt.show()
Run Code Online (Sandbox Code Playgroud)
生成以下图像 
然而,当我尝试通过替换选择不同的投影时,比如Lambert Conformal
ax = plt.axes(projection=ccrs.PlateCarree())
Run Code Online (Sandbox Code Playgroud)
同
ax = plt.axes(projection=ccrs.LambertConformal())
Run Code Online (Sandbox Code Playgroud)
我得到以下图像:

如您所见,此图像存在问题.我究竟做错了什么?是否可以在不同的投影中显示此图像?

我正在使用自动完成YUI功能.但是,正如您所看到的,当我在文本输入前放置标签时,我无法将建议下拉与文本输入对齐.我正在按照这里的示例完全除了这段代码,我只是用表格中的label元素替换H3:
<div id="myAutoComplete">
<label>Enter a state:</label>
<input id="myInput" type="text">
<div id="myContainer"></div>
</div>
<script type="text/javascript" src="http://developer.yahoo.com/yui/examples/autocomplete/assets/js/data.js"></script>
Run Code Online (Sandbox Code Playgroud)
(我还必须将data.js路径从相对路径更改为绝对路径.)
将建议下拉到与文本输入对齐的最佳方法是什么?我想要一个适用于所有流行的现代浏览器(FF3,Safari,Chrome,IE)和IE6的解决方案.