Search Results

Search found 20065 results on 803 pages for 'practice problems'.

Page 73/803 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • Problems with native Win32api RichEdit control and its IRichEditOle interface

    - by Michael
    Hi All! As part of writing custom command (dll with class that implements Interwoven command interface) for one of Interwoven Worksite dialog boxes,I need to extract information from RichEdit textbox. The only connection to the existing dialog box is its HWND handle; Seemingly trivial task , but I got stuck : Using standard win32 api functions (like GetDlgItemText) returns empty string. After using Spy++ I noticed that the dialog box gets IRichEditOle interface and seems to encapsulate the string into OLE object. Here is what I tried to do: IRichEditOle richEditOleObj = null; IntPtr ppv = IntPtr.Zero; Guid guid = new Guid("00020D00-0000-0000-c000-000000000046"); Marshal.QueryInterface(pRichEdit, ref guid, out ppv); richEditOleObj = (IRichEditOle)Marshal.GetTypedObjectForIUnknown(ppv,typeof(IRichEditOle)); judging by GetObjectCount() method of the interface there is exactly one object in the textbox - most likely the string I need to extract. I used GetObject() method and got IOleObject interface via QueryInterface : if (richEditOleObj.GetObject(0, reObject, GetObjectOptions.REO_GETOBJ_ALL_INTERFACES) == 0) //S_OK { IntPtr oleObjPpv = IntPtr.Zero; try { IOleObject oleObject = null; Guid objGuid = new Guid("00000112-0000-0000-C000-000000000046"); Marshal.QueryInterface(reObject.poleobj, ref objGuid, out oleObjPpv); oleObject = (IOleObject)Marshal.GetTypedObjectForIUnknown(oleObjPpv, typeof(IOleObject)); To negate other possibilites I tried to QueryInteface IRichEditOle to ITextDocument but this also returned empty string; tried to send EM_STREAMOUT message and read buffer returned from callback - returned empty buffer. And on this point I got stuck. Googling didn't help much - couldn't find anything that was relevant to my issue - it seems that vast majority of examples on the net about IRichEditOle and RichEdit revolve around inserting bitmap into RichEdit control... Now since I know only basic stuff about COM and OLE , I guess I am missing something important here. I would appreciate any thoughts suggestions or remarks.

    Read the article

  • Problems with Runt overlap? but *only* within Rails

    - by trisignia
    Martin Fowler's Runt library is really handy for date/time comparisons, and this code works great in an irb console: require 'runt' include Runt r_start = PDate.month(2010,12) r_end = PDate.month(2011,12) range = DateRange.new(r_start,r_end) o_start = PDate.month(2010,11) o_end = PDate.month(2012,2) o_range = DateRange.new(o_start,o_end) range.overlap?(o_range) but if I add the Runt gem to my Rails 2.3.5 app and try to run the same commands in script/console, I get this error: NoMethodError: undefined method `to_datetime' for Mon, 01 Nov 2010 00:00:00 +0000..Wed, 01 Feb 2012 00:00:00 +0000:Runt::DateRange from /Users/jacob/work/matchbook/vendor/gems/runt-0.7.6/lib/runt/sugar.rb:130:in method_missing' from /Users/jacob/work/matchbook/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb:120:in <=' from /Users/jacob/work/matchbook/vendor/gems/runt-0.7.6/lib/runt/pdate.rb:91:in <=>' from /Users/jacob/work/matchbook/vendor/gems/runt-0.7.6/lib/runt/daterange.rb:34:in member?' from /Users/jacob/work/matchbook/vendor/gems/runt-0.7.6/lib/runt/daterange.rb:34:in `overlap?' from (irb):10 Has anyone encountered this error before, or does anyone know how to begin debugging this? I've tried looking at the spaceship operator in the ActiveSupport calculations module, but I can't figure out how to pick apart the problem. Thanks very much for your help, Jacob

    Read the article

  • Rails Gem Install Problems: Google-Geocode

    - by spin-docta
    I'm try to install google-geocode for rails sudo gem install google-geocode but I get the following error. Any suggestions? Building native extensions. This could take a while... ERROR: Error installing google-geocode: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb checking for iconv.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include,/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes checking for libxml/parser.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include,/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes checking for libxslt/xslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include,/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes checking for libexslt/exslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include,/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes checking for xmlParseDoc() in -lxml2... no libxml2 is missing. try 'port install libxml2' or 'yum install libxml2' *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby --with-iconv-dir --without-iconv-dir --with-iconv-include --without-iconv-include=${iconv-dir}/include --with-iconv-lib --without-iconv-lib=${iconv-dir}/lib --with-xml2-dir --without-xml2-dir --with-xml2-include --without-xml2-include=${xml2-dir}/include --with-xml2-lib --without-xml2-lib=${xml2-dir}/lib --with-xslt-dir --without-xslt-dir --with-xslt-include --without-xslt-include=${xslt-dir}/include --with-xslt-lib --without-xslt-lib=${xslt-dir}/lib --with-xml2lib --without-xml2lib Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.0 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.0/ext/nokogiri/gem_make.out

    Read the article

  • Problems with MVC Ajax.ActionLink and returning a PartialView

    - by mwright
    I'm trying to implement a simple Ajax update using MVC and have run into an issue. My understanding of how to implement Ajax with MVC is to use an Ajax.ActionLink which allows the content to be updated based on user interaction. I have an Ajax.ActionLink that looks like the following: <%= Ajax.ActionLink("Call Ajax", "Ajax", new AjaxOptions{UpdateTargetId = "updateDiv"}) %> If, in the controller, I return a string it works fine. However, when returning a PartialView instead, nothing happens. I can step through and verify that the controller is "returning" the partial view but nothing shows up in what I'm calling the updateDiv. How can I go about determining what the problem is?

    Read the article

  • IE positioning problems

    - by Kyle Sevenoaks
    In every browser but IE, on euroworker.no/order the little green arrow under the word "produkt" sits on top of my div container. Why in the world does this not work in IE? Thing is, it works on two pages out of four in IE but all four in other browsers. CSS for the top prgress indicator: #checkoutProgress { width: auto; padding-top: 1em; height: 30px; overflow:hidden; font-family: "Helvetica"; font-size:18px; float:left; /* margin-bottom:22px;*/ margin-left:0px; } #checkoutProgress a { padding: 10px; /*border-width: 2px; margin-right: 20px;*/ text-decoration:none; font-size: 17.26px; color:#dadada; text-transform:uppercase; } #checkoutProgress a:hover { padding: 10px; /*border-width: 2px; margin-right: 20px;*/ text-decoration:none; font-size: 17.26px; color:#818072; } /* completed steps */ #checkoutProgress a.completed { border-color: #70D66D; } /* current step */ #checkoutProgress a.active { /* border-color: #ADD8E6;*/ font-weight: bold; /*background-color: #fffccc; border-color: #ADD8E6;*/ background-image:url(../../upload/urhere_arr.png); background-position:bottom center; /*padding-left:15px;*/ color:#a3a398; } For the box: div #roundbigbox { background-image:url(../../upload/EW_p_og_L.png); background-position:top center; background-repeat:no-repeat; padding:5px; padding-top:10px; padding-bottom:0px; width:760px; height:1%; border-width:1px; border-color:#dddddd; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; z-index:1; position:relative; overflow:hidden; margin:0; margin-bottom:10px; } fieldset css: fieldset.container { border: 0; } And some HTML: <fieldset class="container"> <div id="checkoutProgress" class="progressCart"> <a href="/order" class=" active" id="progressCart"><span>Produkt</span></span></a> <a href="/checkout/selectAddress" class="completed " id="progressAddress"><span>kunde info</span></a> <a href="/checkout/shipping" class="completed " id="progressShipping"><span>Leveringsmåte</span></a> <a href="/checkout/pay" class="" id="progressPayment"><span>Betaling & Fullfør</span><</a> </div> </fieldset> </div> <form action="/order... > <input type="hidden"...> <div id="roundbigbox"> <p id="pro">Produkter</p> More content </div>

    Read the article

  • Problems Executing iPhone "GenericKeychain" Example

    - by AO
    I can't get apple's "GenericKeychain" example to run. I have replaced all 5 occurrences, as mentioned in the readme file, of "YOUR_APP_ID_HERE.com.yourcompany" with my own string: se.[company name].[project name].demo. The compilation goes fine but when trying to run it on the phone, an error saying "The executable was signed with invalid entitlements" appears. And yes, I have an ad hoc provisioning profile installed. I've tried to add "Entitlements.plist" with "get-task-allow" checked but with the same result. Has anyone been able to run the example? If that is the case, provide me with instructions on how you got it to run, please. URL: http://developer.apple.com/iphone/library/samplecode/GenericKeychain/index.html

    Read the article

  • Problems with installing jcc and pylucene

    - by Christian
    I'm trying to install pylucene on Windows XP. I installed JDK on C:\Programme\Java\jdk1.6.0_18 . I also installed Visual Studio C++ Express to have a C++ compiler. As first step I'm trying to integrate jcc into python2.6 through the command: C:\Python26\python.exe setup.py build This gives me the following result: C:\Installfiles\pylucene-3.0.1-1\jcc>C:\Python26\python.exe setup.py build Traceback (most recent call last): File "setup.py", line 332, in <module> main('--debug' in sys.argv) File "setup.py", line 289, in main raise type(e), "%s: %s" %(e, args) WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden: ['jav ac.exe', '-d', 'jcc/classes', 'java/org/apache/jcc/PythonVM.java', 'java/org/apa che/jcc/PythonException.java'] Other information: In systems I set: Uservariables: CLASSPATH C:\Programme\Java\jdk1.6.0_18\bin\javac.exe System Variables Path %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem; C:\Programme\Java\jdk1.6.0_18\bin Where does the error come from and what do I have to do to overcome it?

    Read the article

  • Problems integrating nServiceBus with StructureMap

    - by SimonB
    I'm trying to use StructureMap with nServiceBus. The Project: Uses a GenericHost Endpoint to send command messages Configures nServiceBus using the StructMapBuilder. Uses a simple StructureMap registry config Uses a start up class TestServer supporting IWantToRunAtStartup The TestServer class has ctor dependency on a TestManager class The TestManager class has ctor dependency on IBus ObjectFactory.WhatDoIHave() shows StructureMap knows how to construct the classes. When run I get buildup errors. nServiceBus seems to be overwriting the config? Note that when I add a IBus ctor depenendency to my event handlers without any other config all appears fine. Error: Exception when starting endpoint, error has been logged. Reason: Error creating object with name 'nSeviceBusStructureMapTest.TestServer' : Unsatisfied dependency expressed through constructor argument with index 0 of type [nSeviceBusStructureMapTest.ITestManager] : No unique object of type [nSeviceBusStructureMapTest.ITestManager] is defined : Unsatisfied dependency of type [nSeviceBusStructureMapTest.ITestManager]: expected at least 1 matching object to wire the [miningServiceManage] parameter on the constructor of object [nSeviceBusStructureMapTest.TestServer] Source: using System; using System.Diagnostics; using NServiceBus; using StructureMap; using StructureMap.Configuration.DSL; namespace nSeviceBusStructureMapTest { public class TestSmRegistry : Registry { public TestSmRegistry() { For<ITestManager>().Use<TestManager>(); For<TestServer>().Use<TestServer>(); } } public class TestEndPoint : AsA_Server, IConfigureThisEndpoint, IWantCustomLogging { public void Init() { Configure.With().StructureMapBuilder(ObjectFactory.Container); ObjectFactory.Configure(c => c.AddRegistry<TestSmRegistry>()); Debug.WriteLine(ObjectFactory.WhatDoIHave()); } } public class TestServer : IWantToRunAtStartup { public TestServer(ITestManager miningServiceManage) { _miningServiceManage = miningServiceManage; } private readonly ITestManager _miningServiceManage; public void Run() { _miningServiceManage.Run(); } public void Stop() { } } public interface ITestManager { void Run(); } public class TestManager : ITestManager { public TestManager(IBus bus) { _bus = bus; } private readonly IBus _bus; public void Run() { if (_bus == null) Debug.WriteLine("Error no bus"); // Send messages on bus; } } } <MsmqTransportConfig InputQueue="test" ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5" /> <UnicastBusConfig> <MessageEndpointMappings> </MessageEndpointMappings> </UnicastBusConfig> Any ideas?

    Read the article

  • Writing to a log4net FileAppender with multiple threads performance problems

    - by Wayne
    TickZoom is a very high performance app which uses it's own parallelization library and multiple O/S threads for smooth utilization of multi-core computers. The app hits a bottleneck where users need to write information to a LogAppender from separate O/S threads. The FileAppender uses the MinimalLock feature so that each thread can lock and write to the file and then release it for the next thread to write. If MinimalLock gets disabled, log4net reports errors about the file being already locked by another process (thread). A better way for log4net to do this would be to have a single thread that takes care of writing to the FileAppender and any other threads simply add their messages to a queue. In that way, MinimalLock could be disabled to greatly improve performance of logging. Additionally, the application does a lot of CPU intensive work so it will also improve performance to use a separate thread for writing to the file so the CPU never waits on the I/O to complete. So the question is, does log4net already offer this feature? If so, how do you do enable threaded writing to a file? Is there another, more advanced appender, perhaps? If not, then since log4net is already wrapped in the platform, that makes it possible to implement a separate thread and queue for this purpose in the TickZoom code. Sincerely, Wayne

    Read the article

  • Problems with MediaPlayer, raw resources, stop and start

    - by arakn0
    Hello everybody, I'm new in Android development and I have the next question/problem. I'm playing around with the MediaPlayer class to reproduce some sounds/music. I am playing raw resources (res/raw) and it looks kind of easy. To play a raw resource, the MediaPlayer has to be initialized like this: MediaPlayer mp = MediaPlayer.create(appContext, R.raw.song); mp.start(); Until here there is no problem. The sound is played, and everything works fine. My problem appears when I want to add more options to my application. Specifically when I add the "Stop" button/option. Basically, what I want to do is...when I press "Stop", the music stops. And when I press "Start", the song/sound starts over. (pretty basic!) To stop the media player, you only have to call stop(). But to play the sound again, the media player has to be reseted and prepared. mp.reset(); mp.setDataSource(params); mp.prepare(); The problem is that the method setDataSource() only accepts as params a file path, Content Provider URI, streaming media URL path, or File Descriptor. So, since this method doesn't accept a resource identifier, I don't know how to set the data source in order to call prepare(). In addition, I don't understand why you can't use a Resouce identifier to set the data source, but you can use a resource identifier when initializing the MediaPlayer. I guess that I'm missing something. I wonder if I am mixing concepts, and the method stop() doesn't have to be called in the "Stop" button. Any help? Thanks in advanced!!!

    Read the article

  • Problems with cos and sin in Android

    - by bajen micke
    I have a problem with my code in Android. I am using this to moving a ball. If the degree is 90 it should move to the right, if the degree is 180 it should move down etc. This is the code I have done. int degrees=180; int bollspeed=4; bollX += bollspeed*Math.cos(Math.toRadians(degrees)); bollY += bollspeed*Math.sin(Math.toRadians(degrees)); The problem is that when the ball should move 90 degrees it moves 180, and when it should move 180 degrees it moves 270. I have tested all I could come to think... Can anyone see any error in my code or have a expanation I would be really glad. Thanks

    Read the article

  • Problems with jQuery load and getJSON only when using Chrome

    - by leftend
    I'm having an issue with two jQuery calls. The first is a "load" that retrieves HTML and displays it on the page (it does include some Javascript and CSS in the code that is returned). The second is a "getJSON" that returns JSON - the JSON returned is valid. Everything works fine in every other browser I've tried - except Chrome for either Windows or Mac. The page in question is here: http://urbanistguide.com/category/Contemporary.aspx When you click on a Restaurant name in IE/FF, you should see that item expand with more info - and a map displayed to the right. However, if you do this in Chrome all you get is the JSON data printed to the screen. The first problem spot is when the "load" function is called here: var fulllisting = top.find(".listingfull"); fulllisting.load(href2, function() { fulllisting.append("<div style=\"width:99%;margin-top:10px;text-align:right;\"><a href=\"#\" class=\"" + obj.attr("id") + "\">X</a>"); itemId = fulllisting.find("a.listinglink").attr("id"); ... In the above code, the callback function doesn't seem to get invoked. The second problem spot is when the "getJSON" function is called: $.getJSON(href, function(data) { if (data.error.length > 0) { //display error message } else { ... } In this case - it just seems to follow the link instead of performing the callback... and yes, I am doing a "return false;" at the end of all of this to prevent the link from executing. All of the rest of the code is inline on that page if you want to view the source code. Any ideas?? Thanks

    Read the article

  • Linq to SQL case sensitivity causing problems

    - by Roger Lipscombe
    I've seen this question, but that's asking for case-insensitive comparisons when the database is case-sensitive. I'm having a problem with the exact opposite. I'm using SQL Server 2005, my database collation is set to Latin1_General_CI_AS. I've got a table, "User", like this: CREATE TABLE [dbo].[User] ( [Id] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](max) NOT NULL, CONSTRAINT [PK_Example] PRIMARY KEY CLUSTERED ( [Id] ASC ) ) And I'm using the following code to populate it: string[] names = new[] { "Bob", "bob", "BoB" }; using (MyDataContext dataContext = new AppCompatDataContext()) { foreach (var name in names) { string s = name; if (dataContext.Users.SingleOrDefault(u => u.Name == s) == null) dataContext.Users.InsertOnSubmit(new User { Name = name }); } dataContext.SubmitChanges(); } When I run this the first time, I end up with "Bob", "bob" and "BoB" in the table. When I run it again, I get an InvalidOperationException: "Sequence contains more than one element", because the query against the database returns all 3 rows, and... SELECT * FROM [User] WHERE Name = 'bob' ... is case-insensitive. That is: when I'm inserting rows, Linq to SQL appears to use C# case-sensitive comparisons. When I query later, Linq to SQL uses SQL Server case-insensitive comparisons. I'd like the initial insert to use case-insensitive comparisons, but when I change the code as follows... if (dataContext.Users.SingleOrDefault(u => u.Name.Equals(s, StringComparison.InvariantCultureIgnoreCase) ) == null) ... I get a NotSupportedException: "Method 'Boolean Equals(System.String, System.StringComparison)' has no supported translation to SQL." Question: how do I get the initial insert to be case-insensitive or, more precisely, match the collation of the column in the database? Update: This doesn't appear to be my problem. My problem appears to be that SingleOrDefault doesn't actually look at the pending inserts at all.

    Read the article

  • Problems with $libdir on PostgreSQL

    - by Joe Germuska
    In short, my question is "why doesn't $libdir work on my PSQL installation." CREATE FUNCTION st_box2d_in(cstring) RETURNS box2d AS '$libdir/liblwgeom', 'BOX2DFLOAT4_in' LANGUAGE c IMMUTABLE STRICT; yields an error could not access file "$libdir/liblwgeom": No such file or directory while CREATE FUNCTION st_box2d_in(cstring) RETURNS box2d AS '/usr/local/pgsql/lib/liblwgeom', 'BOX2DFLOAT4_in' LANGUAGE c IMMUTABLE STRICT; works correctly. The output of % pg_config --pkglibdir /usr/local/pgsql/lib appears to be correct.

    Read the article

  • json problems with making a ruby on rails application

    - by Prince Merdz
    So I'm using Bitnami to learn Ruby on Rails. I have also previously tried the manual installation for ruby and rails and was met by the same problem so I thought I should try first the easy package deal of Bitnami. Anyway my problem with json is that it causes the bundle install to fail. First the auto bundle install that rails new does fails because of an ssl error. Which is easily solved by changing the source in the gemfile which is https to http. However when I try to bundle install it does another error when it tries to install json. C:\RubyStack-3.2.7-0\projects\testing>bundle install Fetching gem metadata from http://rubygems.org/......... Using rake (0.9.2.2) Using i18n (0.6.0) Using multi_json (1.3.6) Installing activesupport (3.2.8) Using builder (3.0.0) Installing activemodel (3.2.8) Using erubis (2.7.0) Using journey (1.0.4) Using rack (1.4.1) Using rack-cache (1.2) Using rack-test (0.6.1) Using hike (1.2.1) Using tilt (1.3.3) Using sprockets (2.1.3) Installing actionpack (3.2.8) Using mime-types (1.19) Using polyglot (0.3.3) Using treetop (1.4.10) Using mail (2.4.4) Installing actionmailer (3.2.8) Using arel (3.0.2) Using tzinfo (0.3.33) Installing activerecord (3.2.8) Installing activeresource (3.2.8) Using bundler (1.1.5) Using coffee-script-source (1.3.3) Using execjs (1.4.0) Using coffee-script (2.2.0) Using rack-ssl (1.3.2) Installing json (1.7.5) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension . C:/RUBYST~1.7-0/ruby/bin/ruby.exe extconf.rb creating Makefile make 0 [main] echo 5244 open_stackdumpfile: Dumping stack trace to echo.exe.sta ckdump make: *** [generator-i386-mingw32.def] Error 5 Gem files will remain installed in C:/RUBYST~1.7-0/ruby/lib/ruby/gems/1.9.1/gems /json-1.7.5 for inspection. Results logged to C:/RUBYST~1.7-0/ruby/lib/ruby/gems/1.9.1/gems/json-1.7.5/ext/j son/ext/generator/gem_make.out An error occured while installing json (1.7.5), and Bundler cannot continue. Make sure that `gem install json -v '1.7.5'` succeeds before bundling. This is the gem_make.out file it produces after trying to install json (btw windows also produces an error that echo.exe has stopped working while running the gem install json) C:/RUBYST~1.7-0/ruby/bin/ruby.exe extconf.rb creating Makefile make 0 [main] echo 5244 open_stackdumpfile: Dumping stack trace to echo.exe.stackdump make: *** [generator-i386-mingw32.def] Error 5 I can't even start learning ror for the setup is already a huge pain. (btw I have no prior experience with web frameworks, just desktop programming). help?

    Read the article

  • Problems with show hid jquery

    - by Michael
    I am someone can help... This should be easy but I am lost. <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Show Hide Sample</title> <script src="js/jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $('#content1').hide(); $('a').click(function(){ $('#content1').show('slow'); }); $('a#close').click(function(){ $('#content1').hide('slow'); }) }); </script> <style> body{font-size:12px; font-family:"Trebuchet MS"; background: #CCF} #content1{ border:1px solid #DDDDDD; padding:10px; margin-top:5px; width:300px; } </style> </head> <body> <a href="#" id="click">Test 1</a> <div class="box"> <div id="content1"> <h1 align="center">Hide 1</h1> <P> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam pulvinar, enim ac hendrerit mattis, lorem mauris vestibulum tellus, nec porttitor diam nunc tempor dui. Aenean orci. Sed tempor diam eget tortor. Maecenas quis lorem. Nullam semper. Fusce adipiscing tellus non enim volutpat malesuada. Cras urna. Vivamus massa metus, tempus et, fermentum et, aliquet accumsan, lectus. Maecenas iaculis elit eget ipsum cursus lacinia. Mauris pulvinar.</p> <p><a href="#" id="close">Close</a></p> </div> </div> <a href="#" id="click">Test 2</a> <div class="box"> <div id="content1"> <h1 align="center">Hide 2</h1> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam pulvinar, enim ac hendrerit mattis, lorem mauris vestibulum tellus, nec porttitor diam nunc tempor dui. Aenean orci. Sed tempor diam eget tortor. Maecenas quis lorem. Nullam semper. Fusce adipiscing tellus non enim volutpat malesuada. Cras urna. Vivamus massa metus, tempus et, fermentum et, aliquet accumsan, lectus. Maecenas iaculis elit eget ipsum cursus lacinia. Mauris pulvinar.</p> <p><a href="#" id="close">Close</a></p> </div> </div> </body> </html>

    Read the article

  • Big sinatra problems

    - by Joel M.
    Hi, So I'm having huge trouble with sinatra. Here's what I have: require 'dm-core' DataMapper.setup(:default, ENV['DATABASE_URL'] || 'sqlite3://my.db') class Something include DataMapper::Resource property :id, Serial property :thing, Text property :run_in, Integer property :added_at, DateTime property :to, String def schedule cronify(self.thing+" to "+self.to, "http://url"+self.id.to_s, self.run_in) end def notify text(self.thing, self.to) end end Something.auto_upgrade! The cronify method works. I tested it in irb. Also, the schedule instance method works, I tested it in the console. However, it doesn't work in the route, even though it works in the console. post '/add' do @something = Something.create(blah) #this works fine @something.schedule #this works fine in the console; not in the route. end I've tried everything, from @something.create(blah).schedule (which also works fine in the console, but not in the route), to defining the method cronify inside the sinatra helpers, and even calling cronify directly on the route. Nothing works on the route. What am I doing wrong?

    Read the article

  • Understanding floating point problems

    - by Maxim Gershkovich
    Could someone here please help me understand how to determine when floating point limitations will cause errors in your calculations. For example the following code. CalculateTotalTax = function (TaxRate, TaxFreePrice) { return ((parseFloat(TaxFreePrice) / 100) * parseFloat(TaxRate)).toFixed(4); }; I have been unable to input any two values that have caused for me an incorrect result for this method. If I remove the toFixed(4) I can infact see where the calculations start to lose accuracy (somewhere around the 6th decimal place). Having said that though, my understanding of floats is that even small numbers can sometimes fail to be represented or have I misunderstood and can 4 decimal places (for example) always be represented accurately. MSDN explains floats as such... This means they cannot hold an exact representation of any quantity that is not a binary fraction (of the form k / (2 ^ n) where k and n are integers) Now I assume this applies to all floats (inlcuding those used in javascript). Fundamentally my question boils down to this. How can one determine if any specific method will be vulnerable to errors in floating point operations, at what precision will those errors materialize and what inputs will be required to produce those errors? Hopefully what I am asking makes sense.

    Read the article

  • How can UNIX access control create compromise problems ?

    - by Berkay
    My system administrators advice me to be careful when setting access control to files and directories. He gave me an example and i got confused, here it is: a file with protection mode 644 (octal) contained in a directory with protection mode 730. so it means: File:101 100 100 (owner, group,other: r-x r-- r--) Directory:111 011 000 (owner, group,other: rwx -wx ---) How can file be compromised in this case ?

    Read the article

  • Problems with Jquery Plugin

    - by CoffeeCode
    I'm using AJAX_POSTUP. When i make a request it sends a file to a bowser [offers to download] (the files content are params of the action methods). Does anyone know whats going on and how i can avoid this problem??? i'm not aware of other plugins such as AJAX_POSTUP

    Read the article

  • css: problems with floating a sidebar

    - by user239831
    hey guys, i can't seem to get it working. i have a div.post with #comments and a #respond form underneath it. the div.post contains the #comments and the #respond form. i simply want to float the sidebar to the right of the entire div.post and i cannot seem to get it work. here is an example. any idea how to solve that - its probably quite simple. :) <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>layout</title> <style type="text/css"> body { margin:0; padding:0; } #main { width:100%; background:#cfcfcf; } .inner { margin: 0 auto; padding: 96px 72px 0; width: 1068px; border-color: #000; border-style: solid; border-width: 0 1px; color: #3C3C3C; } .post { width: 705px; background:#999; } #comments, #respond { width: 705px; background:#999; } #sidebar { width:338px; background:#777; margin-left:730px; } </style> </head> <body> <div id="main"> <div class="inner"> <div id="post" class="post"> <h2>Lorem Ipsum Test Page</h2> <div class="entry"> <p>Lorem ipsum sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p> </div> <!-- entry --> <div id="comments"> <h2>One Response</h2> <ol class="commentlist"> <li id="comment" class="comment"> <div class="comment-body"> <div class="comment-author vcard"> Tom says: </div> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea found. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p> </div> </li> </ol> </div> <!-- comments --> <div id="respond"> <h2>Leave a Reply</h2> <form id="commentform" method="post" action=""> <input type="text" aria-required="true" tabindex="1" size="22" value="" id="author" name="author" gtbfieldid="230"> <label for="author">Name (required)</label> <input type="text" aria-required="true" tabindex="2" size="22" value="" id="email" name="email" gtbfieldid="231"> <label for="email">Mail (will not be published) (required)</label> <input type="text" tabindex="3" size="22" value="" id="url" name="url" gtbfieldid="232"> <label for="url">Website</label> </div> <textarea tabindex="4" rows="10" cols="58" id="comment" name="comment"></textarea> <input type="submit" value="Submit Comment" tabindex="5" id="submit" name="submit"> <input type="hidden" id="comment_post_ID" value="36" name="comment_post_ID"> <input type="hidden" value="0" id="comment_parent" name="comment_parent"> </form> </div> <!-- respond --> </div> <!-- post --> <div id="sidebar"> <h2>Meta</h2> <ul> <li>Login</li> <li>Anything</li> </ul> <h2>Subscribe</h2> <ul> <li>Entries (RSS)</li> <li>Comments (RSS)</li> </ul> </div> <!-- sidebar --> </div> <!-- inner --> </div> <!-- main --> </body> </html> edit: can you see any errors in my html. firebug says that the sidebar div is actually outside the .inner div. however if i look at the code it's inside.

    Read the article

  • Using httplib2 in python 3 properly? (Timeout problems)

    - by Sho Minamimoto
    Hey, first time post, I'm really stuck on httplib2. I've been reading up on it from diveintopython3.org, but it mentions nothing about a timeout function. I look up the documentation, but the only thing I see is an ability to put a timeout int but there are no units specified (seconds? milliseconds? What's the default if None?) This is what I have (I also have code to check what the response is and try again, but it's never tried more than once) h = httplib2.Http('.cache', timeout=None) for url in list: response, content = h.request(url) more stuff... So the Http object stays around until some arbitrary time, but I'm downloading a ton of pages from the same server, and after a while, it hangs on getting a page. No errors are thrown, the thing just hangs at a page. So then I try: h = httplib2.Http('.cache', timeout=None) for url in list: try: response, content = h.request(url) except: h = httplib2.Http('.cache', timeout=None) more stuff... But then it recreates another Http object every time (goes down the 'except' path)...I dont understand how to keep getting with the same object, until it expires and I make another. Also, is there a way to set a timeout on an individual request? Thanks for the help!

    Read the article

  • html5 canvas hand cursor problems

    - by pfunc
    I'm playing around with html5 and some javascript to make a minor sketchpad. Whenever I click down on the canvas in chrome, the cursor becomes a text cursor. I have tried putting cursor: hand in the css, but that doesn't seem to work. This has got to be an easy thing, but I look it up and can't find it anywhere

    Read the article

  • form with multiple upload but allow no upload on edit problems

    - by minus4
    hiya i have a section that when created takes in images, however when you edit this item i dont want them to re-upload none changes images just to change a description or name. i have created this that deals with uploading files: public void UploadFiles(string currentFileName, FormCollection form) { // loop through all files in form post foreach (string file in Request.Files) { HttpPostedFileBase hpf = Request.Files[file]; // if no file is uploaded, we could be editing so set to current value if (hpf.ContentLength == 0) { form[file] = currentFileName; } else { //rename the file unique so we dont clash with names var filename = hpf.FileName.Replace(" ", "_").Replace(".", DateTime.Now.Date.Ticks + "."); UploadFileName = filename; hpf.SaveAs(Server.MapPath("~/Content/custom/" + filename)); // set the name of the file in our post to the new name form[file] = UploadFileName; } } // ensure value is still sent when no files are uploaded on edit if(Request.Files.Count <= 0) { UploadFileName = currentFileName; } } all works fine when only one image is required (CurrentFileName), however there is now a new image available taking it to a total of 2 images in the database therefor currentFileName is obsolete. has anyone tackled this and how as i have hit a wall with this one. thought of string[] currentFiles but cant see how to match this into string file in Request.Files. if it helps i am also working with models for the form so i could pass over the model but i dont think your able to do model.file without some kind of reflection. help much appreciated. thanks

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >