Using X4R package in R to connect to a SSAS cube?
Date : March 29 2020, 07:55 AM
|
Cannot connect to OLAP Cube via Olap4J API
Tag : java , By : user160048
Date : March 29 2020, 07:55 AM
like below fixes the issue I had the same problem as yours. I wanted to connect to my OLAP cube, which was hosted in localhost. I've noticed that when I send GET request to http://192.168.0.151/OLAP/msmdpump.dll in my browser I need to enter username and password. I thought that probably my driver didn't have an access to this resource. Aha! I was right ;) Connection connection = DriverManager.getConnection(
"jdbc:xmla: Server=http://192.168.0.151/OLAP/msmdpump.dll;" +
"Data Source=http://192.168.0.151/OLAP/msmdpump.dll;" +
"Initial Catalog=AdventureWorksDW2014; " +
"Integrated Security=Basic; " +
"User ID=XXX; " +
"Password=XXX;");
|
THREE.js - clickable interactive objects.Click on a cube and then appear second cube and i want to make the last cube cl
Date : March 29 2020, 07:55 AM
seems to work fine First, you can name your mesh. For say, we can name it as rotatingMesh & staticMesh. Naming is required to track on which 3d obj click event is being performed. for (var i = 0; i < intersects.length; i++) {
if(intersects[i].object.name === 'staticMesh') {
// Set rotating mesh color to yellow
mesh.material.color = new THREE.Color(1,1,0)
} else {
var geometry1 = new THREE.BoxGeometry(0.5, 0.5, 0.5);
var material1 = new THREE.MeshLambertMaterial({ color: 0xce2121 });
var mesh1 = new THREE.Mesh(geometry1, material1);
mesh1.name = 'staticMesh'
mesh1.position.y = 1;
scene.add(mesh1);
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<link rel="stylesheet" href="css/main.css" />
</head>
<body>
<script src="https://cdn.rawgit.com/mrdoob/three.js/master/build/three.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.2/TweenMax.min.js"></script>
<script>
var camera, scene, renderer;
var geometry, material, mesh;
init();
animate();
function init() {
camera = new THREE.PerspectiveCamera(
75,
window.innerWidth / window.innerHeight,
0.01,
1000
);
camera.position.z = 2;
scene = new THREE.Scene();
geometry = new THREE.BoxGeometry(0.5, 0.5, 0.5);
material = new THREE.MeshLambertMaterial({ color: 0x2c9b73 });
mesh = new THREE.Mesh(geometry, material);
mesh.name = 'rotatingMesh'
mesh.rotation.set(45, 0, 0);
scene.add(mesh);
var light = new THREE.PointLight(0xffffff, 1, 100);
light.position.set(10, 10, 10);
scene.add(light);
renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setClearColor("#e5e5e5");
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
window.addEventListener("resize", () => {
renderer.setSize(window.innerWidth, window.innerHeight);
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
});
}
var raycaster = new THREE.Raycaster();
var mouse = new THREE.Vector2();
function onMouseMove(event) {
event.preventDefault();
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
raycaster.setFromCamera(mouse, camera);
var intersects = raycaster.intersectObjects(scene.children, true);
for (var i = 0; i < intersects.length; i++) {
if(intersects[i].object.name === 'staticMesh') {
// Set rotating mesh color to yellow
mesh.material.color = new THREE.Color(1,1,0)
} else {
var geometry1 = new THREE.BoxGeometry(0.5, 0.5, 0.5);
var material1 = new THREE.MeshLambertMaterial({ color: 0xce2121 });
var mesh1 = new THREE.Mesh(geometry1, material1);
mesh1.name = 'staticMesh'
mesh1.position.y = 1;
scene.add(mesh1);
}
}
}
function animate() {
requestAnimationFrame(animate);
mesh.rotation.x += 0.01;
//mesh.rotation.y += 0.02;
renderer.render(scene, camera);
}
window.addEventListener("click", onMouseMove);
</script>
</body>
</html>
|
cube border is not connect
Date : March 29 2020, 07:55 AM
I wish did fix the issue. When you change the width of the face of the cube, you have to change translateZ() as well. translateZ() has to be equal to half of the width of the cube's face. var cube = document.querySelector('.cube');
var radioGroup = document.querySelector('.radio-group');
var currentClass = '';
function changeSide() {
var checkedRadio = radioGroup.querySelector(':checked');
var showClass = 'show-' + checkedRadio.value;
if ( currentClass ) {
cube.classList.remove( currentClass );
}
cube.classList.add( showClass );
currentClass = showClass;
}
// set initial side
changeSide();
radioGroup.addEventListener( 'change', changeSide );
* { box-sizing: border-box; }
body { font-family: sans-serif; }
.scene {
width: 170px;
height: 200px;
border: 1px solid #CCC;
margin: 80px;
perspective: 400px;
}
.cube {
width: 170px;
height: 170px;
position: relative;
transform-style: preserve-3d;
transform: translateZ(-100px);
transition: transform 1s;
}
.cube.show-front { transform: translateZ(-85px) rotateY( 0deg); }
.cube.show-right { transform: translateZ(-85px) rotateY( -90deg); }
.cube.show-back { transform: translateZ(-85px) rotateY(-180deg); }
.cube.show-left { transform: translateZ(-85px) rotateY( 90deg); }
.cube.show-top { transform: translateZ(-85px) rotateX( -90deg); }
.cube.show-bottom { transform: translateZ(-85px) rotateX( 90deg); }
.cube__face {
position: absolute;
width: 170px;
height: 170px;
border: 2px solid black;
line-height: 170px;
font-size: 40px;
font-weight: bold;
color: white;
text-align: center;
}
.cube__face--front { background: hsla( 0, 100%, 50%, 0.7); }
.cube__face--right { background: hsla( 60, 100%, 50%, 0.7); }
.cube__face--back { background: hsla(120, 100%, 50%, 0.7); }
.cube__face--left { background: hsla(180, 100%, 50%, 0.7); }
.cube__face--top { background: hsla(240, 100%, 50%, 0.7); }
.cube__face--bottom { background: hsla(300, 100%, 50%, 0.7); }
.cube__face--front { transform: rotateY( 0deg) translateZ(85px); }
.cube__face--right { transform: rotateY( 90deg) translateZ(85px); }
.cube__face--back { transform: rotateY(180deg) translateZ(85px); }
.cube__face--left { transform: rotateY(-90deg) translateZ(85px); }
.cube__face--top { transform: rotateX( 90deg) translateZ(85px); }
.cube__face--bottom { transform: rotateX(-90deg) translateZ(85px); }
label { margin-right: 10px; }
<div class="scene">
<div class="cube">
<div class="cube__face cube__face--front">front</div>
<div class="cube__face cube__face--back">back</div>
<div class="cube__face cube__face--right">right</div>
<div class="cube__face cube__face--left">left</div>
<div class="cube__face cube__face--top">top</div>
<div class="cube__face cube__face--bottom">bottom</div>
</div>
</div>
<p class="radio-group">
<label>
<input type="radio" name="rotate-cube-side" value="front" checked /> front
</label>
<label>
<input type="radio" name="rotate-cube-side" value="right" /> right
</label>
<label>
<input type="radio" name="rotate-cube-side" value="back" /> back
</label>
<label>
<input type="radio" name="rotate-cube-side" value="left" /> left
</label>
<label>
<input type="radio" name="rotate-cube-side" value="top" /> top
</label>
<label>
<input type="radio" name="rotate-cube-side" value="bottom" /> bottom
</label>
</p>
|
How to connect Kyvos cube (Bigdata Cube) in Excel?
Date : March 29 2020, 07:55 AM
|