Search Results

Search found 21356 results on 855 pages for 'check digit'.

Page 52/855 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • Writing a simple RSpec test to check that Rake tasks are correct

    - by John Feminella
    I'm trying to be diligent about checking my rake tasks with RSpec tests, but in the process of feeling my way around I seem to have hit a wall. I've got a really simple RSpec test that looks like this: # ./test/meta_spec.rb describe "Rake tasks" do require 'rake' before(:each) do @rake = Rake::Application.new @rake.load_rakefile # => Error here! Rake.application = @rake end after(:each) do Rake.application = nil end it "should have at least one RSpec test to execute" do Rake.application["specs"].spec_files.size.should > 0 end end I have a simple task called "specs" defined in ./Rakefile.rb which has an RSpec task that includes all the *_spec.rb files. If I put the @rake.load_rakefile method in, I want that Rakefile to load. But instead it just bombs out. If I comment it out, however, the test fails because the "specs" task is (understandably) not defined. Where am I going wrong?

    Read the article

  • Using GQL to check if BlobProperty is NULL

    - by Joel
    Hello, I have a db.BlobProperty property (called "Icon") in my entity which contains an image binary. I want to run a GQL query to retrieve all entities with an image (i.e. their "Icon" property is not NULL). Trying to use the following query: "SELECT * FROM Names WHERE Icon!=NULL" did not work... Trying to use .filter("Icon!=",None) did not work as well... Any ideas? Thanks! Joel

    Read the article

  • jQuery check offset

    - by Glister
    HTML: <ul class="clients"> <li> <div class="over left">Description</div> <div class="inner">Image</div> </li> </ul> CSS: .clients { margin-right: -20px; } .clients li { float: left; width: 128px; height: 120px; margin: 0 20px 20px 0; border: 1px solid #c2c2c2; } .clients .over { display: none; position: absolute; width: 250px; font-size: 11px; line-height: 16px; background: #ecf5fb; margin: 3px 0 0 3px; padding: 18px; z-index: 25; } .clients .right { margin: 3px 0 0 -161px; } .clients .inner { width: 128px; height: 120px; overflow: hidden; } So, we have a list of floated squares and a popup blocks in each, which have absolute position. JS: jQuery(function($) { $('input[title!=""]').hint(); $(".clients li").bind('mouseover mouseout',function(){$(this).find("div.over").toggle()}); }); If over - show, else - hide. Quite ok, but it must be more advanced, we should catch an offset and give a class to .over block: if offset from right (corner of browser window) less than 150px, then add class "right" for a .over block. if offset from right more than 150px - add class "left" for a .over block. How can we do it?

    Read the article

  • Free en-GB dictionary for spell check in Silverlight

    - by Craig Shearer
    I'm trying to use the Vectorlight spell checker for Silverlight. The demo code comes with the en-US.dic file, but I'm trying to find a compatible one for British English. I have found one here but it doesn't work. The format seems similar to the en-US one, but it just doesn't work (i.e. it doesn't suggest any words).

    Read the article

  • How to check when animation finishes if animation block is

    - by pumpk1n
    I have a controller which adds as subviews a custom UIView class called Circle. Let's call a particular instance of Circle, "circle". I have a method in Circle, animateExpand, which expands the circle by animating the view. In the following code (which lives in the controller) I want to alloc and init a circle, add it to a NSMutableArray circleArray, animate the expansion, and at the end of the expansion, i want to remove the object from the array. My attempt: Circle *circle = [[Circle alloc] init]; [circleArray addObject:circle]; [circle animateExpand]; [circleArray removeObjectIdenticalTo:circle]; [circle release]; The problem is [circleArray removeObjectIdenticalTo:circle]; gets called before the animation finishes. Presumbly because the animation is done on a seperate thread. I cant implement the deletion in completion:^(BOOL finished){ }, because the Circle class does not know about a circleArray. Any solutions would be helpful, thanks!

    Read the article

  • Wordpress: Check if there are previous posts before displaying link

    - by Chris Armstrong
    I'm using the following code to display a 'previous posts' link on my Wordpress blog. <nav> <ul> <li><?php previous_posts_link('Newer Entries &raquo;') ?></li> </ul </nav> Problem is, when there ARN'T any previous posts, while the link doesn't display, I still get <nav> <ul> <li><</li> </ul </nav> Printed out. Is there an if() statement I could wrap around it all so it checks if there are any previous posts, and only prints it out if there are?

    Read the article

  • PHP Application check name is unique if not append

    - by user270797
    My application requires the user to enter their business name, which the application will automatically create into a unique identifier to be used in URLs, ie "Bob's Cafe" will become "bobs-cafe" But if there are duplicate names I would like the application to add a number so if there is already a "bobs-cafe" we will use "bobs-cafe-1" and likewise if there is already a "bobs-cafe-1" we will use "bobs-cafe-2" Ive used explode and also looked at a regular expressions but I dont know the best way to approach this. Im stuck in being able to grab the number and incrementing it and returning the string

    Read the article

  • How to check file exists and rename in perl

    - by Disco
    I'm kinda newbie to perl and looking for a script that will handle file moving. #!/usr/bin/perl -w $filename = 'DUMBFILE'; $destination = '/some/location/'; if (-e $destination + $filename) { print "File Exists ! Renaming .."; move ('/tmp/' + $filename, $destination + $filename + '.1'); } else { move ('/tmp/' + $filename, $destination + $filename); } I'm able to rename it to 1, but i want to be renamed incrementally, like if file.1 exists, rename to .2, and .3 if .2 exists. That should be easy to do, but i'm kinda lost ..

    Read the article

  • check box issue with IE6

    - by kumar
    This is my new post regardence of prevoious post with update html code.. http://stackoverflow.com/questions/2994538/jquery-chebox-selection-not-working-in-ie-this-is-working-in-firefox This is my selectall button code..on clicking this i am selecting all checkboxes.. $('#PbtnSelectAll').click(function() { $('#PricingEditExceptions input[type=checkbox]').attr('checked', 'checked'); $('#PbtnSubmit').show(); $('#PbtnCancel').show(); $('fieldset').find("input:not(:checkbox),select,textarea").attr('disabled',true); $('#genericfieldset').find("input,select,textarea").removeAttr('disabled'); }); This code working in Firefox not in IE can anybody help me out why its doing like this? thanks

    Read the article

  • Range partition skip check

    - by user289429
    We have large amount of data partitioned on year value using range partition in oracle. We have used range partition but each partition contains data only for one year. When we write a query targeting a specific year, oracle fetches the information from that partition but still checks if the year is what we have specified. Since this year column is not part of the index it fetches the year from table and compares it. We have seen that any time the query goes to fetch table data it is getting too slow. Can we somehow avoid oracle comparing the year values since we for sure know that the partition contains information for only one year.

    Read the article

  • Outlook - check email address type

    - by Chris Gunner
    I am trying to make a macro in Outlook that will scan the To: list for a certain text string, and spit out a message if all but one (or two, etc) addresses have it. Is there a simple way to do this? Essentially, I am trying to write something that'll avoid being able to send a restricted message to a bunch of people with the string 'xyz' in the address, if one or more do not have it. AutoComplete makes this difficult, without checking through one-by-one.

    Read the article

  • C# 'is' type check on struct - odd .NET 4.0 x86 optimization behavior

    - by Jacob Stanley
    Since upgrading to VS2010 I'm getting some very strange behavior with the 'is' keyword. The program below (test.cs) outputs True when compiled in debug mode (for x86) and False when compiled with optimizations on (for x86). Compiling all combinations in x64 or AnyCPU gives the expected result, True. All combinations of compiling under .NET 3.5 give the expected result, True. I'm using the batch file below (runtest.bat) to compile and test the code using various combinations of compiler .NET framework. Has anyone else seen these kind of problems under .NET 4.0? Does everyone else see the same behavior as me on their computer when running runtests.bat? #@$@#$?? Is there a fix for this? test.cs using System; public class Program { public static bool IsGuid(object item) { return item is Guid; } public static void Main() { Console.Write(IsGuid(Guid.NewGuid())); } } runtest.bat @echo off rem Usage: rem runtest -- runs with csc.exe x86 .NET 4.0 rem runtest 64 -- runs with csc.exe x64 .NET 4.0 rem runtest v3.5 -- runs with csc.exe x86 .NET 3.5 rem runtest v3.5 64 -- runs with csc.exe x64 .NET 3.5 set version=v4.0.30319 set platform=Framework for %%a in (%*) do ( if "%%a" == "64" (set platform=Framework64) if "%%a" == "v3.5" (set version=v3.5) ) echo Compiler: %platform%\%version%\csc.exe set csc="C:\Windows\Microsoft.NET\%platform%\%version%\csc.exe" set make=%csc% /nologo /nowarn:1607 test.cs rem CS1607: Referenced assembly targets a different processor rem This happens if you compile for x64 using csc32, or x86 using csc64 %make% /platform:x86 test.exe echo =^> x86 %make% /platform:x86 /optimize test.exe echo =^> x86 (Optimized) %make% /platform:x86 /debug test.exe echo =^> x86 (Debug) %make% /platform:x86 /debug /optimize test.exe echo =^> x86 (Debug + Optimized) %make% /platform:x64 test.exe echo =^> x64 %make% /platform:x64 /optimize test.exe echo =^> x64 (Optimized) %make% /platform:x64 /debug test.exe echo =^> x64 (Debug) %make% /platform:x64 /debug /optimize test.exe echo =^> x64 (Debug + Optimized) %make% /platform:AnyCPU test.exe echo =^> AnyCPU %make% /platform:AnyCPU /optimize test.exe echo =^> AnyCPU (Optimized) %make% /platform:AnyCPU /debug test.exe echo =^> AnyCPU (Debug) %make% /platform:AnyCPU /debug /optimize test.exe echo =^> AnyCPU (Debug + Optimized) Test Results When running the runtest.bat I get the following results on my Win7 x64 install. > runtest 32 v4.0 Compiler: Framework\v4.0.30319\csc.exe False => x86 False => x86 (Optimized) True => x86 (Debug) False => x86 (Debug + Optimized) True => x64 True => x64 (Optimized) True => x64 (Debug) True => x64 (Debug + Optimized) True => AnyCPU True => AnyCPU (Optimized) True => AnyCPU (Debug) True => AnyCPU (Debug + Optimized) > runtest 64 v4.0 Compiler: Framework64\v4.0.30319\csc.exe False => x86 False => x86 (Optimized) True => x86 (Debug) False => x86 (Debug + Optimized) True => x64 True => x64 (Optimized) True => x64 (Debug) True => x64 (Debug + Optimized) True => AnyCPU True => AnyCPU (Optimized) True => AnyCPU (Debug) True => AnyCPU (Debug + Optimized) > runtest 32 v3.5 Compiler: Framework\v3.5\csc.exe True => x86 True => x86 (Optimized) True => x86 (Debug) True => x86 (Debug + Optimized) True => x64 True => x64 (Optimized) True => x64 (Debug) True => x64 (Debug + Optimized) True => AnyCPU True => AnyCPU (Optimized) True => AnyCPU (Debug) True => AnyCPU (Debug + Optimized) > runtest 64 v3.5 Compiler: Framework64\v3.5\csc.exe True => x86 True => x86 (Optimized) True => x86 (Debug) True => x86 (Debug + Optimized) True => x64 True => x64 (Optimized) True => x64 (Debug) True => x64 (Debug + Optimized) True => AnyCPU True => AnyCPU (Optimized) True => AnyCPU (Debug) True => AnyCPU (Debug + Optimized) tl;dr

    Read the article

  • Check if there are any repeated elements in a array recursively

    - by devoured elysium
    I have to find recursively if there is any repeated element in an integer array v. The method must have the following signature: boolean hasRepeatedElements(int[] v) I can't see any way of doing that recursively without having to define another method or at least another overload to this method (one that takes for example the element to go after or something). At first I thought about checking for the current v if there is some element equal to the first element, then creating a new array with L-1 elements etc but that seems rather inefficient. Is it the only way? Am I missing here something?

    Read the article

  • username and password check linq query in c#

    - by b0x0rz
    this linq query var users = from u in context.Users where u.UserEMailAdresses.Any(e1 => e1.EMailAddress == userEMail) && u.UserPasswords.Any(e2 => e2.PasswordSaltedHash == passwordSaltedHash) select u; return users.Count(); returns: 1 even when there is nothing in password table. how come? what i am trying to do is get the values of email and passwordHash from two separate tables (UserEMailAddresses and UserPasswords) linked via foreign keys to the third table (Users). it should be simple - checking if email and password mach from form to database. but it is not working for me. i get 1 (for count) even when there are NO entries in the UserPasswords table. is the linq query above completely wrong, or...?

    Read the article

  • Sanity Check: change event not firing first time using keyboard

    - by macca1
    I've done a good amount of research on this and found a bunch of reported problems and solutions but the general consensus seems that all change problems in IE6 were fixed in jQuery 1.4.2. I'm having an issue where a change event is not firing in jQuery 1.4.2, but it did fire successfully in jQuery 1.3.2. This is in IE6. I'm about to submit a bug for this, but for my sanity I wanted to post it here first to see if there's something dumb I'm missing. I don't understand why this is working this way... <HTML> <HEAD> <TITLE>jQuery 1.4.2 Problem </TITLE> <script src="jquery-1.4.2.min.js" type="text/javascript"></script> <script> $(document).ready( function() { $("#firstBox").change(function() { alert("CHANGE"); }); // ONLOAD of document autofocus into the first element... $("form").find(":input:visible:first").focus() }); </script> </HEAD> <BODY> <form> <select id="firstBox"> <option value="" selected="selected">--</option> <option value="1">One</option> <option value="2">Two</option> </select> <br><br> <input size="10" id="secondBox"> </form> </BODY> </HTML> Simple enough, right? Onload of the page, give the first element focus. Onchange of the first element, alert. If you use the mouse, it works as expected. The page loads, the focus is in the drop down, you change the option, you get the alert. The problem is if you use the keyboard. The page loads, the focus is in the drop down, you press the down arrow. The option changes. Tab off the field, no alert. Weird. To make it even weirder, if you tab back into the field and change it again (all using the keyboard), the change event DOES fire after tab out this time. Any ideas?

    Read the article

  • Check if webbased CertEnroll will succeed

    - by Tim Mahy
    Hi all, for a project we will be doing webbased certificate enrollment, in Vista / Win7 combination with IE this gives some problems if the user does not import the root certificate first and then changes a lot of default IE settings (Enable ActiveX not marked safe for scripting etc....). I was wondering if any of you ever created a test VB or Javascript to test that all the settings are OK. So it can be used by the user before he starts the enrollment process.... greetings, Tim

    Read the article

  • Check if the path input is URL or Local File

    - by Ahmed
    Hi All, I'm working in xmldataprovider and we have configuration value "source" this value may be local file or url like c:\data\test.xml --absolute data\test.xml --relative or url http:\mysite\test.xml how I can determine all this cases in code I'm working c#

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >