Search Results

Search found 6433 results on 258 pages for 'trouble shooting'.

Page 121/258 | < Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >

  • Creating a form for editing embedded documents with MongoMapper

    - by Luke Francl
    I'm playing around with MongoMapper but I'm having trouble figuring out how to create a form for an object that has embedded documents. With ActiveRecord, I'd use fields_for but when asked if this would be supported a few months ago, MongoMapper author John Nunemaker wrote: "Nope and nope. It is really [not] that hard with attr_accessor's." OK, fair enough, but how do you write the form for this to work? I'm not interested in using the nested form implementations that are out there because I want to do this the "normal" way as I'm learning about MongoMapper. My model is simple enough - I've got a Person with embedded documents for email addresses, phone numbers, etc. I do not care about updating existing embedded documents. They can be re-created from the form input each time a Person is edited.

    Read the article

  • SharedPreferences.onSharedPreferenceChangeListener not being called consistently

    - by synic
    I'm registering a preference change listener like this (in the onCreate() of my main activity): SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); prefs.registerOnSharedPreferenceChangeListener( new SharedPreferences.OnSharedPreferenceChangeListener() { public void onSharedPreferenceChanged( SharedPreferences prefs, String key) { System.out.println(key); } }); The trouble is, the listener is not always called. It works for the first few times a preference is changed, and then it is no longer called until I uninstall and reinstall the app. No amount of restarting the application seems to fix it. I found a mailing list thread reporting the same problem, but no one really answered him. What am I doing wrong?

    Read the article

  • Windows Service Webbrowser object invalid cast exception error

    - by Sam Youtsey
    Hi all, I'm having a bit of trouble with a Windows Service webbrowser object. It's attempting to load in values of username and password to a site but keeps failing and throwing the following error: System.InvalidCastException: Specified cast is not valid. at System.Windows.Forms.UnsafeNativeMethods.IHTMLDocument2.GetLocation() at System.Windows.Forms.WebBrowser.get_Document() at MyWindowsService.MyDataProcessor.login() The code that I'm using to make this call is: MyWebBrowser.Document.All["Login"].SetAttribute("Value", username); MyWebBrowser.Document.All["Password"].SetAttribute("Value", password); MyWebBrowser.Document.All["submit"].InvokeMember("Click"); Any ideas as to why it keeps failing? Thanks in advance for the help.

    Read the article

  • Unit Testing & Fake Repository implementation with cascading CRUD operations

    - by Erik Ashepa
    Hi, i'm having trouble writing integration tests which use a fake repository, For example : Suppose I have a classroom entity, which aggregates students... var classroom = new Classroom(); classroom.Students.Add(new Student("Adam")); _fakeRepository.Save(classroom); _fakeRepostiory.GetAll<Student>().Where((student) => student.Name == "Adam")); // This query will return null... When using my real implementation for repository (NHibernate based), the above code works (because the save operation would cascade to the student added at the previous line), Do you know of any fake repository implementation which support this behaviour? Ideas on how to implement one myself? Or do you have any other suggestions which could help me avoid this issue? Thanks in advance, Erik.

    Read the article

  • PHP's SimpleXML not handling &#8217 ; properly

    - by Matty
    I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this into a ’. What can I do to stop this? Just to answer some of the questions that have come up - I'm pulling an RSS feed using CURL. If I output this directly to the browser, the &#8217; displays as ’ which is what's expected. When I create a new SimpleXMLElement using this, (e.g. $xml = new SimpleXmlElement($raw_feed); and dump the $xml variable, every instance of &#8217; is replaced with ’. It appears that SimpleXML is having trouble with UTF-8 ampersand encoded characters. (The XML declaration specifies UTF-8.) I do have control over the feed after CURL has retrieved the feed before it's used to construct a SimpleXML element.

    Read the article

  • Isolate SQL field using regex

    - by Das123
    I'm trying to isolate a specific field in a SQL dump file so I can edit it but I'm not having any luck. The regex I'm using is: ^(?:(?:'[^\r\n']*'|[^,\r\n]*),){6}('[^\r\n']*'|[^,\r\n]*) Which is supposed to grab the seventh field and place it inside reference 1. The trouble is that this is stumbling when ever it finds a comma inside a text field and counts the partial match as the allowable matches. Eg. (1, 'Title', 1, 3, '2006-09-29', 'Commas, the bane of my regex', 'This is the target', 2, 4) matches " the bane of my regex'" instead of "'This is the target'".

    Read the article

  • Django: reverse lookup URL of feeds?

    - by Santa
    I am having trouble doing a reverse URL lookup for Django-generated feeds. I have the following setup in urls.py: feeds = { 'latest': LatestEntries, } urlpatterns = patterns('', # ... # enable feeds (RSS) url(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}, name='feeds_view'), ) I have tried using the following template tag: <a href="{% url feeds_view latest %}">RSS feeds</a> But the resulting link is not what want (http://my.domain.com/feeds//). It should be http://my.domain.com/feeds/latest/. For now, I am using a hack to generate the URL for the template: <a href="http://{{ request.META.HTTP_HOST }}/feeds/latest">RSS feeds</a> But, as you can see, it clearly is not DRY. Is there something I am missing?

    Read the article

  • Facebook Canvas Apps, New API

    - by James
    I'm having some trouble with switching to the new JS API for a number of things with creating applications within FB, specifically the "Tab". <!-- function do_perm() { Facebook.showPermissionDialog('publish_stream,email,offline_access', null); } //--> This no longer works for me when called via an onclick command. Also, with the new API and an FBML app. How does this exactly work? The documentation is really poor so I am confused when looking at the old wiki, and the new developer site. Apologies for being pretty vague, but I'm just generally confused with the lack of clear direction with the new API and help would be greatly appreciated. I'm simply just trying to create a call that prompts for the new style user permission dialog, and oncomplete calls another JS function.

    Read the article

  • Redirect console input and output to a textbox.

    - by Peter
    Hi there and thanking in advance I am trying (very hard) to redirect Console input and output into a textbox. So far output is working fine but the trouble is with input. For example I cannot execute a simple program that will do the following: Console.WriteLine("Please enter your name: "); string name = Console.ReadLine(); Console.WriteLine("Hi there " + name); The reason I can't achieve this is because that the program has to stop while waiting for user to type his/her name and press enter. If I wait for user input on a new thread then the main GUI thread freezes and the textbox can never receive the KeyPress. This thing has me totally stumped. Any advice (or better still code) would be greatly appreciated. Cheers

    Read the article

  • Riddle with "href".

    - by kalininew
    Mysticism. I use XSLT for reception of the address for the reference. <a href="{element/url}"/> In XML i have: <element> <url>www.mysite.ru</url> </element> As a result on page I receive: <a href="www.currentsite.ru/cursection/cursubsection/www.mysite.ru"/> That is: in the beginning there is an address of a current site (the address of current section where we now are), and then there is a reference to an external site. There can be it any problem with metatag BASE? In what a trouble?

    Read the article

  • "The application has failed to start because cxcore210.dll was not found". Why would this happen?

    - by tomas
    I'm having trouble running basic opencv scripts on my new machine. I've installed opencv2.1. I am linking these files: C:\OpenCV2.1\lib\cv210.lib C:\OpenCV2.1\lib\cvaux210.lib C:\OpenCV2.1\lib\cxcore210.lib C:\OpenCV2.1\lib\highgui210.lib from the linker. I run the program, it compiles. However, it gives me the error stated above. Why is that? I tried linking to the dll it describes, and it doesn't like that either.

    Read the article

  • Round-robin assignment

    - by Robert
    Hi, I have a Customers table and would like to assign a Salesperson to each customer in a round-robin fashion. Customers --CustomerID --FName --SalespersonID Salesperson --SalespersonID --FName So, if I have 15 customers and 5 salespeople, I would like the end result to look something like this: CustomerID -- FName -- SalespersonID 1 -- A -- 1 2 -- B -- 2 3 -- C -- 3 4 -- D -- 4 5 -- E -- 5 6 -- F -- 1 7 -- G -- 2 8 -- H -- 3 9 -- I -- 4 10 -- J -- 5 11 -- K -- 1 12 -- L -- 2 13 -- M -- 3 14 -- N -- 4 15 -- 0 -- 5 etc... I've been playing around with this for a bit and am trying to write some SQL to update my Customers table with the appropriate SalespersonID, but am having some trouble getting it to work. Any ideas are greatly appreciated!

    Read the article

  • Blackberry.location API not working correctly

    - by chibineku
    I am experimenting with making Blackberry widgets but having a little trouble. My first trial involves displaying a button which, when clicked, calls a JavaScript function that should alert the phones latitude and longitude. The function looks: function whereAmI() { var latitude = blackberry.location.latitude; var longitude = blackberry.location.longitude; alert("Lat: "+latitude+", Long: "+longitude); } But it only ever alerts "Lat: 0, Long: 0". I've checked and my GPS seems to be working ok. I'm running OS 5.* on a Curve 8900. Any help would be appreciated :)

    Read the article

  • Python - Check if numbers in list are factors of a number

    - by Zach
    Hey, I have a list of numbers (integers) (say, from 1 to 10). They're not necessarily consecutive, but they are in ascending order. I've prompted the user multiple times to enter a choice of the available numbers. When that number is entered, it is removed from the list along with any of its factors that may be there. I've prevented the user from selecting prime numbers. However, at some point in time, there may be non-prime numbers there, which have no factors remaining. I'm relatively new to Python, so I'm having trouble implementing: Checking if the number selected has no factors remaining (even if it is not prime). Checking if only prime numbers remain, or numbers without factors. I'm thinking of using for statements, but I'm not sure exactly how to implement them. Can anyone offer advice, or code? Thanks in advance... PS. In case anyone's wondering, I'm doing an implementation of the game of Taxman in Python.

    Read the article

  • External XMPP component - Anyone know a Tutorial or Open Source Example please?

    - by gav
    Hi All, I want to run an XMPP server (Openfire) and register an external component to handle the messages it will recieve (using the Whack library). The external component will run my game logic and I will be using XMPP to send player moves to the server and status updates in the other direction. The bonus with XMPP is that we get built in chat for free. The trouble is, although Ignite look fairly established, I can't find a tutorial on how to write, register and debug an External XMPP component written with Whack, there are very few in general for that matter. I am not invested in either the server implementation or the External Component library, java is just my language of choice. If I was to move to Erlang or Scala or something it would have to be a very simple in that language. A single tutorial or example would go a long way here, I just need an basic External XMPP component pretty please! Kind regards, Gavin

    Read the article

  • Invalid padding on ASP 2.0 cookie, MVC looks ok

    - by brian b
    We have a cookie management library that writes a cookie containing some sensitive information, encrypted with Rijndael. The cookie encrypts and decrypts fine in unit tests (using Moq), works fine for MVC web applications, but when called from an ASP.net 2.0 website, the cookie cannot be decrypted. "Padding is invalid and cannot be removed." We are sure that the cookie value is valid because we tested it 10,000 times with random data in a unit test. There is something about what ASP.NET 2.0 does when it reads and writes the cookie that causes trouble. There has to be a gotcha. Any suggestions?

    Read the article

  • Is there a solution for deploying IIS websites that's similar to Capistrano?

    - by Matt Ephraim
    Capistrano is a great solution for building scripts that automatically deploy a website and/or a database. But, it's also very *nix centric, and from I've read it would probably be more trouble than it's worth to get it working with a Windows server. Is there a similar solution that would allow me to deploy an ASP.Net website to an IIS server and a SQL Server database? What I'm looking for is something that would allow the same kind of flexibility that Capistrano allows, as far customizing how I want the site to be deployed, what version control system I want to pull from, how it will handle rollbacks to a previous version of a site, etc. So far, I haven't been able to find a free solution that has the same sort of functionality that Capistrano has.

    Read the article

  • java generics covariance

    - by soocracy42
    I am having trouble understanding the following article: http://www.ibm.com/developerworks/java/library/j-jtp01255.html Under, Generics are not covariant the author states, Because ln is a List, adding a Float to it seems perfectly legal. But if ln were aliased with li, then it would break the type-safety promise implicit in the definition of li -- that it is a list of integers, which is why generic types cannot be covariant. I can't understand the part where it says "if ln were aliased with li". What does the author means by alias?(reference?). The code snippet above the quoted line seems to illustrate WHAT is illegal in java and not WHY. It would be very helpful to me if somebody could explain with an example. Thanks in advance.

    Read the article

  • Cassandra/HBase or just MySQL: Potential problems doing the next thing

    - by alexeypro
    Say I have "user". It's the key. And I need to keep "user count". I am planning to have record with key "user" and value "0" to "9999+ ;-)" (as many as I'll have). What problems I will drive in if I use Cassandra, HBase or MySQL for that? Say, I have thousand of new updates to this "user" key, where I need to increment the value. Am I in trouble? Locked for writes? Any other way of doing that? Why this is done -- there will be a lot of "user"-like keys. Different other cases. But the idea is the same. Why keep it this way -- because I'll have more reads, so I can always get "counted value" very fast.

    Read the article

  • Autofac in Asp.net mvc 2

    - by Joe
    I want/need to compile autofac with asp.net mvc 2 website. I want to step thru the source to see how it works. But here is my problem. The binaries for mvc dll is apparently bound for asp.net mvc 1. I am having trouble working out what the settings for the project file need to be for .Net 3.5 and asp.net mvc 2. one is the NET35 directive but I still get errors that out is not a type.

    Read the article

  • Dispatcher.Invoke not working in .NET 3.0 SP1

    - by Kapil
    I am developing a WPF windows application and am getting into a trouble running the app in .NET 3.0. Everytime that I try to access the System.Windows.Threading.Dispatcher.Invoke() method, I get a method-not-found error. Basically, I spawn a new thread from the main thread and try to change some UI properties (basically update a progress-bar) from the new thread using the following code: updateStatusDelegate usd = new updateStatusDelegate(progressBar.SetValue); Dispatcher.Invoke(usd, System.Windows.Threading.DispatcherPriority.Background, new object[] { System.Windows.Controls.ProgressBar.ValueProperty, Convert.ToDouble(perc) }); Can someone help me understand why do I encounter this error in .NET 3.0 version? I am able to get this going in .NET 3.0 SP2. But I guess .NET is not distributed independantly and is packaged only with .NET 3.5 version. My goal is to get away with the dependancy of .net 3.5 and have a dependancy on .NET 3.0 version Any help would be appreciated. Thanks Kapil

    Read the article

  • How to handle User "confirmation" with Watir/Cucumber?

    - by Matt Darby
    I'm new to Watir and I've having a little trouble getting logged in in my tests. I use authlogic as my authentication method of choice. When a User registers, they are sent an email with a confirmation link. Clicking this link confirms their account and they can then login. The issue I'm having is how do I confirm the User when using Watir? I have so far: Given /I sign up/ do BROWSER.goto("http://localhost:3000/register") BROWSER.text_field(:id, "user_email").set("[email protected]") BROWSER.text_field(:id, "user_name").set("Foo Bar) BROWSER.text_field(:id, "user_password").set("foo bar") BROWSER.text_field(:id, "user_password_confirmation").set("foo bar") BROWSER.button(:id, "user_submit").click end Given /I am logged in via Watir/ do BROWSER.goto("http://localhost:3000/login") BROWSER.text_field(:id, "user_session_email").set("[email protected]) BROWSER.text_field(:id, "user_session_password").set("foo bar") BROWSER.button(:id, "user_session_submit").click end This correctly populates the fields and the User is saved. Now I try to confirm the User like so: Given /I am confirmed/ do User.last.confirmed! end Unfortunately this doesn't work. What am I missing?

    Read the article

  • Select and Insert across dblink

    - by Domtar
    I am having a bit of trouble with a select into insert across a dblink in oracle 10. I am using the following statement: INSERT INTO LOCAL.TABLE_1 ( COL1, COL2) SELECT COL1, COL2 FROM REMOTE.TABLE1@dblink s WHERE COL1 IN ( SELECT COL1 FROM WORKING_TABLE) When I run the statement the following is what gets run against the remote server on the DB Link: SELECT /*+ OPAQUE_TRANSFORM */ "COL1", "COL2" FROM "REMOTE"."TABLE1" "S" If I run the select only and do not do the insert into the following is run: SELECT /*+ */ "A1"."COL1" , "A1"."COL2" FROM "REMOTE"."TABLE1" "A1" WHERE "A1"."COL1" = ANY ( SELECT "A2"."COL1" FROM "LOCAL"."TABLE1"@! "A2") The issue is in the insert case the enitre table is being pulled across the dblink and then limited localy which takes a fair bit of time given the table size. Is there any reason adding the insert would change the behavior in this manner?

    Read the article

  • How to link a SQlite Extension Source File into Xcode for iPhone?

    - by crunchyt
    I use a statically linked library for Sqlite in an iPhone Xcode project. I am now trying to include a .C extension to Sqlite in this project. However, I am having trouble making the Sqlite in the build SEE the extension. The statically linked Sqlite library works fine. Also the .C extension works on my desktop, and builds fine as a statically linked library in Xcode. However, the custom functions it defines are missing when called. For example, I load the extension as so with no errors. SELECT load_extension('extension_name.so'); But when I try to call a function defined in the extension, I get this message DB Error: 1 "no such function: custom_function" Does anyone know much about linking a Sqlite extension into an Xcode project?

    Read the article

  • Jquery: Preload an image on request with a callback function?

    - by tarnfeld
    Hey, I'm helping out a friend with a website he's developing and we are having trouble with preloading images on request. Basically, when the user clicks on a thumbnail of the product a <div> slides down that includes a scrolling carrousel of large images. In total there are about 20MB of images that could be loaded in (if you did them all) so preloading them on the page load would not be an option. Is there a way that we could call a javascript function that begins to preload about 4 images and then when it's done it has a callback function? Thanks! P.S. We are using jQuery on the page...

    Read the article

< Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >