li:hover doesn't get triggered
I haven't done this in a long time and I looked it up aswell but when I
hover over an li I expect its child UL to open up (display), but it isn't:
<nav>
<ul>
<li><a href="#">Products <img
src="~/Shared/Assets/Images/LIItemArrow.png" /></a>
<ul>
<li>Hi</li>
</ul>
</li>
<li><a href="#">Services <img
src="~/Shared/Assets/Images/LIItemArrow.png" /></a></li>
<li><a href="#">Shop <img
src="~/Shared/Assets/Images/LIItemArrow.png" /></a></li>
</ul>
</nav>
CSS:
ul li ul { display: none; }
ul li:hover > ul {
display: block;
}
According to the several articles I looked up, I believe that I'm doing
this right, so why won't this work?
Bushweller
Sunday, 1 September 2013
how to see the coverage for a whole plugin where both junit and swtbot test casesvhave been written
how to see the coverage for a whole plugin where both junit and swtbot
test casesvhave been written
I have a eclipse plugin for which both junit snd swtbot test cases have
been written… a test suite for junit runs all test cases as junit plugin…
test and coverage could be seen… in the same way swtbot test cases could
be run as swtbot test and coverage could be seen… but these do not include
coverage on…whole plugin… . how can I have one test suite that runs junit
test cases as junit test and swtbot test cases as swtbot test… and give
coverage for whole plugin…
test casesvhave been written
I have a eclipse plugin for which both junit snd swtbot test cases have
been written… a test suite for junit runs all test cases as junit plugin…
test and coverage could be seen… in the same way swtbot test cases could
be run as swtbot test and coverage could be seen… but these do not include
coverage on…whole plugin… . how can I have one test suite that runs junit
test cases as junit test and swtbot test cases as swtbot test… and give
coverage for whole plugin…
Targeting objects in AS3
Targeting objects in AS3
I am wondering how to target specific objects/instances in flash as3. I
have 2 objects on the stage, for now we'll call them obj1 and obj2 (with
instance names). I am trying to have ob1's rotation speed based on obj2's
y position. I want to place the code inside of obj1 so I figured if I
wanted to target obj2 from inside obj1 I'd just use something like
this.rotation = this.obj2.y / 10; but for some reason the thing just keeps
it's rotation still. I used the "Target" button at the top of the native
code editor but it still gave me the same this.obj2. Any ideas? Thanks in
advance.
I am wondering how to target specific objects/instances in flash as3. I
have 2 objects on the stage, for now we'll call them obj1 and obj2 (with
instance names). I am trying to have ob1's rotation speed based on obj2's
y position. I want to place the code inside of obj1 so I figured if I
wanted to target obj2 from inside obj1 I'd just use something like
this.rotation = this.obj2.y / 10; but for some reason the thing just keeps
it's rotation still. I used the "Target" button at the top of the native
code editor but it still gave me the same this.obj2. Any ideas? Thanks in
advance.
Saturday, 31 August 2013
Differnece Between VGA Compatible Text Mode and Graphics Modes vs Modern Graphics Hardware
Differnece Between VGA Compatible Text Mode and Graphics Modes vs Modern
Graphics Hardware
I am under the assumption that modern graphics hardware for "somewhat"
modern PCs can be implemented in many different ways. Thus, the questions
in this post might not have specific answers. General explanations to the
questions below about the differences between "VGA-compatible text mode
and graphics modes" and "modern graphics hardware" will suffice.
Q1: Are the addresses (see below) used by VGA-compatible text mode and
graphics modes different from those used by modern graphics hardware?
Assuming this to be true, what are the general techniques for obtaining
this new address on a given piece of modern graphics hardware?
0xA0000 for EGA/VGA graphics modes (64 KB)
0xB0000 for monochrome text mode (32 KB)
0xB8000 for color text mode and CGA-compatible graphics modes (32 KB)
Q2: How do modern operating systems (e.g. Linux, Windows, and Macs) obtain
better resolutions than that offered by VGA-compatible text Mode and
graphics modes given the lack of modern graphics hardware?
Definitions:
Modern Graphics Hardware: Any discrete or on board device that provides
for possible higher screen resolutions. Eg. Intel's on-board graphics
chips or an ATI/NVIDIA discrete graphics card.
References: http://en.wikipedia.org/wiki/Video_Graphics_Array
Graphics Hardware
I am under the assumption that modern graphics hardware for "somewhat"
modern PCs can be implemented in many different ways. Thus, the questions
in this post might not have specific answers. General explanations to the
questions below about the differences between "VGA-compatible text mode
and graphics modes" and "modern graphics hardware" will suffice.
Q1: Are the addresses (see below) used by VGA-compatible text mode and
graphics modes different from those used by modern graphics hardware?
Assuming this to be true, what are the general techniques for obtaining
this new address on a given piece of modern graphics hardware?
0xA0000 for EGA/VGA graphics modes (64 KB)
0xB0000 for monochrome text mode (32 KB)
0xB8000 for color text mode and CGA-compatible graphics modes (32 KB)
Q2: How do modern operating systems (e.g. Linux, Windows, and Macs) obtain
better resolutions than that offered by VGA-compatible text Mode and
graphics modes given the lack of modern graphics hardware?
Definitions:
Modern Graphics Hardware: Any discrete or on board device that provides
for possible higher screen resolutions. Eg. Intel's on-board graphics
chips or an ATI/NVIDIA discrete graphics card.
References: http://en.wikipedia.org/wiki/Video_Graphics_Array
Implement universal, lightweight, and unobtrusive tagging of arbitrary objects?
Implement universal, lightweight, and unobtrusive tagging of arbitrary
objects?
I'd like to implement a universal, lightweight, and "unobtrusive" way to
"tag" arbitrary objects.
More specifically, I want to define the equivalent of the (abstract)
functions tag, isTagged, and getTagged, such that:
isTagged(t) is true if and only if t was the value returned by tag(o), for
some object o;
getTagged(tag(o)) is identical to o, for every object o;
if t = tag(o), then tag(t) should be identical to t;
with the exception of the behaviors described in (1), (2), and (3) above,
and strict identity tests involving ===, tag(o) and o should behave the
same way.
For example:
>>> isTagged(o = "foo")
false
>>> isTagged(t = tag(o))
true
>>> getTagged(t) === o
true
>>> tag(t) === t
true
>>> t.length
3
>>> t.toUpperCase()
"FOO"
Below I give my best shot at solving this problem. It is (almost)
universal, but, as it will soon be clear, it is anything but
lightweight!!! (Also, it falls rather short of fully satisfying
requirement 4 above, so it is not as "unobtrusive" as I'd like. Moreover,
I have serious doubts as to its "semantic correctness".)
This solution consists of wrapping the object o to be tagged with a "proxy
object" p, and copying all the properties of o (whether "owned" or
"inherited") to p.
My question is:
is it possible to achieve the specifications given above without having to
copy all the properties of the tagged object?
Here's the implementation alluded to above. It relies on the utility
function getProperties, whose definition (FWIW) is given at the very end.
function Proxy (o) { this.__obj = o }
function isTagged(t) {
return t instanceof Proxy;
}
function getTagged(t) {
return t.__obj;
}
var tag = (function () {
function _proxy_property(o, pr) {
return (typeof pr === "function")
? function () { return pr.apply(o, arguments) }
: pr;
}
return function (o) {
if (isTagged(o)) return o;
if (typeof o.__obj !== "undefined") {
throw TypeError('object cannot be proxied ' +
'(already has an "__obj" property)');
}
var proxy = new Proxy(o);
var props = getProperties(o); // definition of getProperties given below
for (var i = 0; i < props.length; ++i) {
proxy[props[i]] = _proxy_property(o, o[props[i]]);
}
return proxy;
}
})();
This approach, ham-fisted though it is, at least seems to work:
// requirement 1
>>> isTagged(o = "foo")
false
>>> isTagged(p = tag(o))
true
// requirement 2
>>> getTagged(p) === o
true
// requirement 3
>>> tag(p) === p
true
// requirement 4
>>> p.length
3
>>> p.toUpperCase()
"FOO"
...well, almost; requirement (4) is not always satisfied:
>>> o == "foo"
true
>>> p == "foo"
false
>>> o == o
true
>>> p == o
false
FWIW, here's the definition of the function getProperties, which is used
by the tag function. Criticisms welcome. (WARNING: I'm a completely
clueless JS noob who doesn't know what he's doing! Use this function at
your own risk!)
function getProperties(o) {
var seen = {};
function _properties(obj) {
var ret = [];
if (obj === null) {
return ret;
}
try {
var ps = Object.getOwnPropertyNames(obj);
}
catch (e if e instanceof TypeError &&
e.message === "obj is not an object") {
return _properties(obj.constructor);
}
for (var i = 0; i < ps.length; ++i) {
if (typeof seen[ps[i]] === "undefined") {
ret.push(ps[i]);
seen[ps[i]] = true;
}
}
return ret.concat(_properties(Object.getPrototypeOf(obj)));
}
return _properties(o);
}
objects?
I'd like to implement a universal, lightweight, and "unobtrusive" way to
"tag" arbitrary objects.
More specifically, I want to define the equivalent of the (abstract)
functions tag, isTagged, and getTagged, such that:
isTagged(t) is true if and only if t was the value returned by tag(o), for
some object o;
getTagged(tag(o)) is identical to o, for every object o;
if t = tag(o), then tag(t) should be identical to t;
with the exception of the behaviors described in (1), (2), and (3) above,
and strict identity tests involving ===, tag(o) and o should behave the
same way.
For example:
>>> isTagged(o = "foo")
false
>>> isTagged(t = tag(o))
true
>>> getTagged(t) === o
true
>>> tag(t) === t
true
>>> t.length
3
>>> t.toUpperCase()
"FOO"
Below I give my best shot at solving this problem. It is (almost)
universal, but, as it will soon be clear, it is anything but
lightweight!!! (Also, it falls rather short of fully satisfying
requirement 4 above, so it is not as "unobtrusive" as I'd like. Moreover,
I have serious doubts as to its "semantic correctness".)
This solution consists of wrapping the object o to be tagged with a "proxy
object" p, and copying all the properties of o (whether "owned" or
"inherited") to p.
My question is:
is it possible to achieve the specifications given above without having to
copy all the properties of the tagged object?
Here's the implementation alluded to above. It relies on the utility
function getProperties, whose definition (FWIW) is given at the very end.
function Proxy (o) { this.__obj = o }
function isTagged(t) {
return t instanceof Proxy;
}
function getTagged(t) {
return t.__obj;
}
var tag = (function () {
function _proxy_property(o, pr) {
return (typeof pr === "function")
? function () { return pr.apply(o, arguments) }
: pr;
}
return function (o) {
if (isTagged(o)) return o;
if (typeof o.__obj !== "undefined") {
throw TypeError('object cannot be proxied ' +
'(already has an "__obj" property)');
}
var proxy = new Proxy(o);
var props = getProperties(o); // definition of getProperties given below
for (var i = 0; i < props.length; ++i) {
proxy[props[i]] = _proxy_property(o, o[props[i]]);
}
return proxy;
}
})();
This approach, ham-fisted though it is, at least seems to work:
// requirement 1
>>> isTagged(o = "foo")
false
>>> isTagged(p = tag(o))
true
// requirement 2
>>> getTagged(p) === o
true
// requirement 3
>>> tag(p) === p
true
// requirement 4
>>> p.length
3
>>> p.toUpperCase()
"FOO"
...well, almost; requirement (4) is not always satisfied:
>>> o == "foo"
true
>>> p == "foo"
false
>>> o == o
true
>>> p == o
false
FWIW, here's the definition of the function getProperties, which is used
by the tag function. Criticisms welcome. (WARNING: I'm a completely
clueless JS noob who doesn't know what he's doing! Use this function at
your own risk!)
function getProperties(o) {
var seen = {};
function _properties(obj) {
var ret = [];
if (obj === null) {
return ret;
}
try {
var ps = Object.getOwnPropertyNames(obj);
}
catch (e if e instanceof TypeError &&
e.message === "obj is not an object") {
return _properties(obj.constructor);
}
for (var i = 0; i < ps.length; ++i) {
if (typeof seen[ps[i]] === "undefined") {
ret.push(ps[i]);
seen[ps[i]] = true;
}
}
return ret.concat(_properties(Object.getPrototypeOf(obj)));
}
return _properties(o);
}
android manifest application 3 errors detected
android manifest application 3 errors detected
I am trying to build a mobile app for android,using ADT,and i get a weird
error for AndroidManifest.xml,it says that are actually 3 errors
detected,in 'Application' tab.
Below is the content of the manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.mfc"
android:versionCode="1"
android:versionName="1.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
<uses-permission
android:name="android.permission.INTERNET"></uses-permission>
<application> <activity android:name="Home"
android:label="@string/app_name"></activity></application>
</manifest>
Can anyone tell me which is the issue?
I am trying to build a mobile app for android,using ADT,and i get a weird
error for AndroidManifest.xml,it says that are actually 3 errors
detected,in 'Application' tab.
Below is the content of the manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.mfc"
android:versionCode="1"
android:versionName="1.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
<uses-permission
android:name="android.permission.INTERNET"></uses-permission>
<application> <activity android:name="Home"
android:label="@string/app_name"></activity></application>
</manifest>
Can anyone tell me which is the issue?
Replacing different String literals with empty Strings using regex in java
Replacing different String literals with empty Strings using regex in java
Please let me know if there is any regex that can convert the following
input into the following output:
Input line (Single line)
System.out.println("Random\"String 1");System.out.println("Another Random
String");String x = "Random String once again";
Output line
System.out.println("");System.out.println("");String x = "";
Is this possible using regex?
I will be highly greatful if you can help me find such a regular
expression. Or please let me know whether this can be achieved using regex
or not.
My question is precise and has sufficient details, and I know this can be
solved using some java parser easily. But I have to use regular
expressions only. So please don't ask for any further details or suggest
alternate ways other than regex. Thank you for your understanding :)
About the Input line: multiple string literals on the same line. the
string literals can contain quote character also (following an escape
character, as in Random\"String1).
Please let me know if there is any regex that can convert the following
input into the following output:
Input line (Single line)
System.out.println("Random\"String 1");System.out.println("Another Random
String");String x = "Random String once again";
Output line
System.out.println("");System.out.println("");String x = "";
Is this possible using regex?
I will be highly greatful if you can help me find such a regular
expression. Or please let me know whether this can be achieved using regex
or not.
My question is precise and has sufficient details, and I know this can be
solved using some java parser easily. But I have to use regular
expressions only. So please don't ask for any further details or suggest
alternate ways other than regex. Thank you for your understanding :)
About the Input line: multiple string literals on the same line. the
string literals can contain quote character also (following an escape
character, as in Random\"String1).
Subscribe to:
Posts (Atom)