Daily Archives

Articles indexed Friday March 12 2010

Page 22/130 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Dropping support for IE6, Is swfObject still relevant?

    - by Armitage
    We have recently dropped support for IE6 at my job. The other developers have have opted for a generic object embed method: <object type="application/x-shockwave-flash" data="example.swf" width="800" height="600" > <param name="movie" value="example.swf"> <param name="allowScriptAccess" value="always"> </object> This seems to work in all modern browsers but it really rubs me the wrong way. I'm sure this is wrong in several ways and is clearly a big step back in sophistication. So my question is in 2 parts, what is wrong with the above method? Is swfObject still best practice and what issues does it solve (besides IE6 click-activate)? Citations less then a year old would also be helpful.

    Read the article

  • Flex DataGridColumn with array of objects as data provider

    - by rforte
    I have a datagrid that uses an array of objects as the data provider. The objects are essentially key/value pairs: { foo:"something"} { bar:"hello"} { caca:"lorem"} The datagrid has 2 columns. The first column is the key and the second column is the value. Right now my grid looks like: My dataFormatter function makes sure that depending on the column (i.e. the dataField value) the correct key or value gets printed out. This works fine for displaying. However, as soon as I try and edit the value field it essentially adds a new value into the object with a key of '1'. For example, if I edit the {caca:"lorem"} object it will then contain the value {caca:"lorem",1:"new value"}. Is there any possible way I can set the DataGridColumn so that when I edit a value it will update the value associated with the key rather than inserting a new value? I've tried using a custom item editor but it still does the insert. It seems like I need to be able to update the 'dataField' with the actual key value but I'm not sure how to do that.

    Read the article

  • Array::include? on ActiveRecord collection not calling op== ?

    - by tribalvibes
    Given a collection of named Foos from ActiveRecord, why does Array.include? not seem to call Foo.== but yet index does? class Foo < ActiveRecord::Base def ==(s) self.name == s end end class Bar < ActiveRecord::Base has_many :foos end bar.foos << Foo.new( :name = 'hmm' ) bar.foos.all.include?('hmm') # does select all from db every time = true bar.foos.include?('hmm') # does not go to db, but does not find the Foo! = false bar.foos.index('hmm') # does not go to db, but does find the Foo[0] ! = 0 bar.foos.index('eh') # no such object = nil I understand shallow about the proxies, but (without a detour into the AR source) why is index seemingly behaving correctly but include? is not !? Is this a bug in the proxy behavior, and/or is this behavior documented somewhere ? Thanks.

    Read the article

  • Opening Another Xib form an Xib

    - by Goods
    Not a Noob as yesterday, but still green. I have been playing around with the code that Elisabeth Robson has put together HERE. I have a UITabbarcontoller and a IUNavigationController they seem to work fine. I have a UITableviewController to which I loads my NSMutable array. The user clicks a cell and didSelectRowAtIndexPath xib is loaded onto the stack. I put a 'Learn More' button on the current xib(BookDetailView). I've tried a few approaches to load a newer xib when the 'Learn More' button is pressed but have failed. Ive Tried IBAction and Pushing the Newer xib to the top. Do I need to create another view controller? Thanks for looking.

    Read the article

  • Can we run two simultaneous non-nested loops in Perl?

    - by Mike
    Part of my code goes like this: while(1){ my $winmm = new Win32::MediaPlayer; $winmm->load('1.mp3'); $winmm->play; $winmm->volume(100); Do Some Stuff; last if some condition is met; } Problem is: I want the music to be always on when I'm in the Do Some Stuff stage in the while loop. But the length of the music is so short that it will come to a full stop before I go to the next stage, so I want the music to repeat itself, but the Win32::Mediaplayer module does not seem to have a repeat mode, so I'm thinking of doing an infinite loop for the music playing part. Like this: while(1){ my $winmm = new Win32::MediaPlayer; $winmm->load('1.mp3'); $winmm->play; $winmm->volume(100); } while(2){ Do some stuff; last if some condition is met } But based on my current Perl knowledge if I'm in the while(1) part, I can never go to the while(2) part. Even if it comes to a nested loop, I have to do something to break out of the inside loop before going to the other part of the outside loop. The answer to my question "Can we run two simultaneous non-nested loops in Perl?" may be a NO, but I assume there is some way of handling such situation. Correct me if I'm wrong. Thanks as always for any comments/suggestions :) UPDATE I really appreciate the help from everyone. Thanks :) So the answer to my question is a YES, not a NO. I'm happy that I've learned how to use fork() and threads to solve a real problem :)

    Read the article

  • Word Counter Implementation

    - by kenny
    Is there a better way than the following brute foce implementation of a c# word counting class? UPDATED CODE: Sorry! /// <summary> /// A word counting class. /// </summary> public class WordCounter { Dictionary<string, int> dictTest = new Dictionary<string, int> (); /// <summary> /// Enters a word and returns the current number of times that word was found. /// </summary> /// <param name="word">The word or string found.</param> /// <returns>Count of times Found() was called with provided word.</returns> public int Found ( string word ) { int count = 1; return dictTest.TryGetValue ( word, out count ) ? ++dictTest[word] : dictTest[word] = 1; } }

    Read the article

  • Serialization of an object

    - by sandhya
    Hi I am Serialing an object using GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("string1",subobject1); info.AddValue("string2",subobject2); } what will be stored in stream? do the strings also store?

    Read the article

  • How to access constant defined in child class from parent class functions?

    - by kavoir.com
    I saw this example from php.net: <?php class MyClass { const MY_CONST = "yonder"; public function __construct() { $c = get_class( $this ); echo $c::MY_CONST; } } class ChildClass extends MyClass { const MY_CONST = "bar"; } $x = new ChildClass(); // prints 'bar' $y = new MyClass(); // prints 'yonder' ?> But $c::MY_CONST is only recognized in version 5.3.0 or later. The class I'm writing may be distributed a lot. Basically, I have defined a constant in ChildClass and one of the functions in MyClass (father class) needs to use the constant. Any idea?

    Read the article

  • Subversion Partial Export

    - by Jared
    I have somewhat interesting development situation. The client and deployment server are inside a firewall without access to the Subversion server. But the developers are outside the firewall and are able to use the Subversion server. Right now the solution I have worked out is to update my local copy of the code and then pull out the most recently updated files using UnleashIT. The question is how to get just the updated files out of Subversion so that they can be physically transported through the firewall and put on the deployment server. I'm not worried about trying to change the firewall setup or trying to figure out an easier way to get to the Subversion server from inside the firewall. I'm just interested in a way to get a partial export from the repository of the most recently changed files. Are there any other suggestions? Answer found: In addition to the answer I marked as Answer, I've also found the following here to be able to do this from TortoiseSVN: from http://svn.haxx.se/tsvn/archive-2006-08/0051.shtml * select the two revisions * right-click, "compare revisions" * select all files in the list * right-click, choose "export to..."

    Read the article

  • CSS submenus for a horizontal menu

    - by kalaivani
    This is the CSS I'm currently using to produce a horizontal menu. Does anyone have any suggestions on how to go about extending it to allow for submenus? /* CSS Document */ .rhm1{ width:780px; height:64px; margin:0 auto; background:url(images/rhm1_bg.gif) repeat-x; } .rhm1-left{ background:url(images/rhm1_l.gif) no-repeat; width:15px; height:64px; float:left; } .rhm1-right{ background:url(images/rhm1_r.gif) no-repeat; width:15px; height:64px; float:right; } .rhm1-bg{ background:url(images/rhm1_bg.gif) repeat-x; height:64px; } .rhm1-bg ul{ list-style:none; margin:0 auto; } .rhm1-bg li{ float:left; list-style:none; } .rhm1-bg li a{ float:left; display:block; color:#ffe8cc; text-decoration:none; font:12px 'Lucida Sans', sans-serif; font-weight:bold; padding:0 0 0 18px; height:64px; line-height:40px; text-align:center; cursor:pointer; } .rhm1-bg li a span{ float:left; display:block; padding:0 32px 0 18px; } .rhm1-bg li.current a{ color:#fff; background:url(images/rhm1_hover_l.gif) no-repeat left 5px; } .rhm1-bg li.current a span{ color:#fff; background:url(images/rhm1_hover_r.gif) no-repeat right 5px; } .rhm1-bg li a:hover{ color:#fff; background:url(images/rhm1_hover_l.gif) no-repeat left 5px; } .rhm1-bg li a:hover span{ color:#fff; background:url(images/rhm1_hover_r.gif) no-repeat right 5px; }

    Read the article

  • Setting a preferred item of a many-to-one in Django

    - by Mike DeSimone
    I'm trying to create a Django model that handles the following: An Item can have several Names. One of the Names for an Item is its primary Name, i.e. the Name displayed given an Item. (The model names were changed to protect the innocent.) The models.py I've got looks like: class Item(models.Model): primaryName = models.OneToOneField("Name", verbose_name="Primary Name", related_name="_unused") def __unicode__(self): return self.primaryName.name class Name(models.Model): item = models.ForeignKey(Item) name = models.CharField(max_length=32, unique=True) def __unicode__(self): return self.name class Meta: ordering = [ 'name' ] The admin.py looks like: class NameInline(admin.TabularInline): model = Name class ItemAdmin(admin.ModelAdmin): inlines = [ NameInline ] admin.site.register(Item, ItemAdmin) It looks like the database schema is working fine, but I'm having trouble with the admin, so I'm not sure of anything at this point. My main questions are: How do I explain to the admin that primaryName needs to be one of the Names of the item being edited? Is there a way to automatically set primaryName to the first Name found, if primaryName is not set, since I'm using inline admin for the names?

    Read the article

  • SVN export just the changed files from tags

    - by Eric
    Does anyone know how to export only the changed files from two tags using svn? Lets say I have tag 1.0 and then later fix bugs in the trunk. Next I am ready for a new patch release so I tag it 1.1. Now I want to export the changed files between tag 1.0 and 1.1. Is this possible?

    Read the article

  • Sun Virtualbox: Cannot Install Windows 95 or 98

    - by c00lryguy
    I'm running XP and I've tried to install Windows 95 and 98 with the official CDs in Virtualbox. Both of them give the error: FATAL: no bootable medium found! System Halted I've mounted the CD drives within Virtualbox and also tried to change the boot order so that the CD drive is first but to no avail. I don't understand exactly what's going on here.

    Read the article

  • Rails requires Rubygems but I have the gems

    - by fogonthedowns
    Update I notice that which ruby and whereis ruby are different locations which ruby /opt/local/bin/ruby whereis ruby /usr/bin/ruby I recently upgraded ruby to ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10] and I think I broke rails. When I attempt to load rails. I get an odd message. Please help! $ ruby script/server Rails requires RubyGems = 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org $ rails -v Rails 3.0.0.beta $ gem -v 1.3.6 $ which gem /usr/bin/gem $ whereis gem /usr/bin/gem $ which rails /usr/bin/rails $ whereis rails /usr/bin/rails $ /usr/bin/gem -v 1.3.6 $ /usr/bin/rails -v Rails 3.0.0.beta $ ruby script/console Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org $ gem list rails *** LOCAL GEMS *** rails (3.0.0.beta, 2.3.5, 2.2.2, 1.2.6) $ gem list *** LOCAL GEMS *** abstract (1.0.0) actionmailer (3.0.0.beta, 2.3.5, 2.2.2, 1.3.6) actionpack (3.0.0.beta, 2.3.5, 2.2.2, 1.13.6) actionwebservice (1.2.6) activemerchant (1.4.1) activemodel (3.0.0.beta) activerecord (3.0.0.beta, 2.3.5, 2.2.2, 1.15.6) activerecord-tableless (0.1.0) activeresource (3.0.0.beta, 2.3.5, 2.2.2) activesupport (3.0.0.beta, 2.3.5, 2.2.2, 1.4.4) acts_as_ferret (0.4.3) arel (0.2.pre) authlogic (2.1.3) builder (2.1.2) bundler (0.9.3) calendar_date_select (1.15) capistrano (2.5.2) cgi_multipart_eof_fix (2.5.0) chronic (0.2.3) columnize (0.3.1) compass (0.8.17) daemons (1.0.10) dnssd (0.6.0) erubis (2.6.5) fastercsv (1.5.0) fastthread (1.0.1) fcgi (0.8.7) ferret (0.11.6) flay (1.4.0) flog (2.4.0) gbarcode (0.98.16) gem_plugin (0.2.3) git (1.2.5) haml (2.2.15) haml-edge (2.3.100) highline (1.5.0) hoe (2.4.0) hpricot (0.6.164) i18n (0.3.3) javan-whenever (0.3.7) jeweler (1.4.0) jscruggs-metric_fu (1.1.5) json_pure (1.2.0) libxml-ruby (1.1.2) linecache (0.43) mail (2.1.2) mechanize (0.9.3) memcache-client (1.7.8) mime-types (1.16) mislav-will_paginate (2.3.11) mocha (0.9.7) mojombo-chronic (0.3.0) mongrel (1.1.5) needle (1.3.0) net-scp (1.0.1) net-sftp (2.0.1, 1.1.1) net-ssh (2.0.4, 1.1.4) net-ssh-gateway (1.0.0) nifty-generators (0.3.0) nokogiri (1.4.0) openrain-action_mailer_tls (1.1.3) passenger (2.2.5) polyglot (0.2.9) prawn (0.6.3) prawn-core (0.6.3) prawn-format (0.2.3) prawn-layout (0.3.2) prawn-security (0.1.1) rack (1.1.0, 1.0.1) rack-mount (0.4.5) rack-test (0.5.3) rails (3.0.0.beta, 2.3.5, 2.2.2, 1.2.6) railties (3.0.0.beta) rake (0.8.7, 0.8.3) rake-compiler (0.6.0) RedCloth (4.1.1) reek (1.2.6) relevance-rcov (0.9.2.1) rmagick (2.12.2) roodi (2.1.0) rsl-stringex (1.0.3) rspec (1.2.9) rspec-rails (1.2.9) ruby-debug (0.10.3) ruby-debug-base (0.10.3) ruby-openid (2.1.2) ruby-yadis (0.3.4) ruby2ruby (1.2.4) ruby_parser (2.0.4) rubyforge (2.0.3) rubygems-update (1.3.6, 1.3.5) rubynode (0.1.5) searchlogic (2.3.9) sexp_processor (3.0.3) spree (0.9.4) sqlite3-ruby (1.2.5, 1.2.4) termios (0.9.4) test-unit (2.0.5) text-format (1.0.0) text-hyphen (1.0.0) thor (0.13.0) tlsmail (0.0.1) topfunky-gruff (0.3.5) treetop (1.4.3) tzinfo (0.3.16) xmpp4r (0.4)

    Read the article

  • gzip compression

    - by SyAu
    I'm using Weblogic application server and Apache web server in my J2EE environment and planning to implement gzip compression of response. Not sure, whether to implement compression on the Apache server or on the weblogic.

    Read the article

  • Should External Routine Be Declared Always in Fortran?

    - by Ngu Soon Hui
    In my fortran code I made the following call to dnrm2 routine d = dnrm2(n, ax, 1) Just a simple call that would return me a double precision result. The problem is whether I should declare the function at the start of my script. I found that if I don't declare it, and when I compile the code in 32 bit Windows, then the result is correct. But if I compile the code in 64 bit Windows, then the result won't be correct. Why this is so? Is external routine must always be declared?

    Read the article

  • Creating AVI files in OpenCV

    - by user80003
    Hello. I have been trying to create an application using OpenCV and Visual Studio 2008, to capture images from a webcam, apply a filter to them, and then write them to an AVI file. Everything works, except creating the AVI file. The problem is that it works on my computer, but it doesn't work on my colleague's computer. The reason for that (I think) is that he does not have the necessary video encoders for OpenCV to use. The cvCreateVideoWriter function does not return NULL, but I end up with a 0kb file on the disk.

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >