Search Results

Search found 639 results on 26 pages for 'dog ears'.

Page 9/26 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • jquery animation callback - how to pass parameters to callback

    - by Hans
    I´m building a jquery animation from a multidimensional array, and in the callback of each iteration i would like to use an element of the array. However somehow I always end up with last element of the array instead of all different elements. html: <div id="square" style="background-color: #33ff33; width: 100px; height: 100px; position: absolute; left: 100px;"></div> javascript: $(document).ready(function () { // Array with Label, Left pixels and Animation Lenght (ms) LoopArr = new Array( new Array(['Dog', 50, 500]), new Array(['Cat', 150, 5000]), new Array(['Cow', 200, 1500]) ); $('#square').click(function() { for (x in LoopArr) { $("#square").animate({ left: LoopArr[x][0][1] }, LoopArr[x][0][2], function() { alert (LoopArr[x][0][0]); }); } }); }); ` Current result: Cow, Cow, Cow Desired result: Dog, Cat, Cow How can I make sure the relevant array element is returned in the callback?

    Read the article

  • How to transform phrases and words into MD5 hash?

    - by brilliant
    Can anyone, please, explain to me how to transform a phrase like "I want to buy some milk" into MD5? I read Wikipedia article on MD5, but the explanation given there is beyond my comprehension: "MD5 processes a variable-length message into a fixed-length output of 128 bits. The input message is broken up into chunks of 512-bit blocks (sixteen 32-bit little endian integers)" "sixteen 32-bit little endian integers" is already hard for me. I checked the article on little endians and didn't understand a bit. However, the examples of some phrases and their MD5 hashes are very nice: MD5("The quick brown fox jumps over the lazy dog") = 9e107d9d372bb6826bd81d3542a419d6 MD5("The quick brown fox jumps over the lazy dog.") = e4d909c290d0fb1ca068ffaddf22cbd0 Can anyone, please, explain to me how this MD5 algorithm works on some very simple example? And also, perhaps you know some software or a code that would transform phrases into their MD5. If yes, please, let me know.

    Read the article

  • Python re.sub MULTILINE caret match

    - by cdleary
    The Python docs say: re.MULTILINE: When specified, the pattern character '^' matches at the beginning of the string and at the beginning of each line (immediately following each newline)... By default, '^' matches only at the beginning of the string... So what's going on when I get the following unexpected result? >>> import re >>> s = """// The quick brown fox. ... // Jumped over the lazy dog.""" >>> re.sub('^//', '', s, re.MULTILINE) ' The quick brown fox.\n// Jumped over the lazy dog.'

    Read the article

  • css formatting problems

    - by Davey
    So I wanted to mess around with Sass so I created this tiny incredibly simple little page. For reasons unknown to me when I add a top-margin to #content it effects my wrapper div instead. Any information as to why this is happening would be greatly appreciated. Thanks! Here is the page live: http://cheapramen.com/omg/ html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" /> <title>YO</title> </head> <body> <div id="wrapper"> <div id="content"> <div class="dog"> Bury me with my money </div> </div> </div> </body> </html> Sass html body background-color: #000 padding: 0 margin: 0 height: 100% #wrapper background-color: #fff width: 900px height: 700px margin: 0 auto #content width: 500px margin: 150px 0 0 50px .dog color: #FF3836 font-size: 25px text-shadow: 2px 2px 2px #000 width: 500px height: 500px -moz-border-radius: 5px -webkit-border-radius: 5px border: 18px solid #FF3836 Css that the Sass spits out html body { background-color: #000; padding: 0; margin: 0; height: 100%; } #wrapper { background-color: #fff; width: 900px; height: 700px; margin: 0 auto; } #content { width: 500px; margin: 150px 0 0 50px; } .dog { color: #FF3836; font-size: 25px; text-shadow: 2px 2px 2px #000; width: 500px; height: 500px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border: 18px solid #FF3836; }

    Read the article

  • Split large text string into variable length strings without breaking words and keeping linebreaks a

    - by Frank
    I am trying to break a large string of text into several smaller strings of text and define each smaller text strings max length to be different. for example: "The quick brown fox jumped over the red fence. The blue dog dug under the fence." I would like to have code that can split this into smaller lines and have the first line have a max of 5 characters, the second line have a max of 11, and rest have a max of 20, resulting in this: Line 1: The Line 2: quick brown Line 3: fox jumped over the Line 4: red fence. Line 5: The blue dog Line 6: dug under the fence. All this in C# or MSSQL, is it possible?

    Read the article

  • get particular string using regex java

    - by hussain
    i want to know how to get the string from group of string String j = "<a href=\"/watch?v=4Qx-lBqOqiQ&feature=popular\" onclick=\"\" onmousedown=\"yt.analytics.urchinTracker(\'/Events/Home/PersonalizedHome/POP/Logged_Out');\" ><span class=\"video-thumb video-thumb-220 \" id=\"video-thumb-4Qx-lBqOqiQ-8821469\"><img src=\"http://i1.ytimg.com/vi/4Qx-lBqOqiQ/hqdefault.jpg\" class=\"vimg220\" alt=\"Dog Squirrel Chasing A Squirrel\" title=\"Dog Squirrel Chasing A Squirrel\" onclick=\";yt.www.watch.watch5.IEshenanigans(event, this)\"><span class=\"video-time\"><span>1:08</span></span><span class=\"video-actions\"><button class=\"yt-uix-button-short yt-uix-button yt-uix-button-arrowbutton\" onclick=\"; return false;\" type=\"button\"> <img class=\"yt-uix-button-arrow\" src=\"http://s.ytimg.com/yt/img/pixel-vfl73.gif\" alt=\"\"> hai</a>"; i want to get the string href=\"/watch?v=4Qx-lBqOqiQ&feature=popular\" and src=\"http://i1.ytimg.com/vi/4Qx-lBqOqiQ/hqdefault.jpg\" thanks and advance

    Read the article

  • How to get all words of a string in c#?

    - by Joseph Lafuente
    I have a paragraph in a single string and I'd like to get all the words in that paragraph. My problem is that I don't want the suffixes words that end with punctuation marks such as (',','.',''','"',';',':','!','?') and /n /t etc. I also don't want words with 's and 'm such as world's where it should only return world. In the example he said. "My dog's bone, toy, are missing!" the list should be: he said my dog bone toy are missing

    Read the article

  • Persist collection of interface using Hibernate

    - by Olvagor
    I want to persist my litte zoo with Hibernate: @Entity @Table(name = "zoo") public class Zoo { @OneToMany private Set<Animal> animals = new HashSet<Animal>(); } // Just a marker interface public interface Animal { } @Entity @Table(name = "dog") public class Dog implements Animal { // ID and other properties } @Entity @Table(name = "cat") public class Cat implements Animal { // ID and other properties } When I try to persist the zoo, Hibernate complains: Use of @OneToMany or @ManyToMany targeting an unmapped class: blubb.Zoo.animals[blubb.Animal] I know about the targetEntity-property of @OneToMany but that would mean, only Dogs OR Cats can live in my zoo. Is there any way to persist a collection of an interface, which has several implementations, with Hibernate?

    Read the article

  • What's the standard way to organize the contents of Java packages -- specifically the location of in

    - by RenderIn
    I suppose this could go for many OO languages. I'm building my domain objects and am not sure where the best place is for the interfaces & abstract classes. If I have a pets package with various implementations of the APet abstract class: should it live side-by-side with them or in the parent package? How about interfaces? It seems like they almost have to live above the implementations in the parent package, since there could potentially be other subpackages which implement it, while there seems to be a stronger correlation between one abstract class and a subpackage. e.g. com.foo com.foo.IConsumer (interface) com.foo.APet (abstract) com.foo.pets.Dog extends APet implements IConsumer OR com.foo com.foo.IConsumer (interface) com.foo.pets.APet (abstract) com.foo.pets.Dog extends APet implements IConsumer or something else?

    Read the article

  • Serialize a generic collection specifying element names for items in the collection

    - by mdresser
    I have a simple class derived from a generic list of string as follows: [Serializable] [System.Xml.Serialization.XmlRoot("TestItems")] public class TemplateRoleCollection : List<string> { } when I serialize this, I get the following XML: <TestItems> <string>cat</string> <string>dog</string> <string>wolf</string> </TestItems> Is there any way to override the xml element name which is used for serializing items in the collection? I would like the following xml to be produced: <TestItems> <TestItem>cat</TestItem> <TestItem>dog</TestItem> <TestItem>wolf</TestItem> </TestItems>

    Read the article

  • Using Ruby on Rails, can a polymorphic database be created in a few steps (with polymorphic associat

    - by Jian Lin
    I thought it could be created in a few steps but it can't yet: rails poly cd poly ruby script/generate scaffold animal name:string obj_type:string obj_id:integer rake:migrate ruby script/generate scaffold human name:string passportNumber:string rake:migrate ruby script/generate scaffold dog name:string registrationNumber:string rake:migrate and now change app/models/animal.rb to: class Animal < ActiveRecord::Base belongs_to :obj, :polymorphic => true end and run ruby script/server and go to http://localhost:3000 I thought on the server then if I create an Michael, Human, J123456 and then Woofie, Dog, L23456 then the database will have entries in the Dogs table and "Humen" or "Humans" table as well as in the Animals table? But only the Animals table has records, Dogs and "Humen" do not for some reason. Is there some steps missing?

    Read the article

  • determine which value produced a hit in SOLR multivalued field type

    - by harschware
    If I have a multiValued field type of text, and I put values [cat,dog,green,blue] in it. Is there a way to tell when I execute a query against that field for dog, that it was in the 1st element position for that multiValued field? Assumption: client does not have any pre-knowledge of what the field type of the field being queried is. (i.e. Solr must provide the answer and the client can't post process the return doc to figure it out because it would not know how SOLR matched the query to the result). Disclosure: I posted to solr-user list and am getting no traction so I post here now.

    Read the article

  • How do I output an individual character when using char *[] = "something"

    - by Matt
    I've been playing with pointers to better understand them and I came across something I think I should be able to do, but can't sort out how. The code below works fine - I can output "a", "dog", "socks", and "pants" - but what if I wanted to just output the 'o' from "socks"? How would I do that? char *mars[4] = { "a", "dog", "sock", "pants" }; for ( int counter = 0; counter < 4; counter++ ) { cout << mars[ counter ]; } Please forgive me if the question is answered somewhere - there are 30+ pages of C++ pointer related question, and I spent about 90 minutes looking through them, as well as reading various (very informative) articles, before deciding to ask.

    Read the article

  • Convert a complicated string into an array in php

    - by Patrick Beardmore
    I have a php variable that comes from a form that needs tidying up. I hope you can help. The variable contains a list of items (possibly two or three word items with a space in between words). I want to convert it to a comma separated list with no superfluous white space. I want the divisions to fall only at commas, semi-colons or new-lines. Blank cannot be an item. Here's a comprehensive example (with a deliberately messy input): Variable In: "dog, cat ,car,tea pot,, ,,, ;;(++NEW LINE++)fly, cake" Variable Out "dog,cat,car,tea pot,fly,cake" Can anyone help?

    Read the article

  • Is it possible to refactor this C# if(..) statement?

    - by Pure.Krome
    Hi folks, simple question :- i have the following simple if (..) statements :- if (foo == Animal.Cat || foo == Animal.Dog) { .. } if (baa == 1|| baa == 69) { .. } is it possible to refactor these into something like ... DISCLAIMER: I know this doesn't compile .. but this is sorta what i'm trying to get... if (foo == (Animal.Cat || Animal.Dog)) { .. } if (baa == (1 || 69)) { .. } Cheers :) EDIT I wonder if a lambda expression extension could do this? :P

    Read the article

  • How to save derived type (TPT) in Entity Framework?

    - by Peter Stegnar
    I have problems with saving derived type (TPT) with Entity Framework to database. Let's say I have base entity Animal and derived type Dog. I want to save Dog entity. I thought that I could do it like contex.AddToDogs(), but contex contain only base entity - Animal. So I can only save Animal object - contex.AddToAnimals(). I have also tried with contex.AddObject("Animals", dogInstance), but I get the following error: The member with identity 'NavigationProperty' does not exist in the metadata collection. But I have add EntityReference to the "NavigationProperty". So how to save derived type in EF?

    Read the article

  • Custom constructors for models in Google App Engine (python)

    - by Nikhil Chelliah
    I'm getting back to programming for Google App Engine and I've found, in old, unused code, instances in which I wrote constructors for models. It seems like a good idea, but there's no mention of it online and I can't test to see if it works. Here's a contrived example, with no error-checking, etc.: class Dog(db.Model): name = db.StringProperty(required=True) breeds = db.StringListProperty() age = db.IntegerProperty(default=0) def __init__(self, name, breed_list, **kwargs): db.Model.__init__(**kwargs) self.name = name self.breeds = breed_list.split() rufus = Dog('Rufus', 'spaniel terrier labrador') rufus.put() The **kwargs are passed on to the Model constructor in case the model is constructed with a specified parent or key_name, or in case other properties (like age) are specified. This constructor differs from the default in that it requires that a name and breed_list be specified (although it can't ensure that they're strings), and it parses breed_list in a way that the default constructor could not. Is this a legitimate form of instantiation, or should I just use functions or static/class methods? And if it works, why aren't custom constructors used more often?

    Read the article

  • Polymorphic classes in templates

    - by soxarered
    Let's say we have a class hierarchy where we have a generic Animal class, which has several classes directly inherit from it (such as Dog, Cat, Horse, etc..). When using templates on this inheritance hierarchy, is it legal to just use SomeTemplateClass<Animal> and then shove in Dogs and Cats and Horses into this templated object? For example, assume we have a templated Stack class, where we want to host all sorts of animals. Can I simply state Stack<Animal> s; Dog d; s.push(d); Cat c; s.push(c);

    Read the article

  • Inheritance and Implicit Type Casting

    - by Josué Molina
    Suppose I have the following three classes: class Animal {}; class Human : public Animal {}; class Dog : public Animal { public: void setOwner(Animal* owner) { this->owner = owner; } private: Animal* owner; }; Why is the following allowed, and what exactly is happening? Dog d; Human h; d.setOwner(&h); // ? At first, I tried to cast it like this d.setOwner(&(Animal)h), but the compiler gave me a warning, and I hit a run-time error. Edit: the warning the compiler gave me was "taking address of temporary". Why is this so?

    Read the article

  • play framework WS API always escape character ';' and '=' in URL

    - by user2512057
    When I send a URL like abc.efg.com/query?para1=cat;para2=dog, play WS API always convert it to abc.efg.com/query?para1=cat%03Bpara2%03Ddog. Of course, there are http:// in the beginning in the URL. my code is as below. val url= "http://abc.efg.com/query?para1=cat;para2=dog" val response = WS.url(url).get() When I use fidder or netmon to look at the data that sent to sever, I found play framework WS (2.1.5) always change to the URL above I mentioned. How do I tell WS not to convert?

    Read the article

  • How does the below program work in c++?

    - by Srinivasa Varadan
    I have just created 2 pointers which has undefined behavior and try to invoke a class member function which has no object created ? I don't understand this? #include<iostream> using namespace std; class Animal { public: void talk() { cout<<"I am an animal"<<endl; } }; class Dog : public Animal { public: void talk() { cout<<"bark"<<endl; } }; int main() { Animal * a; Dog * d; d->talk(); a->talk(); }

    Read the article

  • Clojure: using *command-line-args* in the script rather than REPL

    - by Teflon Mac
    I've clojure running within Eclipse. I want to pass arguments to clojure when running it. In the below the arguments are available in the REPL but not in the script itself. What do I need to do such that in the below typing arg1 in the REPL will return the first argument? Script: (NS Test) (def arg1 (nth *command-line-args* 0)) After clicking on the Eclipse "Run"... Clojure 1.1.0 1:1 user=> #<Namespace test> 1:2 test=> arg1 nil 1:3 test=> *command-line-args* ("bird" "dog" "cat" "pig") 1:4 test=> (def arg2 (nth *command-line-args* 1)) #'test/arg2 1:5 test=> arg2 "dog" 1:6 test=>

    Read the article

  • Match a word with similar words using Solr?

    - by fayer
    I want to search for threads in my mysql database with Solr. But i want it to not just search the thread words, but for similar words. Eg. if a thread title is "dog for sale" and if the user searches for dogs the title will be in the result. and also if a user searches for "mac os x" the word "snow leopard" will appear. and the ability to link words the application thinks is related eg. house and apartment. how is this kind of logic done? i know that you can with solr look up words in a dictionary file you create/add, so solr will look for dogs and see what related words there are (eg. dog). but where do you find such a dictionary? i have no idea about this kind of implementation. please point me into right direction. thanks

    Read the article

  • DB2 LUW Security - The DB2 DBA as a Locksmith

    Database security should have multiple locks at multiple layers with multiple keys (and perhaps some barbed wire, an electric fence, a moat and a mean junkyard dog as well). With all these locks and keys, some locksmith skills are certainly useful. Rebecca Bond introduces some of her favorite DB2 Locksmith tips.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >