About
Friends
-
Loading...comics 14 minutes ago -
Loading...kejtowa about 14 hours ago -
Loading...Panera about 7 hours ago -
Loading...bloggersblog 15 days ago -
Loading...ylem235 about 7 hours ago -
Loading...Funk_Up about 17 hours ago -
Loading...alphabet about 7 hours ago -
Loading...ffred 2 days ago -
Loading...ryan77 1 day ago -
-
Loading...Hoazl about 20 hours ago -
Loading...laughingsquid about 21 hours ago -
Loading...maxchad 6 months ago -
Loading...homunculus about 1 month ago -
Loading...hernicholswed 17 days ago -
Loading...Zaphod 22 minutes ago
Click here to check if anything new just came in.
August 09 2010
August 08 2010
Answer by Gabriel for Jquery Drag n Drop Stage
jQuery-ui Draggable Droppable event handler
You need to get the droppable dom object from the event arguments passed to the drop method.
$( ".selector" ).droppable({
drop: function(event, ui) {
// $(this) represents the droppable.
alert($(this).attr("id"));
}
});
the draggable object can be referenced through ui.draggable. Most of this was taken from the jQuer-ui documentation found at the jQuery-ui Website
Answer by Gabriel for How to overlay an image over another image?
from the code you posted, it appears you are passing an img element into another the src attribute of another img element. Is there a reason you are doing this?
<style type="text/css">
.imgA1 {position:absolute;
top:0px;
left:0px;
z-index:2;
width:1300px,
height:283px;}
.imgB1 {position:absolute;
top:0px;
left:0px;
z-index:1;
width:1300px,
height:1000px;}
</style>
<img class="imgA1" src="images/home_nav.png" alt="home_nav" />
<img class="imgB1" src="images/paperbackground.png" alt="Background" />
A similar code mockup can be seen at http://jsfiddle.net/gBPBd/3/ with my images to prove the concept and it is funcitoning in chrome, ie8.
Answer by Gabriel for Elegant workaround for JavaScript floating point number problem
This function will determine the needed precision from the multiplication of two floating point numbers and return a result with the appropriate precision. Elegant though it is not.
function multFloats(a,b){
var atens = Math.pow(10,String(a).length - String(a).indexOf('.') - 1),
btens = Math.pow(10,String(b).length - String(b).indexOf('.') - 1);
var result = (a * atens) * (b * btens) / (atens * btens);
return result;
}
August 07 2010
Answer by Gabriel for What's your way of learning a language?
I have gotten into new languages by coming up with a project. Maybe something you have already done in another language or something you would find useful(like a programming tool). Then try to write it in the language you wish to learn, at first using just what you understand about the language and can glean from books and websites. As you get the project to completion start asking in the community for someone to look at your code and ask questions for what appear to be problem areas.
It is important to realize that a language is usually very general while a problem will give it context. For instance I may know how to develop Java applications, but that does not mean I know how to develop J2EE applications. Same language, different context; so you may wish to think about that while coming up with the learning project or projects.
I also highly recommend building the project with very heavy unit testing. Writing unit tests is going to give you a solid set of tools that they will not be showing you in the books, your code will improve and more importantly any unexpected language idioms will stick out like a ... well like a failed test.
August 06 2010
August 05 2010
Palindrome Algorithm
// JavaScript
function pal(w){
return w.substr(0,((w.length / 2))).split('').reverse().join('') == w.substr(((w.length / 2)+((w.length % 2 == 0)?0:1)));
}
#Python
def pal(w):
c = w.count('')
x = int((c-1)/2)
z = c%2
return w[x-z::-1] == w[x::1]
August 03 2010
July 30 2010
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
