2014年11月

Question

Property Seizure to Drugs


My ex-boyfriend and I own 10 acres of land. We have split up due to him becoming addicted to crack cocaine. I am currently trying to sell the property, and I am not involved with drugs. Is it possible that if he gets busted the property could be seized even though I am half owner?



Answer

Re: Property Seizure to Drugs


Yes, apparently so, since you obviously do not hold title to this property with your ex-boyfriend as tenants by the entireties(which would protect your interest absolutely from all crditor actions). However, as presumed tenants in common, law enforcement authorities would be limited to attaching his half interest in the property or the value thereof,


and if the property were auctioned, they would have to split the proceeds of the sale with you(assuming that you were not in a position financially to buy out their interest seized from your former boyfriend).





Akka actor cardinality

After reading most of the Akka docs, I still don't understand something fairly fundamental to Akka: actor cardinality.



Meaning, if I have a particular actor, say FizzActor, does Akka ever only create 1 instance of it, or does it spawn n-instances of it as needed? If it can spawn multiple instances of an actor class, then is this configurable (if so how/where?), or does Akka alone determine how many instances to create? Does stopping/restarting/resuming this actor class perform the action on all instances of the actor or just the one child instance? Can I assume that Akka coordinates state changes across all FizzActor instances, so that each time I get an ActorRef to it, I see a consistent state?



None of these seem to be covered in the docs!



Answers

Akka's primary philosophy is "no magic", i.e. if you create an actor that's what happens - one Actor is created. Refer to the docs on Creating Actors with Props for a deeper explanation.



The one case where Akka takes care of starting multiple Actors in your stead is Pool Routers, which as explained in the docs:




Pool - The router creates routees as child actors and removes them from the router if they terminate





Why do some order products have a product_id of 0

Product with id 0 is not retrievable. Why are some order products associated with product_id 0? Is this a product that was deleted, but and order was already placed?









SQL - missing keyword in case when syntax

I am getting this error message




missing keyword




Any suggestions? thanks



CASE WHEN 
substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=0
and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 4000
then 'ASSET'
ELSE CASE WHEN
substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=4000
and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 8000
then 'LIABILITY'
ELSE CASE WHEN
substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=8000
and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 9000
then 'OFF BALANCE SHEET ASSET'
ELSE CASE WHEN
substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=9000
and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 10000
then 'OFF BALANCE SHEET LIABILITY' end as ASSET_TYPE,


Answers

I think you are using more "CASE" word in your case statement. Remove "ELSE CASE" after each "Then". Refer this Oracle Documentation



CASE WHEN 
substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=0
and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 4000
then 'ASSET'
WHEN
substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=4000
and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 8000
then 'LIABILITY'
WHEN
substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=8000
and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 9000
then 'OFF BALANCE SHEET ASSET'
WHEN
substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=9000
and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 10000
then 'OFF BALANCE SHEET LIABILITY'
END as ASSET_TYPE,


The general syntax will be



CASE  
WHEN col = 1 THEN 'Active'
WHEN col = 2 THEN 'Inactive'
WHEN col = 3 THEN 'Terminated'
END AS StatusText


Answers

the solution is :



case when substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=0 and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 4000 then 'ASSET'
when substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=4000 and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 8000 then 'LIABILITY'
when substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=8000 and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 9000 then 'OFF BALANCE SHEET ASSET'
when substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4)>=9000 and substr(M1.M_GL_LINE_NO,length(M1.M_GL_LINE_NO - 4),4) < 10000 then 'OFF BALANCE SHEET LIABILITY'
else '' end as ASSET_TYPE,


thanks





Javascript doOnOrientationChange :can't fix a bug loading the page

I used a .js to avoid landscape view from mobile device. I edited a white full-screen image saying "this site is not thought to be viewed in landscape mode, please turn your device" to be shown each time I rotate my device from portrait to landscape.
It works except when I load a page and I'm already in landscape mode. Any idea on how to fix it? Thanks



<script>
(function() {
'use strict';

var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};
if (isMobile.any()) {
doOnOrientationChange();
window.addEventListener('resize', doOnOrientationChange, 'false');
}

function doOnOrientationChange() {
var a = document.getElementById('alert');
var b = document.body;
var w = b.offsetWidth;
var h = b.offsetHeight;
(w / h > 1) ? (a.className = 'show', b.className = 'full-body') : (a.className = 'hide', b.className = '');
}
})();
</script>


Update :



I tried adding window.orientation to the script but something is wrong



if (orientation === "landscape-primary") {
doOnOrientationChange();
window.addEventListener('resize',doOnOrientationChange,'false');
}

window.onload(doOnOrientationChange());


Answers

You need to move the doOnOrientationChange() function outside of the other one, and then call it on pageload. Like this it should work:



<script>
function checkMobile() {
var isMobile = false;
if (navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/iPhone|iPad|iPod/i)
|| navigator.userAgent.match(/Opera Mini/i)
|| navigator.userAgent.match(/IEMobile/i)) {
isMobile = true;
}
return isMobile;
}
function doOnOrientationChange() {
var a = document.getElementById('alert');
var b = document.body;
var w = b.offsetWidth;
var h = b.offsetHeight;
if (checkMobile()) {
(w / h > 1) ? (a.className = 'show', b.className = 'full-body') : (a.className = 'hide', b.className = '');
} else {
a.className = 'hide';
b.className = '';
}
}
window.onload = doOnOrientationChange();
window.addEventListener('resize', doOnOrientationChange, 'false');
</script>




↑このページのトップヘ