I have the following list:
<ul>
<li class="topCurrent">One
<ul>
<li>One-1
<ul>
<li>One-1.1
<ul>
<li class="current">One-1.1.1
<ul>
<li>One-1.1.1.1</li>
<li>One-1.1.1.2</li>
<li>One-1.1.1.3</li>
</ul>
</li>
<li>One-1.1.2</li>
</ul>
</li>
<li>One-1.2</li>
</ul>
</li>
<li>One-2</li>
<li>One-3</li>
</ul>
</li>
<li>Two
<ul>
<li>Two-1</li>
<li>Two-2</li>
</ul>
</li>
Using the following jQuery:
$("ul li ul").hide();
$("ul li").hoverIntent(
function(){
$(this).children('ul').slideDown('fast');
},
function(){
$(this).children('ul').slideUp('fast');
}
);
What this does is hide all of the ul below the top level ul until there is a hover over it.
What I would like to do is this:
If an li has a class="current" I would like that structure to be open up until the point that current is hit. It would still allow the ul below it to be displayed on a hover, as well as any other ul's, but at no point would the parents of class="current" be hidden.
Suggestions? This problem has been driving me crazy.
Thanks!
What I wanted to do was create a listbox from a delimited text file.
The listbox would populate X # of rows based on the rows of the text file. And the listbox would have 3 columns, each being populated from a specific delimiter. Is this possible in C#? Any starting point would be great!
I need write a live messenger plugin which periodically read messages from a remote http server, and then change my signature(the short message after my name) accordingly.
Can anyone point me to any open source project or materials where I can get started?
Thanks.
is there a way that if the following class is created; I can grab a list of attributes that exist. (this class is just an bland example, it is not my task at hand)
class new_class():
def __init__(self, number):
self.multi = int(number) * 2
self.str = str(number)
a = new_class(2)
print(', '.join(a.SOMETHING))
* the attempt is that "multi, str" will print. the point here is that if a class object has attributes added at different parts of a script that I can grab a quick listing of the attributes which are defined.
Considering that we're all constantly learning, we've all got to come across a point where we learn something just awesome that improves our code or parts of it significantly.
The question is, when you've learned some new technique, strategy or whatever, do your or should you go back to code that you know works, but could be so much better/maintainable/faster/generally improved and implement this new knowledge?
I understand the concept of "if it ain't broke, don't fix it" but when does that become losing pride in code you've already written and what does it say for refactoring.
How to track the mouse position on the screen regardless of application.i.e. Whenever the user clicks or select something with mouse in any application, i want to display my own menu at that point itself.
Is there any way to get mouse position on the screen using c#?
The windows service I am writing will need to run some processor intensive operations once in a while (sound encoding wav - mp3) on a machine that takes part in real time voice communication (so I cannot just run them any-time).
What would you check (what counters maybe) before running such operation?
Can you point me to any good articles?
Can anyone point me to some documentation on how to write scripts in Python (or Perl or any other Linux friendly script language) that generate C++ code from XML or py files from the command line. I'd like to be able to write up some xml files and then run a shell command that reads these files and generates .h files with fully inlined functions, e.g. streaming operators, constructors, etc.
Let's take for example a single file committed in CVS with the following history.
test.cpp
rev 1.1
rev 1.2
rev 1.3
How do I revert to rev 1.2 discarding the changes in 1.3 and then continue to make modification from that point on?
I know that in community server which means that you can't use Sessions, and few years ago i remember i was working on a website where we were not allowed to use sessions.
In my point of view sessions are a very helpful tool if we managed how to use the right way, but is using session variable in a website is something bad, when its bad and when its not?
RubyParser.new.parse "1+1"
s(:call, s(:lit, 1), :+, s(:array, s(:lit, 1)))
Above code is from this link
Why there is array after + in the Sexp. I am just trying to learn ruby parser and the whole AST thing. I have been programming for a while but have no formal education in computer science. So do point to good article which explains AST etc. Please no dragon book. I tried couple of times but couldn't understand much of that book
I am a c# developer which finds himself having to relearn c++. The last time I programmed in c++ was in school and am looking for good books as a refresher. I want something that assumes previous programming exposure and gets straight to the point. Is there a book similar to K&R for c++? I know the language is bloated so a book that covers a subset of c++ would be ideal.
The Core Data Programming Guide talks a lot about what not to overwrite. So the question is: What is good to overwrite?
Like I see it, I can't overwrite -init or -initWithEntity:insertIntoManagedObjectContext:
So where else would be a good overwrite point to set up some basic stuff? Or is it generally not needed to do custom initialization? Does the whole thing rely only on accessing properties which then start to do fancy things? So no custom initializations?
In many books weightx and weighty values are expressed in different ways:
some says 0.0 to 1.0
other says 0 to 100
other say until 1000
I'm a lot confused.
In the API these variables are double types so I think the first is correct but what does it meaning a value of 0.4 or 0.7? are percentage values, point values? relative of what?
I've got a simple active record validation on an object using this within a form:
form.error_messages({:message => '', :header_message => ''})
This in turn outputs something like "FieldName My Custom message"
What i need to do is remove the field name from the error message but leave my custom message.
Can anyone point me in the right direction for this.
The idea is that I want to build a small app that detects if the webcam is being used and by what.
I have thought about seeing who has use of the Twain.dll somehow (like the way process explorer knows)
It's for a security style app that picks out weird webcam behaviour.
Ideally I would use C# as it's my strong point, but I'm guessing it won't be that nice.
stdinBackup = 4;
dup2(0, stdinBackup);
Currently I am doing the above to 'backup' stdin so that it can be restored from backup later after it has been redirected somewhere else. I have a feeling that I am doing a lot wrong? (eg arbitrarily assigning 4 is surely not right). Anyone point me in the right direction?
Hi. Can anyone point out how to check if a select query returns non empty result set?
For example I have next query:
SELECT * FROM service s WHERE s.service_id = ?;
Should I do something like next:
ISNULL(SELECT * FROM service s WHERE s.service_id = ?)
to test if result set is not empty?
Hi,
I'm using godaddy shared hosting, with IIS7, Integrated mode, and published up a bog standard MVC2 app to dev.lazygekko.com created with Visual Web Developer 2010.
It all works, however when any of the links are clicked, they point to dev.lazygekko.com/dev/..., dev being the folder it is pointing at.
Can anyone shed some light on what I may be doing wrong?
Many thanks.
All I've been able to find is how to specify the sensor parameter:
http://code.google.com/apis/maps/documentation/v3/#SpecifyingSensor
But nowhere does it say how to actually USE it. Isn't the whole point to be able to get the user's current lat/long coordinates through the device GPS, or am I mistaken?
This works:
int main( int argc, char *argv[])
{
....
gtk_init(&argc, &argv);
....
But this doesn't:
int WINAPI WinMain (HINSTANCE p1, HINSTANCE p2, LPSTR argv, int argc) {
....
gtk_init(&argc, &argv);
....
Can someone point out what's wrong there?
is there a way to find out, where a function in PHP was called from?
example:
function epic()
{
fail();
}
function fail()
{
//at this point, how do i know, that epic() has called this function?
}
I have a PCRE regex that looks like this
s/(<input.+?)alt(=".+?".*?>)/$1title$2/
Can anybody help me with making that work on sed?
Eventually can anybody point me to some guide/blog post/whatever that explains differences between sed regex and pcre?