Search Results

Search found 31491 results on 1260 pages for 'simple talk'.

Page 59/1260 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • simple jquery dropdown - clearTimeout, setTimeout issues

    - by user210757
    HTML: <ul class="topnav"> <li><a href="#"><span>One</span></a></li> <li><a href="#"><span>Two</span></a></li> <li> <li><a href="#"><span>Three</span></a></li> <ul class="subnav"> <li><a href="#">A</a></li> <li><a href="#">B</a></li> <li><a href="#">C</a></li> </ul> </li> </ul> jquery: var timeout = null; $(document).ready(function() { $("ul.topnav li").mouseover(function() { if (timeout) clearTimeout(timeout); $(this).find("ul.subnav").slideDown('fast').show(); }).mouseout(function() { timeout = setTimeout(closemenu, 500); }); // sub menu mouseovers keep dropdown open $("ul.subnav li").mouseover(function() { if (timeout) clearTimeout(timeout); } ).mouseout(function() { timeout = setTimeout(closemenu, 500); // alert(timeout); }); // any click closes $(document).click(closemenu); }); // Closes all open menus function closemenu() { $('ul.subnav:visible').hide(); if (timeout) clearTimeout(timeout); } I'm having issues with timeout. In use, if i mouseover "Three", the dropdown stays out forever. if i mouseover "A", dropdown will stay out forever, but if I mouseover "B" or anything lower, the menu will close on me. if you uncomment "// alert(timeout);" it gets there for B, (and A) but timeout will have a value. why is this? i thought clearTimeout would null the timeout variable?

    Read the article

  • Simple HTML problem with href

    - by pallab
    I am trying to create images hyperlinked to some URL's and hyperlinks donot seem to work. I am using the code as given below at http://windchimes.co.in/index_w%20-%20Copy.html Can you tell me why the hyperlinks to the icons are not workking? <td width="29" style="padding-bottom: 42px;><a href="http://windchimes.co.in/blog" target="_blank"><img align="middle" title="blog" alt="blog" src="http://dl.dropbox.com/u/529534/windchimes/icon-blog.gif"></a></td><td width="29" style="padding-bottom: 42px;> <a href="http://www.linkedin.com/groups?gid=120310" target="_blank"><img align="middle" title="linkedin" alt="linkedin" src="http://dl.dropbox.com/u/529534/windchimes/icon-linkedin.gif"></a></td><td width="29" style="padding-bottom: 42px;> <a href="http://www.facebook.com/group.php?gid=72425590275" target="_blank"><img align="middle" title="facebook" alt="facebook" src="http://dl.dropbox.com/u/529534/windchimes/icon-facebook.gif"></a></td><td width="29" style="padding-bottom: 42px;> <a href="http://twitter.com/windchimesindia" target="_blank"><img align="middle" title="twitter" alt="twitter" src="http://dl.dropbox.com/u/529534/windchimes/icon-twitter.gif"></a></td><td width="29" style="padding-bottom: 42px;> <a href="http://www.youtube.com/user/Windchimesindia" target="_blank"><img align="middle" title="Youtube" alt="Youtube" src="http://dl.dropbox.com/u/529534/windchimes/icon-youtube.gif"></a><td>

    Read the article

  • Simple cropping with Paperclip

    - by collimarco
    I would like to crop images on upload using Paperclip to get square thumbs from the center of the original picture. I find out a method in documentation that seems to do exactly what I want: transformation_to(dst, crop = false) The problem is that I can't figure out where to use this method. It would be great to simply pass something as a parameter here: has_attached_file :picture, :styles = { :medium = "600x600", :thumb = "something here" }

    Read the article

  • PHP Simple dynamic breadcrumb

    - by Adrian
    Hello, I think this script is of big interest to any noob around here :) including me :) What I want to create is a little code that I can use in any file and will generate a breadcrumb like this: If the file is called "website.com/templates/index.php" the breadcrumb should show: Website.com Templates ^^ link ^^plain text If the file is called "website.com/templates/template_some_name.php" the breadcrumb should show: Website.com Templates Template Some Name ^^ link ^^link ^^plain text I am grateful for any reply, thanks!

    Read the article

  • Save simple data in Magento's DB w/o Model

    - by Joseph Mastey
    I'm looking to save some data in the Magento database without hassling with creating a new EAV object (or even a DB table if I can avoid it). Is there any place that you all know about that Magento will let you store serialized data? If it matters, the data is a serialized set of SKUs that I need to retrieve. I know that I could create a new model, or possibly even create an attribute as a flag on each product, but those are both really overkill for my purposes. Thanks, Joe

    Read the article

  • IE error on simple jQuery

    - by jamietelin
    Detaild information about the error Useraget: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Tiemstamp: Tue, 25 May 2010 08:54:11 UTC Message: Object doesn't support this property or method Row: 208 Character: 3 Code: 0 At row 208 i have perpage = $("#perpage").val(); What is wrong here? It only happens in IE8, Firefox runs it flawlessly. Anyone have any idea?

    Read the article

  • Whats wrong with this simple Layout?

    - by Sebi
    Im trying to define a LinearLayout which contains another LinearLayout which should always be desplayed in the horizontal and vertical center. An ImageView should be placed always vertically centered on the right side of the parent Layout: A B I defined it the following: <LinearLayout android:id="@+id/footer" android:orientation="horizontal" android:layout_height="50px" android:paddingTop="5px" android:layout_width="wrap_content" android:background="@drawable/footer_border" android:paddingRight="5px" android:paddingLeft="5px" android:layout_gravity="center_horizontal" <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:id="@+id/loading"> </ImageView> </LinearLayout> But unfornatuley its not working... The LinearLayout (A) and the ImageView (B) is on the left side.... But i set gravity to center and right?? Why?

    Read the article

  • Haskell simple compilation bug

    - by fmsf
    I'm trying to run this code: let coins = [50, 25, 10, 5, 2,1] let candidate = 11 calculate :: [Int] calculate = [ calculate (x+candidate) | x <- coins, x > candidate] I've read some tutorials, and it worked out ok. I'm trying to solve some small problems to give-me a feel of the language. But I'm stuck at this. test.hs:3:0: parse error (possibly incorrect indentation) Can anyone tell me why? I've started with haskell today so please go easy on the explanations. I've tried to run it like: runghc test.hs ghc test.hs but with: ghci < test.hs it gives this one: <interactive>:1:10: parse error on input `=' Thanks

    Read the article

  • Unable to reverse seemingly simple rails migration - getting "altered_table.column may not be NULL"

    - by brad
    I have a table 'invoices' in my development database (sqlite3) populated with a small amount of test data. I wanted to add a column 'invoice_number' to it and set up a migration like so: class AddInvoiceNumberColumnToInvoices < ActiveRecord::Migration def self.up add_column :invoices, :invoice_number, :integer end def self.down remove_column :invoices, :invoice_number end end I ran rake db:migrate and it seemed to migrate just fine. However, when I tried to access this column through ActiveRecord it didn't seem to be there. I decided to undo this migration and try again (not sure what I was going to try but I thought I'd start by undoing it) with rake db:migrate VERSION='whatever_the_migration_before_this_one_was_called'. This failed with the error message == AddInvoiceNumberColumnToInvoices: reverting =============================== -- remove_column(:invoices, :invoice_number) rake aborted! An error has occurred, this and all later migrations canceled: altered_invoices.invoice_number may not be NULL I can't find any documentation of this error. Is anyone able to explain what I have done wrong, and more importantly how I can fix this?

    Read the article

  • Simple 3x3 matrix inverse code (C++)

    - by batty
    What's the easiest way to compute a 3x3 matrix inverse? I'm just looking for a short code snippet that'll do the trick for non-singular matrices, possibly using Cramer's rule. It doesn't need to be highly optimized. I'd prefer simplicity over speed. I'd rather not link in additional libraries. Primarily I was hoping to have this on Stack Overflow so that I wouldn't have to hunt around for it or rewrite from scratch again next time.

    Read the article

  • My simple program runs on Android emulator, but not on my Nexus One

    - by noisesolo
    To clarify, I have no trouble getting the Nexus One connected in developer's mode. I can actually get Eclipse to "run" my program on my Nexus One. However, my Nexus One simply gets stuck in a reboot loop. I've also created an .apk file and put it onto my Nexus One, installing it with apkInstaller. However, it crashed while installing. I see my app on my phone, but I'm kind of afraid to run it. I am not doing anything fancy in my program; all it does is generate text by shuffling a couple arrays of strings together. It uses a bunch of text views, two buttons, and a spinner. I have only edited the main source file, the strings XML file, and the layout XML file, nothing else. It's a 2.1-update1 program and it runs fine on the emulator. Does anyone have any idea what's going on? I'm using Windows 7 (32 bit) and my Nexus One is running Cyanogen 5.0.7.1. I'm pretty sure it's my code that's causing the problem. Now I'm just wondering if there are any common mistakes that would lead my app to run on the emulator but not on my device. Thanks in advance.

    Read the article

  • How to access a simple file or folder from Tomcat webapps folder

    - by Ankur
    I want to be able to access a folder from my tomcat webapps folder so that I can give someone a URL like: http://localhost:8080/myFolder/myFile.f And in a web browser if they point to this they should start downloading the file. But in reality I get a 404 error when I try to point to this location. How can I solve this or get around it.

    Read the article

  • A few questions about a Rails model for a simple addressbook app

    - by user284194
    I have a Rails application that lists information about local services. My objectives for this model are as follows: 1. Require the name and tag_list fields. 2. Require one or more of the tollfreephone, phone, phone2, mobile, fax, email or website fields. 3. If the paddress field has a value, then encode it with the Geokit plugin. Here is my entry.rb model: class Entry < ActiveRecord::Base validates_presence_of :name, :tag_list validates_presence_of :tollfreephone or :phone or :phone2 or :mobile or :fax or :email or :website acts_as_taggable_on :tags acts_as_mappable :auto_geocode=>{:field=>:paddress, :error_message=>'Could not geocode physical address'} before_save :geocode_paddress validate :required_info def required_info unless phone or phone2 or tollfreephone or mobile or fax or email or website errors.add_to_base "Please have at least one form of contact information." end end private def geocode_paddress #if paddress_changed? geo=Geokit::Geocoders::MultiGeocoder.geocode (paddress) errors.add(:paddress, "Could not Geocode address") if ! geo.success self.lat, self.lng = geo.lat,geo.lng if geo.success #end end end Requiring name and tag_list work, but requiring one (or more) of the tollfreephone, phone, phone2, mobile, fax, email or website fields does not. As for encoding with Geokit, in order to save a record with the model I have to enter an address. Which is not the behavior I want. I would like it to not require the paddress field, but if the paddress field does have a value, it should encode the geocode. As it stands, it always tries to geocode the incoming entry. The commented out "if paddress_changed?" was not working and I could not find something like "if paddress_exists?" that would work. Help with any of these issues would be greatly appreciated. I posted three questions pertaining to my model because I'm not sure if they are preventing each other from working. Thank you for reading my questions.

    Read the article

  • Ruby: what is the pitfall in this simple code excerpt that tests variable existence

    - by zipizap
    I'm starting with Ruby, and while making some test samples, I've stumbled against an error in the code that I don't understand why it happens. The code pretends to tests if a variable finn is defined?() and if it is defined, then it increments it. If it isn't defined, then it will define it with value 0 (zero). As the code threw an error, I started to decompose it in small pieces and run it, to better trace where the error was comming from. The code was run in IRB irb 0.9.5(05/04/13), using ruby 1.9.1p378 First I certify that the variable finn is not yet defined, and all is ok: ?> finn NameError: undefined local variable or method `finn' for main:Object from (irb):134 from /home/paulo/.rvm/rubies/ruby-1.9.1-p378/bin/irb:15:in `<main>' >> Then I certify that the following inline-condition executes as expected, and all is ok: ?> ((defined?(finn)) ? (finn+1):(0)) => 0 And now comes the code that throws the error: ?> finn=((defined?(finn)) ? (finn+1):(0)) NoMethodError: undefined method `+' for nil:NilClass from (irb):143 from /home/paulo/.rvm/rubies/ruby-1.9.1-p378/bin/irb:15:in `<main>' I was expecting that the code would not throw any error, and that after executing the variable finn would be defined with a first value of 0 (zero). But instead, the code thows the error, and finn get defined but with a value of nil. >> finn => nil Where might the error come from?!? Why does the inline-condition work alone, but not when used for the finn assignment? Any help apreciated :)

    Read the article

  • Simple wordpress Registration

    - by andrew
    I am looking for a wordpress plugin which simplifies the registration process by allowing users to sign up on the spot without having to be sent an email? It would be good if you could also pass a redirect_to parameter in the url like you can for the login. Note:Some thoughtless person migrated this question over to super user where it was closed. I believe this question fits the criteria allowable for stack overflow.

    Read the article

  • Simple wordpress Registration

    - by andrew
    Does anyone know of a wordpress plugin which simplifies the registration process by allowing users to sign up on the spot without having to be sent an email? It would be good if you could also pass a redirect_to parameter in the url like you can for the login.

    Read the article

  • simple Java "service provider frameworks"?

    - by Jason S
    I refer to "service provider framework" as discussed in Chapter 2 of Effective Java, which seems like exactly the right way to handle a problem I am having, where I need to instantiate one of several classes at runtime, based on a String to select which service, and an Configuration object (essentially an XML snippet): But how do I get the individual service providers (e.g. a bunch of default providers + some custom providers) to register themselves? interface FooAlgorithm { /* methods particular to this class of algorithms */ } interface FooAlgorithmProvider { public FooAlgorithm getAlgorithm(Configuration c); } class FooAlgorithmRegistry { private FooAlgorithmRegistry() {} static private final Map<String, FooAlgorithmProvider> directory = new HashMap<String, FooAlgorithmProvider>(); static public FooAlgorithmProvider getProvider(String name) { return directory.get(serviceName); } static public boolean registerProvider(String name, FooAlgorithmProvider provider) { if (directory.containsKey(name)) return false; directory.put(name, provider); return true; } } e.g. if I write custom classes MyFooAlgorithm and MyFooAlgorithmProvider to implement FooAlgorithm, and I distribute them in a jar, is there any way to get registerProvider to be called automatically, or will my client programs that use the algorithm have to explicitly call FooAlgorithmRegistry.registerProvider() for each class they want to use?

    Read the article

  • Can someone here explain constructors and destructors in python - simple explanation required - new

    - by rgolwalkar
    i will try to see if it makes sense :- class Person: '''Represnts a person ''' population = 0 def __init__(self,name): //some statements and population += 1 def __del__(self): //some statements and population -= 1 def sayHi(self): '''grettings from person''' print 'Hi My name is %s' % self.name def howMany(self): '''Prints the current population''' if Person.population == 1: print 'i am the only one here' else: print 'There are still %d guyz left ' % Person.population rohan = Person('Rohan') rohan.sayHi() rohan.howMany() sanju = Person('Sanjivi') sanju.howMany() del rohan # am i doing this correctly --- ? i need to get an explanation for this del - destructor O/P:- Initializing person data ****************************************** Initializing Rohan ****************************************** Population now is: 1 Hi My name is Rohan i am the only one here Initializing person data ****************************************** Initializing Sanjivi ****************************************** Population now is: 2 In case Person dies: ****************************************** Sanjivi Bye Bye world there are still 1 people left i am the only one here In case Person dies: ****************************************** Rohan Bye Bye world i am the last person on earth Population now is: 0 If required i can paste the whole lesson as well --- learning from :- http://www.ibiblio.org/swaroopch/byteofpython/read/

    Read the article

  • simple yet secure encrypt / decrypt asp to asp.net

    - by Michael
    First post here. I have a asp/vb6 web app that logs in a user I want to encrypt the users identity field and pass(querystring) it to a asp.net app and then decrypt it to do a db lookup. I've google'd it of course and found rot13, not secure enough. I've also found some hits on MD5 / RC4 but did not find any good examples of encrypt / decrypt. Thanks, Michael

    Read the article

  • Simple number-to-number (or number-to-hex) encryption algorithm that minimizes # of characters

    - by Clay Nichols
    I need to encrypt a number and I and this encrypted value will be given to a customer ask a key so I want to minimize the number of digits and make them all printable. So I'd like the result to be either all number or all Hex characters. The current encryption method I'm using (for non numbers) converts the characters to hex (2 hex digits each). That doubles the number of characters. I also considered just treating the input as hex (so each pair of numbers is treated as a Hex pair, but then you have ambiguity between an input of 0123 and 123 (when decrypting that leading '0' is lost. Any suggestions?

    Read the article

  • Simple MySQL Query taking 45 seconds (Gets a record and its "latest" child record)

    - by Brian Lacy
    I have a query which gets a customer and the latest transaction for that customer. Currently this query takes over 45 seconds for 1000 records. This is especially problematic because the script itself may need to be executed as frequently as once per minute! I believe using subqueries may be the answer, but I've had trouble constructing it to actually give me the results I need. SELECT customer.CustID, customer.leadid, customer.Email, customer.FirstName, customer.LastName, transaction.*, MAX(transaction.TransDate) AS LastTransDate FROM customer INNER JOIN transaction ON transaction.CustID = customer.CustID WHERE customer.Email = '".$email."' GROUP BY customer.CustID ORDER BY LastTransDate LIMIT 1000 I really need to get this figured out ASAP. Any help would be greatly appreciated!

    Read the article

  • Simple question about WinForms and ListView

    - by Alex
    Hello I have a ListView in my WinForms application. ListWiew has 4 columns. So i want to write string in fourth column on every LisViewItem. When i try it. foreach (ListViewItem item in lvData.Items) { item.SubItems[3].Text ="something"; } i get an exception InvalidArgument=Value of '4' is not valid for 'index'. Parameter name: index What's wrong?

    Read the article

  • Simple Custom rule for Jquery validator

    - by thatweblook
    Hi, I read your reply regarding the jQuery validator where you outline a method to check a username against a value in a database. Ive tried implementing this method but no matter what is returned from the PHP file I always get the message that the username is already taken. Here is ths custom method... $.validator.addMethod("uniqueUserName", function(value, element) { $.ajax({ type: "POST", url: "php/get_save_status.php", data: "checkUsername="+value, dataType:"html", success: function(msg) { // if the user exists, it returns a string "true" if(msg == "true") return false; // already exists return true; // username is free to use } })}, "Username is Already Taken"); And here is the validate code... username: { required: true, uniqueUserName: true }, Is there a specific way i am supposed to return the message from php. Thanks A

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >