一、二氯化二铜氨溶液怎么鉴别1-戊炔和1-戊烯
1-戊炔和银氨溶液反应,生成白色至浅黄色的炔化银沉淀:
CH3CH2CH2C≡CH + [Ag(NH3)2]+ = NH3 + NH4+ + CH3CH2CH2C≡C-Ag↓
1-戊炔和一价铜的配合物反应,生成红色的炔化亚铜:
CH3CH2CH2C≡CH + [Cu(NH3)2]+ = NH3 + NH4+ + CH3CH2CH2C≡C-Cu↓
环戊烯不能发生这两个反应.
这是RC≡CH型炔烃特有的反应.
所以二氯化二铜与之反应会生成红色的就是1-戊炔
只有氨溶液没有银离子不会和1-戊炔反应所以没现象
二、2-甲基-3-戊酮和苯肼的反应???
加成消除生成苯腙
三、含碳碳双键的酯水解产物一定含碳碳双键吗
一般情况下,含碳碳双键的酯水解产物含碳碳双键。
个别情况下不含碳碳双键,例如:RCOOCH=CHR‘的酯水解后,生成RCOOH和R’CH=CHOH,但生成的这种醇是一种不稳定的结构,会异构成R‘CH2CHO这种醛。
四、在JavaScript怎么把经纬度转换成geohash?
需要引入jquery!!
HTML:
js代码-执行代码:
$('#geohash').keyup(function() {
var coordinate = decodeGeoHash(this.value);
if (!coordinate || !coordinate.latitude[2] || !coordinate.longitude[2])
{
$('#coordinate').val('');
$('#precision').val('');
}
else
{
$('#coordinate').val(coordinate.latitude[2].toFixed(8) + , + coordinate.longitude[2].toFixed(8));
$('#precision').val(this.value.length);
}
});
function validatePrecision()
{
var precision = $('#precision').val();
if (!precision)
{
return '';
}
else if (!$.isNumeric(precision))
{
return 1;
}
else if (precision > 12)
{
return 12;
}
else if (precision < 1)
{
return 1;
}
return precision;
}
function toGeohash()
{
var precision = $('#precision').val();
if (!$.isNumeric(precision))
{
precision = 12;
}
var coordinate = $('#coordinate').val().split(,);
var latlng = coordinate;
if (latlng.length >= 2)
{
var lat = latlng[0].trim();
var lng = latlng[1].trim();
if (/^(\-?\d+(\.\d+)?)$/.test(lat) && /^(\-?\d+(\.\d+)?)$/.test(lng))
{
console.log(precision);
return encodeGeoHash(lat, lng, precision);
}
}
return '';
}
$('#coordinate').keyup(function() {
$('#geohash').val(toGeohash());
});
$('#precision').change(function() {
$('#precision').val(validatePrecision());
$('#geohash').val(toGeohash());
});
$('#precision').keyup(function() {
$('#precision').val(validatePrecision());
$('#geohash').val(toGeohash());
});js代码-geohash.js
// geohash.js
// Geohash library for Javascript
// (c) 2008 David Troy
// Distributed under the MIT License
BITS = [16, 8, 4, 2, 1];
BASE32 = 0123456789bcdefghjkmnpqrstuvwxyz;
NEIGHBORS = { right : { even : bc01fg45238967deuvhjyznpkmstqrwx },
left : { even : 238967debc01fg45kmstqrwxuvhjyznp },
top : { even : p0r21436x8zb9dcf5h7kjnmqesgutwvy },
bottom : { even : 14365h7k9dcfesgujnmqp0r2twvyx8zb } };
BORDERS = { right : { even : bcfguvyz },
left : { even : 0145hjnp },
top : { even : prxz },
bottom : { even : 028b } };
NEIGHBORS.bottom.odd = NEIGHBORS.left.even;
NEIGHBORS.top.odd = NEIGHBORS.right.even;
NEIGHBORS.left.odd = NEIGHBORS.bottom.even;
NEIGHBORS.right.odd = NEIGHBORS.top.even;
BORDERS.bottom.odd = BORDERS.left.even;
BORDERS.top.odd = BORDERS.right.even;
BORDERS.left.odd = BORDERS.bottom.even;
BORDERS.right.odd = BORDERS.top.even;
function refine_interval(interval, cd, mask) {
if (cd&mask)
interval[0] = (interval[0] + interval[1])/2;
else
interval[1] = (interval[0] + interval[1])/2;
}
function calculateAdjacent(srcHash, dir) {
srcHash = srcHash.toLowerCase();
var lastChr = srcHash.charAt(srcHash.length-1);
var type = (srcHash.length % 2) ? 'odd' : 'even';
var base = srcHash.substring(0,srcHash.length-1);
if (BORDERS[dir][type].indexOf(lastChr)!=-1)
base = calculateAdjacent(base, dir);
return base + BASE32[NEIGHBORS[dir][type].indexOf(lastChr)];
}
function decodeGeoHash(geohash) {
var is_even = 1;
var lat = []; var lon = [];
lat[0] = -90.0; lat[1] = 90.0;
lon[0] = -180.0; lon[1] = 180.0;
lat_err = 90.0; lon_err = 180.0;
for (i=0; ic = geohash[i]; cd = BASE32.indexOf(c); for (j=0; j<5; j++) { mask = BITS[j]; if (is_even) { lon_err /= 2; refine_interval(lon, cd, mask); } else { lat_err /= 2; refine_interval(lat, cd, mask); } is_even = !is_even; } } lat[2] = (lat[0] + lat[1])/2; lon[2] = (lon[0] + lon[1])/2; return { latitude: lat, longitude: lon}; } function encodeGeoHash(latitude, longitude, precision) { var is_even=1; var i=0; var lat = []; var lon = []; var bit=0; var ch=0; geohash = ; lat[0] = -90.0; lat[1] = 90.0; lon[0] = -180.0; lon[1] = 180.0; while (geohash.length < precision) { if (is_even) { mid = (lon[0] + lon[1]) / 2; if (longitude > mid) { ch |= BITS[bit]; lon[0] = mid; } else lon[1] = mid; } else { mid = (lat[0] + lat[1]) / 2; if (latitude > mid) { ch |= BITS[bit]; lat[0] = mid; } else lat[1] = mid; } is_even = !is_even; if (bit < 4) bit++; else { geohash += BASE32[ch]; bit = 0; ch = 0; } } return geohash; }