I know that we can use element.dispatchEvent(custom_event) to dispatch a custom event that we defined.  My question is how to dispatch built-in events, such as submit, click, change, ...  I write form.on('submit', function(){}) to hanlde form submitting event. Then, I want to dispatch submit form by clicking on an X element.  X.on('click', function(){     // dispatch form submit here });   P/s: I'm using PrototyeJS
Does anybody know of a method to trigger an event in Prototype, as you can with jQuery's trigger function?  I have bound an event listener using the observe method, but I would also like to be able to fire the event programatically.  Thanks in advance
Render not showing UV texture Best practices for storing UI settings? we're currently planning a larger WPF LoB application and i wonder what others think being the best practice for storing lots of UI settings e.g.   Expander States Menu orders Sizing Properties etc...   i don't like the idea of having dozens of stored values using the delivered SettingsProvider (i.e. App.config file) although it can be used to store it in an embedded database using a custom SettingsProvider. being able to use some kind of databinding is also a concern. Has anyone had the same problems?   What did you do to store lots of ui user settings? How to exclude some files from filename expansion mechanism in bash? In a photoelectric effect we remove electrons from a metal using high energy photons, the work function is the minimal energy required for this effect.  My question is why doesnt the work fucntion depended on time? The more electrons we take out from the metal, the more ionized it becomes (if we remove a lot of negative charge, it will turn positive), and as a result we would expect to need more energy for this effect (the possitive charge of the metal would make it harder to remove the remaining electrons).  Why does the work function remains constant no matter how much electrons we take out? According to HTML specs, the select tag in HTML doesn't have a readonly attribute, only a disabled attribute. So if you want to keep the user from changing the dropdown, you have to use disabled.  The only problem is that disabled HTML form inputs don't get included in the POST / GET data.  What's the best way to emulate the readonly attribute for a select tag, and still get the POST data? Riemann and Darboux Integral of a product of two functions Star rating in AJAX with Ruby On Rails Add a custom curve mapping property for an add-on? Question The title says it all. I want to be able to make this in Blender's UI, and sample it at specific points :  Problem There is very insufficient documentation on this, and I can't find any examples for how to create a . I have worked with templates before, and , but it requires a curve mapping prop. Extra Info I found a few threads about this, and one gives me the impression that this cannot be done at all, but it is also very old.   This similar question has been asked here before, but it didn't even get a comment:  Is this even possible to access in python (as in only accessible in C)? As per passport my name is Manish Kumar Ahuja, but by mistake I book a ticket with the name of Manish Ahuja. My middle name is not on the ticket. Can I fly on this ticket? Because the airline can't add the name and they say that the ticket is non-refundable. Differences between longtable and xtab I have a pretty simple table that needs to span multiple pages. This seems like a job for either the / package or the  package.   The voting on the answers to this  suggest that longtable is the preferred package, yet xtab is much newer and has been revised since that question was asked.  What are the differences between xtab and longtable and when is one preferable to the other? Structuring game narrative. Handling NPC, Quest, General Dialogue. Is Json/XML the right way to go? Or any other solutions? Hello guys I'm try to make some games that have more to it than just simple high score scrolling shooters etc.  I'm trying to design my own systm of handling narrative. I want to be able to place NPC's in the game world, with scripts attached to them. Some of the NPC's would just have n random greetings. Others will be mission givers and will offer you a quest of sorts. (The quest could be go speak to Bob in the pub, or it might be bring me the Holy Grail and Crown Jewels, or something in between).  I've wracked my brain for a long while over this but sadly keep slipping back to the only way I know how, which is to manually code all the strings that people can say and have a horrible web of if statements and other such insanity to give me a rudimental dialogue system. Its not good enough even with just a few characters, but if I had dozens/hundreds of characters it would be even worse.  I've read lots about it already but I'm still very confused when I start trying on my own project. I've read that Json/XML might be the way to go and that I can add custom markups in the Json text to call methods in my code, but I dont even know if this is right and if so how I can do it.  The back of my brain is screaming at me that there is a simpler way to do it, but I've sat here for a very long time without managing to think of ideas.  Here is a diagram I drew which pretty much shows the flow of how I want my NPC to behave. If anyone can see this and then tell me how they might do something like this that would be fantastic!! (note: if Json is the correct advise, please give me a exact example of how exactly to format the Json in order to check the bools I mention in my flowchart - thanks!):    note: The circles denote an output from the data as Text for the dialogue system. The bools will need to be checked against by the data file to see which output to give (hope that makes sense and is possible) How does a  work, and what differentiates it from other linear classifiers, such as the , , or ? *  (* I'm thinking in terms of the underlying motivations for the algorithm, optimisation strategies, generalisation capabilities, and run-time complexity) How do I add polygons to fill a face? trying to recreate this Elijah bottle. I have two sides, one of which is outlined in red. How do I fill that face with polygons so I can then grab the center (that red square dot) to pull it outward thereby creating the slight outward bowing of the bottle? Is it allowed/desirable to post code snippets? Instead of asking a question I would love to share the one or other code snippet I have created that is too small to make a full article on e.g. CodeProject.com or CodePlex.com.  Question: Would it be a good idea to post it as a Stack Overflow question? Or are there any other suggestions how to share it?  (Of course I could post it on my own weblog and then twitter about it, but I would love to put it in more of a programming context) Smooth transition between two materials I need to make the transition smoother between the 2 different colored objects in my scene, somehow like one of the colors fades into the other one, while still keeping the line between them. Postgres JDBC connection in Eclipse Help I'm trying to get a postgres jdbc connection working in eclipse. It would be nice to use the Data Source Explorer, but for now I'm just trying to get a basic connection. What I have done so far is download the postgres JDBC connector. I then tried two different things. First, Preferences-> Data Management, I tried to add the postgres connector. Second, I added the jar to my project and tried to load the driver using Class.forName("org.postgresql.Driver"); but neither worked. Does anyone have any ideas?  Thanks,    Charlie I find myself needing to draw lots of elegantly curved paths in TikZ. Ideally, I'd just specify a series of points, and TikZ would calculate the extra data itself to draw a nice series of curves passing smoothly through these points, perhaps with an optional "looseness" parameter that I could specify. But the only way I can find to draw nice curves is by explicitly giving control points, or by manually specifying in and out angles.  I can think up a simple algorithm to do this, which would certainly be within TikZ's power to perform: just choose the in and out angles in a simple fashion based on the relative angles between each adjacent pair of line segments.  Is something like this already built-in? Or can someone cook something up that does the job?  Edit: Jake has provided an answer using the plot [smooth] functionality. This is almost perfect! But it can't do what I need, because it doesn't let me specify tangent angles manually where needed, which is especially important at the beginning and end of the curve. I would have thought this would be a natural and straightforward addition to the existing plot [smooth] algorithm: for every coordinate, an optional angle should be able to be specified as an argument, which if supplied is treated as the tangent angle for the curve at that point. And while we're at it, it wouldn't hurt to also allow the tension to be modified along the path.  A minimal extension to the algorithm would just accept two optional parameters, for the curve tangent at the beginning and end. Distance from a point to a plane in normed spaces How can we calculate the distance from a point to a plane in normed spaces ? where we are not inner product, for example:  Calculate the distance in $(C[0,1],||\cdot||)$ endowed with the supremum norm $$||f||=\sup_{t\in[0,1]}|f(t)|$$ from the function $f(t)=t^2$ to the linear hull of the functions $g(t)=t$  and  $h(t)=\sin(t)$  Any hints would be appreciated. I've just set up a new machine with Ubuntu Oneiric 11.10 and then run  apt-get update apt-get upgrade apt-get install git   Now if I run git --version it tells me I have git version 1.7.5.4 but on my local machine I have the much newer git version 1.7.9.2  I know I can install from source to get the newest version, but I thought that it was a good idea to use the package manager as much as possible to keep everything standardized.  So is it possible to use apt-get to get a newer version of git, and what is the right way to do it? How to tweet using terminal?