Daily Archives

Articles indexed Monday June 14 2010

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

  • How to move value from the stack to ST(0)?

    - by George Edison
    I am having trouble believing the following code is the most efficient way to move a value from the stack to ST(0): .data var dd 4.2 tmp dd ? .code mov EAX, var push EAX ; top of stack now contains a value ; move it to ST(0) pop EAX mov tmp, EAX fld tmp Is the temporary variable really necessary? Further, is there an easier way to get a value from the stack to ST(0)?

    Read the article

  • ActiveRecord Create (not !) Throwing Exception on Validation

    - by myferalprofessor
    So I'm using ActiveRecord model validations to validate a form in a RESTful application. I have a create action that does: @association = Association.new and the receiving end of the form creates a data hash of attributes from the form parameters to save to the database using: @association = user.associations.create(data) I want to simply render the create action if validation fails. The problem is that the .create (not !) method is throwing an exception in cases where the model validation fails. Example: validates_format_of :url, :with => /(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix, :message => "Your url doesn't seem valid." in the model produces: ActiveRecord::RecordInvalid Exception: Validation failed: Url Your url doesn't seem valid. I thought .create! is supposed throw an exception whereas .create is not. Am I missing something here? Ruby 1.8.7 patchlevel 173 & rails 2.3.3

    Read the article

  • Could not use domain name instead of static IP

    - by Nam Gi VU
    Hi, I'm working with some partners in the UK. My office is in Vietnam. We are having a network problem: My partner can access an internal website using the domain name, e.g. http://website.name, but I can only access that website using the direct IP, e.g. 192.168.1.85. I can not ping that web server using "ping website.name" but it works if I using "ping 192.168.1.85". I want to use the domain name. Please help.

    Read the article

  • LAMP Ubuntu installation

    - by codedude
    I installed LAMP on Ubuntu 10.04. Now whenever I try to access http://localhost/ I get this message: Forbidden You don't have permission to access / on this server. Apache/2.2.14 (Ubuntu) Server at localhost Port 80 I tried changing the permissions of the var/www/ folder by clicking ALT-f2, typing in "gksu nautilus" and right clicking the folder and changing the permissions but I still get a 403 forbidden error. Any idea what's going on?

    Read the article

  • How to hide all filenames during thumbnail view? Windows 7

    - by Saebin
    When you use the right click 'View - Hide file names' option it really only works on preset file extensions.... which is not really helpful when you have extensions with thumbnails windows isn't set to hide (ie, flv files). Not only that, you may have other files mixed in with media files that aren't hidden either (exe, zip, etc). Is there some way to hide all file names or add additional extensions to hide?

    Read the article

  • When building a web Application project, TFS 2008 Builds two spearate projects in the _PublishedFold

    - by Steve Johnson
    Hi all, I am trying to a perform build automation on one of web application projects built using VS 2008. The _PublishedWebSites contains two folders: Web and Deploy. I just want the TFS 2008 to generate only the Deploy Folder and Not the Web Folder. Here is my TFSBuild.proj File <Project ToolsVersion="3.5" DefaultTargets="Compile" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets" /> <ItemGroup> <SolutionToBuild Include="$(BuildProjectFolderPath)/../../Development/Main/MySoftware.sln"> <Targets></Targets> <Properties></Properties> </SolutionToBuild> </ItemGroup> <ItemGroup> <ConfigurationToBuild Include="Release|AnyCPU"> <FlavorToBuild>Release</FlavorToBuild> <PlatformToBuild>Any CPU</PlatformToBuild> </ConfigurationToBuild> </ItemGroup> <!--<ItemGroup> <SolutionToBuild Include="$(BuildProjectFolderPath)/../../Development/Main/MySoftware.sln"> <Targets></Targets> <Properties></Properties> </SolutionToBuild> </ItemGroup> <ItemGroup> <ConfigurationToBuild Include="Release|x64"> <FlavorToBuild>Release</FlavorToBuild> <PlatformToBuild>x64</PlatformToBuild> </ConfigurationToBuild> </ItemGroup>--> <ItemGroup> <AdditionalReferencePath Include="C:\3PR" /> </ItemGroup> <Target Name="GetCopyToOutputDirectoryItems" Outputs="@(AllItemsFullPathWithTargetPath)" DependsOnTargets="AssignTargetPaths;_SplitProjectReferencesByFileExistence"> <!-- Get items from child projects first. --> <MSBuild Projects="@(_MSBuildProjectReferenceExistent)" Targets="GetCopyToOutputDirectoryItems" Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform)" Condition="'@(_MSBuildProjectReferenceExistent)'!=''"> <Output TaskParameter="TargetOutputs" ItemName="_AllChildProjectItemsWithTargetPathNotFiltered"/> </MSBuild> <!-- Remove duplicates. --> <RemoveDuplicates Inputs="@(_AllChildProjectItemsWithTargetPathNotFiltered)"> <Output TaskParameter="Filtered" ItemName="_AllChildProjectItemsWithTargetPath"/> </RemoveDuplicates> <!-- Target outputs must be full paths because they will be consumed by a different project. --> <CreateItem Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Exclude= "$(BuildProjectFolderPath)/../../Development/Main/Web/Bin*.pdb; *.refresh; *.vshost.exe; *.manifest; *.compiled; $(BuildProjectFolderPath)/../../Development/Main/Web/Auth/MySoftware.dll; $(BuildProjectFolderPath)/../../Development/Main/Web/BinApp_Web_*.dll;" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always' or '%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'" > <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/> <Output TaskParameter="Include" ItemName="_SourceItemsToCopyToOutputDirectoryAlways" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always'"/> <Output TaskParameter="Include" ItemName="_SourceItemsToCopyToOutputDirectory" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/> </CreateItem> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.WebDeployment.targets. <Target Name="BeforeBuild"> </Target> <Target Name="BeforeMerge"> </Target> <Target Name="AfterMerge"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> I want to build everything that the builtin Deploy project is doing for me. But i dont want the generated Web Project as it conatains App_Web_xxxx.dll assemblies instead of a single compiled assembly. Please help. Thanks

    Read the article

  • can not find symbol

    - by joseph
    // Register JDBC driver Class.forName("net.sourceforge.jtds.jdbc.Driver"); method forName(java.Lang.String) Class.forName("net.sourceforge.jtds.jdbc.Driver); ^

    Read the article

  • large databases in sqlite - file size considerations?

    - by Gj
    I'm using a sqlite db which is very convenient and seems to meet all of my needs at this point. Currently my db size is <50MB, but I now need to add a new table which will store large text blobs, which will cause the db to reach up to 5GB within the next year. Would sqlite be able to deal with a 5GB db size? Any caveats to that, compared with say mysql?

    Read the article

  • Apache Virtual Host in Windows - how do I deal with Symbolic links?

    - by Peeaytchpee
    Hi Folks, I'm trying to run a virtual host on a WAPP stack. My virtual host has the FollowSymLinks option, but in Windows, all those symbolic links (I'm using shortcuts, and I think this may be the problem) have the .lnk extension. So if I'm trying to access settings.html, Apache can't find it because all i have sitting there is settings.html.lnk. Apologies if my question is unclear.

    Read the article

  • unevenly centered subplots in matplotlib in Python?

    - by user248237
    I am plotting a simple pair of subplots in matplotlib that are for some reason unevenly centered. I plot them as follows: plt.figure() # first subplot s1 = plt.subplot(2, 1, 1) plt.bar([1, 2, 3], [4, 5, 6]) # second subplot s2 = plt.subplot(2, 1, 2) plt.pcolor(rand(5,5)) # add colorbar plt.colorbar() # square axes axes_square(s1) axes_square(s2) where axes_square is simply: def axes_square(plot_handle): plot_handle.axes.set_aspect(1/plot_handle.axes.get_data_ratio()) The plot I get is attached. The top and bottom plots are unevenly centered. I'd like their yaxis to be aligned and their boxes to be aligned. If I remove the plt.colorbar() call, the plots become centered. How can I have the plots centered while the colorbar of pcolor is still shown? I want the axes to be centered and have the colorbar be outside of that alignment, either to the left or to the right of the pcolor matrix. image of plots link thanks.

    Read the article

  • Hyperlinks and iPad videos

    - by bhan
    Hello everybody, I'm trying to develop something in the cloud incorporating video, text and images. However, any hyperlinked content that appears above or below the video is unclickable, as the video takes the focus on the iPad. This isn't a problem with Safari in general, as it works on Desktop Safari. Thankyou, BH

    Read the article

  • Yet another Subversion "Commit failed" MERGE of 'blabla': 200 OK

    - by marty3d
    Hi! I get the infamous "MERGE of 'whatever': 200 OK" whenever I try to commit using a post-commit hook on Windows (running the repository and Trac locally), and I'm going crazy. I've been looking all over for a day now, without finding any solutions. So here's how it's set up and what I've tried so far: Settings: Windows 7 (64-bit) VisualSVN Server TortoiseSVN Trac 0.11.6 I'm using the three standard scripts for post-commit on Windows. Everything works when I run post-commit.cmd from the command prompt with repo and changesetnumber as parameters. After extensive trouble-shooting, I found that if I remove the last line in trac-post-commit.cmd, Python "%~dp0\trac-post-commit-hook.py" -p "%TRAC_ENV%" -r "%REV%" -u "%AUTHOR%" -m "%LOG%", the Commit failed error goes away. Adding 1/0 (generating a division by zero error) in the python script doesn't show anything different. From the command prompt I get an error, though. Removing all code in the python script also makes the commit failed go away, so I guess the culprit is in trac-post-commit-hook.py. Perhaps if I could send the actual error to a log file, I could dig a little deeper, but I'm not sure how. post-commit.cmd: call %~dp0\trac-post-commit-hook.cmd %1 %2 trac-post-commit-hook.cmd: http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook?rev=920 Thank you so much, it would mean alot if someone could assist a little here! /Martin

    Read the article

  • How can I add reflection to a C++ application?

    - by Nick
    I'd like to be able to introspect a C++ class for its name, contents (i.e. members and their types) etc. I'm talking native C++ here, not managed C++, which has reflection. I realise C++ supplies some limited information using RTTI. Which additional libraries (or other techniques) could supply this information?

    Read the article

  • "Cannot find symbol" problem.

    - by joseph
    I'm getting the Cannot find symbol error from my code. Does anyone know what can cause this problem? // Register JDBC driver Class.forName("net.sourceforge.jtds.jdbc.Driver"); method forName(java.Lang.String) Class.forName("net.sourceforge.jtds.jdbc.Driver); ^

    Read the article

  • UIEvent for iPhone locking & unlocking?

    - by Jason
    I am building an iPhone app in which I want to time user activity. However, I don't want to count time when the iPhone was locked (or when the user received a phone call) when calculating the times. What is the best way to do this? Is there a UIEvent which my app can receive (and act upon) when the iPhone locks or unlocks?

    Read the article

  • Cucumber could not find table; but its there. What is going on?

    - by JZ
    I'm working with cucumber and I'm running into difficulties. When I run "cucumber features", I am met with errors, cucumber is unable to find my requests table. What obvious mistake am I making? Thank you in advance! Bash: justin-zollarss-mac-pro:conversion justinz$ cucumber features Using the default profile... /Users/justinz/.gem/ruby/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement F-- (::) failed steps (::) Could not find table 'requests' (ActiveRecord::StatementInvalid) ./features/article_steps.rb:3 ./features/article_steps.rb:2:in `each' ./features/article_steps.rb:2:in `/^I have requests named (.+)$/' features/manage_articles.feature:7:in `Given I have requests named Foo, Bar' Failing Scenarios: cucumber features/manage_articles.feature:6 # Scenario: Conversion 1 scenario (1 failed) 3 steps (1 failed, 2 skipped) 0m0.154s justin-zollarss-mac-pro:conversion justinz$ Manage_articles.feature: Feature: Manage Articles In order to make sales As a customer I want to make conversions Scenario: Conversion Given I have requests named Foo, Bar When I go to the list of customers Then I should see a new "customer" Article_steps.rb: Given /^I have requests named (.+)$/ do |firsts| firsts.split(', ').each do |first| Request.create!(:first => first) pending # express the regexp above with the code you wish you had end end Then /^I should see a new "([^"]*)"$/ do |arg1| pending # express the regexp above with the code you wish you had end DB schema: ActiveRecord::Schema.define(:version => 20100528011731) do create_table "requests", :force => true do |t| t.string "institution" t.string "website" t.string "type" t.string "users" t.string "first" t.string "last" t.string "jobtitle" t.string "phone" t.string "email" t.datetime "created_at" t.datetime "updated_at" end end

    Read the article

  • Determine Android phone's proximity to known point while conserving power

    - by ahsteele
    I am trying to determine if an Android user has had a close proximity to a list of predetermined locations. I'd like to do this with the least amount of drain on the phone's battery. The two mechanisms I see for accomplishing this are proximity alerts and requesting location updates. What are the pros and cons of the two methods? Will one have less affect on the battery than the other? In either case I would guess the specific location manager used would affect power usage (existing Stack Overflow answer).

    Read the article

  • Retro video games programming

    - by SebKom
    I just watched the Super Mario Bros. -1 World glitch in youtube and I really began wondering about the code behind those games. Which language was used? What about the OS for the video games consoles? Are there any website with resources about this subject? (I am a 90s video gamer so I am particularly interested about the programming behind those games but feel free to make this a wiki and include links to resources about video games programming in general, if you want)

    Read the article

  • Can I have/use different Versions of rails in the same machine

    - by lakshmanan
    I am actually reading a rails book that is written for rails 2.3.5. I want to test Rails 3 beta as well. Is it possible to have such a setup in my Mac OS leopard? I have tried with gem list -d rails. There are many versions stored in my mac but I don't know how to use different versions of rails while creating applications using rails command

    Read the article

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