Daily Archives

Articles indexed Saturday May 8 2010

Page 6/78 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Using objective-c objects with an NSDictionary

    - by Mark
    I want store a URL against a UILabel so that when a user touches the label it takes them to that URL in a UIWebView. I have declared a NSDictionary like so: NSMutableArray *linksArray = [[NSMutableArray alloc] init]; [linksArray addObject: [NSValue valueWithNonretainedObject: newsItem1ReadMoreLabel]]; [linksArray addObject: [NSValue valueWithNonretainedObject: newsItem2ReadMoreLabel]]; [linksArray addObject: [NSValue valueWithNonretainedObject: newsItem3ReadMoreLabel]]; [linksArray addObject: [NSValue valueWithNonretainedObject: newsItem4ReadMoreLabel]]; [linksArray addObject: [NSValue valueWithNonretainedObject: newsItem5ReadMoreLabel]]; //NSString *ageLink = @"http://www.theage.com.au"; NSArray *defaultLinks = [NSArray arrayWithObjects: @"1", @"2", @"3", @"4", @"5", nil]; self.urlToLinkDictionary = [[NSMutableDictionary alloc] init]; self.urlToLinkDictionary = [NSDictionary dictionaryWithObjects:defaultLinks forKeys:linksArray]; Considering I used a NSValue as the key, how do I get/set the URL associated with that key given that I only have references to the UILabels? this is what I have but it doesn't work: for(NSValue *key in [self.urlToLinkDictionary allKeys]) { if ([key nonretainedObjectValue] == linkedLabel) { [self.urlToLinkDictionary setValue:[newsItem link] forKey: key]; } } but I get an error: "objc_exception_throw" resolved

    Read the article

  • WebClient DownloadStringCompleted Never Fired in Console Application

    - by azamsharp
    I am not sure why the callback methods are not fired AT ALL. I am using VS 2010. static void Main(string[] args) { try { var url = "some link to RSS FEED"; var client = new WebClient(); client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted); client.DownloadDataCompleted += new DownloadDataCompletedEventHandler(client_DownloadDataCompleted); client.DownloadStringAsync(new Uri(url)); } catch (Exception ex) { Console.WriteLine(ex.Message); } } // THIS IS NEVER FIRED static void client_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e) { Console.WriteLine("something"); } // THIS IS NEVER FIRED static void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { Console.WriteLine("do something"); var rss = XElement.Parse(e.Result); var pictures = from item in rss.Descendants("channel") select new Picture { Name = item.Element("title").Value }; foreach (var picture in pictures) { Console.WriteLine(picture.Name); Console.WriteLine(picture.Url); } }

    Read the article

  • ASPNET MVC - Why is ModelState.IsValid false "The x field is required" when that field does have a v

    - by JK
    I have a model like this: public PurchaseOrder { [Required] [StringLength(15)] public virtual string OrderNumber {get;set;} // etc. } When I submit an order from the view (using $.post, not input type=submit) it goes to my controller class: public class PurchaseOrderController { public JsonResult Save(PurchaseOrder order) { // TryUpdateModel(order); // commented out since modelstate.isvalid remains false anyway if (ModelState.IsValid) { // its never valid } } } ModelState.IsValid always returns false, with the error: "The Order Number field is required." But there is a value in this field (?? why) Why would it say "value is required" when it does have a value? Have I missed something? Is it because of the $.post instead of the submit? What can I do? This is what the debugger looks like:

    Read the article

  • 3ware RAID in Windows 7

    - by user36484
    Just moved a 3ware 9500S-8 raid card and a few drives from my linux box into my win7 box. Windows Updates picked up the 3ware driver and installed it. After a reboot I checked Disk Management and it shows the array as one solid drive with the correct size. The only issue is that its not assigned a drive letter and when I right click on it my only option is to Convert to Dynamic Disk... From what I've read this is not something I want to do. What are my options?

    Read the article

  • python: a way to get an exhaustive, sorted list of keys in a nested dictionary?

    - by saidimu
    exhaustive: - all keys in the dictionary, even if the keys are in a nested dictionary that is a value to a previous-level dictionary key. sorted: - this is to ensure the keys are always returned in the same order The nesting is arbitrarily deep. A non-recursive algorithm is preferred. level1 = { 'a' : 'aaaa', 'level2_1' : {'b': 'bbbbb', 'level3': {'c': 'cccc', 'd': 'dddddd'} }, 'level2_2' : { 'z': 'zzzzzzz' } }

    Read the article

  • Multivariant email in Dynamics CRM

    - by esp
    Does anybody have resources on multivariant email testing in Dynamics CRM? Multivariant email being where an organization wants to segment their contacts and send separant variations of an email campaign to different segments in their organization?

    Read the article

  • msys+mingw - is there installer or at least .tar.lzma/.zip?

    - by Maciej Piechotka
    I try to install n'th time the msys+mingw - however with little success. I need the minimal developer system (standard tools such as sed/awk+autotools+gcc) however each time something is not working (for example currently when I try to run autotools m4 goes into some error loop on AC_INIT). I know they stopped providing installer 'for easy update of components' and they are working on something but maybe there is something unofficial.

    Read the article

  • the problem of "cvEigenVV"

    - by gg-anny
    Hi!When I compile the program,VC2005 always tell :"error C2198: 'cvEigenVV' : too few arguments for call". Part of the code below: void draw_oxfd_feature( IplImage* img, struct feature* feat, CvScalar color ) { double m[4] = { feat-a, feat-b, feat-b, feat-c }; double v[4] = { 0 }; double e[2] = { 0 }; CvMat M; CvMat V; CvMat E; double alpha, l1, l2; /* compute axes and orientation of ellipse surrounding affine region */ cvInitMatHeader( &M, 2, 2, CV_64FC1, m, CV_AUTOSTEP ); cvInitMatHeader( &V, 2, 2, CV_64FC1, v, CV_AUTOSTEP ); cvInitMatHeader( &E, 2, 1, CV_64FC1, e, CV_AUTOSTEP ); cvEigenVV( &M, &V, &E, DBL_EPSILON ); l1 = 1 / sqrt( e[1] ); l2 = 1 / sqrt( e[0] ); alpha = -atan2( v[1], v[0] ); alpha *= 180 / CV_PI; cvEllipse( img, cvPoint( feat-x, feat-y ), cvSize( l2, l1 ), alpha, 0, 360, CV_RGB(0,0,0), 3, 8, 0 ); cvEllipse( img, cvPoint( feat-x, feat-y ), cvSize( l2, l1 ), alpha, 0, 360, color, 1, 8, 0 ); cvLine( img, cvPoint( feat-x+2, feat-y ), cvPoint( feat-x-2, feat-y ), color, 1, 8, 0 ); cvLine( img, cvPoint( feat-x, feat-y+2 ), cvPoint( feat-x, feat-y-2 ), color, 1, 8, 0 ); // cvCircle(img,cvPoint(cvRound( feat-x ),cvRound( feat-y )),2, color, CV_FILLED, 8, 0); cvCircle(img,cvPoint( cvRound( feat-x ), cvRound( feat-y )), 2,CV_RGB(0,255,0), CV_FILLED, 8, 0 ); } How to solve the problem?Thank you!

    Read the article

  • Reading and parsing email from Gmail using C#, C++ or Python

    - by jpnavarini
    I have to do a Windows application that from times to times access a Gmail account and checks if there is a new email. In case there is, it must read the email body and subject (a simple text email, without images or attachments). Please, do not use paid libs, and in case of any other libs used, give the download path. And I need the email body and subject only. So if the long and complex message that comes from Gmail could be parsed and only two strings containing the subject and the body, it would be perfect. Finally, I only have to get the new messages arrived since the last execution. So the read messages could be marked as "read" and only the new ones (marked as "new") are considered. The code can be written in Python or C++, but I prefer it in C#. Thank you for the help.

    Read the article

  • how to learn a library/framework structure?

    - by fayer
    a lot of people are contributing to open source libraries/frameworks. i wonder how these people learn the structure so that they can contribute? lets take doctrine and symfony as an example. is there a blueprint over these frameworks to give the developers an insight of the structure? or do they just download it and study the code? how does it work? please you contributors, share your learning strategies! thanks

    Read the article

  • Change a select list display value upon selecting description

    - by eli
    Hello, I would like a select list that does the following: When the select list is open, display the list of descriptions. When the user selects an item, the select list will close an only the value will be displayed. The reason for this is to conserve space as the values will be much shorter. I'm hoping that there's an answer in jQuery. Thanks.

    Read the article

  • What does this rake db:seed error mean?

    - by Kenji Kina
    I've been trying to solve this problem for a couple of hours but I can't seem to understand what's going on. I'm using Rails 3 beta, and want to seed some data to the database. However, when I try to seed some values through db:seed, I get this error: rake aborted! Attribute(#81402440) expected, got Array(#69024170) The seeds.rb is: DataType.delete_all DataType.create( :name => 'String' ) And I got these classes: class DataType < ActiveRecord::Base has_many :attributes end class Attribute < ActiveRecord::Base belongs_to :data_types end While the migration definition for DataType is merely: class CreateDataTypes < ActiveRecord::Migration def self.up create_table :data_types do |t| t.string :name t.timestamps end end def self.down drop_table :data_types end end Can anyone tell me what I'm doing wrong?

    Read the article

  • Is there a free painting tool for the mac?

    - by Another Registered User
    What I need is pretty simple: Copy & Paste image regions (parts) in/from an big image Compose an big image out of small ones Draw lines, maybe even arrows Ability to move images around after pasting them in, and to select them again to move them again Save the final image I have photos of people and want to make a big image that shows who is related to who by connecting these photos with arrows or lines. Must not look absolutely great. I need that only a few times so I look for freeware / open source...

    Read the article

  • Can't get multiple panel plots with chartSeries function from quantod package in R

    - by Milktrader
    Jeff Ryan's quantmod package is an excellent contribution to the R finance world. I like to use chartSeries() function, but when I try to get it to display multiple panes simultaneously, it doesn't work. par(mfrow=c(2,2)) chartSeries (SPX) chartSeries (SPX, subset="2010") chartSeries (NDX) chartSeries (NDX, subset="2010") would normally return a four-panel graphic as it does with the plot() function but in the chartSeries example it runs through all instances one at a time without creating a single four-panel graphic.

    Read the article

  • Intializing dictionary in c# 3.0

    - by Casey
    I'm having trouble with the following collections initalization: private Dictionary<string, string> mydictionary = new Dictionary<string, string>() { {"key", "value"} , {"key2", "value2"} , {"key3", "value3"} }; I keep getting various compiler errors about the syntax. From what I have googled this should be perfectly valid C# 3.0 code. The first error that pops up is: Error 102 ; expecte What am I doing wrong?

    Read the article

  • wx read image from clipboard

    - by Moayyad Yaghi
    hello how can i read image from clipboard ? i was only able to raed text using wx.clipboard. but not images is it possible to read images with wx.clipboard? or there is another way? i use python2.5 and windows vita 64 bit thanks in advance

    Read the article

  • Difference b/w putting condition in JOIN clause versus WHERE clause

    - by user244953
    Suppose I have 3 tables. Sales Rep Rep Code First Name Last Name Phone Email Sales Team Orders Order Number Rep Code Customer Number Order Date Order Status Customer Customer Number Name Address Phone Number I want to get a detailed report of Sales for 2010. I would be doing a join. I am interested in knowing which of the following is more efficient and why ? SELECT O.OrderNum, R.Name, C.Name FROM Order O INNER JOIN Rep R ON O.RepCode = R.RepCode INNER JOIN Customer C ON O.CustomerNumber = C.CustomerNumber WHERE O.OrderDate >= '01/01/2010' OR SELECT O.OrderNum, R.Name, C.Name FROM Order O INNER JOIN Rep R ON (O.RepCode = R.RepCode AND O.OrderDate >= '01/01/2010') INNER JOIN Customer C ON O.CustomerNumber = C.CustomerNumber

    Read the article

  • Who does non-decimal bignums with floating radix point?

    - by boost
    Nice as the Tcl libraries math::bignum and math::bigfloat are, the middle ground between the two needs to be addressed. Namely, bignums which are in different radices and have a radix point. At present math::bignum only handles integers (afaict) and math::bigfloat won't let you specify different radices to math::bigfloat::fromstr (ditto). Does anyone know of a library, for any of the major scripting languages (e.g. Tcl, Perl, Python, Ruby, Lua) or less major ones (newLISP for example), which implements bignums in different radices with handling for radix point?

    Read the article

  • Silverlight Verticle Slide Panel

    - by Grant Archibald
    Can anyone recommend a good Silverlight 2.0 slide panel that takes an unknown number of user controls as childen and allows the user to scroll up and down through the child list. Similar to http://www.thejamesbondmovies.com/ but vertical and not just limited to images.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >