Search Results

Search found 41 results on 2 pages for 'budda'.

Page 2/2 | < Previous Page | 1 2 

  • Sorting Objects in NSArray

    - by Sam Budda
    I have an NSArray with 3 objects in it. Each object is made up of 5 values. How can I sort by Date with in the objects? result: ( gg, "2012-10-28 01:34:00 +0000", "Church Bells", "pin_red", 1 )( iu, "2008-09-22 17:32:00 +0000", "Birthday Song", "pin_red", 1 )( "my birthday woo hoo", "2012-09-04 19:27:00 +0000", "Birthday Song", "pin_blue", 1 ) The results I am looking for - Sorted Array should look like this. ( iu, "2008-09-22 17:32:00 +0000", "Birthday Song", "pin_red", 1 ) ( "my birthday woo hoo", "2012-09-04 19:27:00 +0000", "Birthday Song", "pin_blue", 1 ) ( gg, "2012-10-28 01:34:00 +0000", "Church Bells", "pin_red", 1 ) I am getting this array from my nsdictionary object. dictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:stringsPlistPath]; stringsMutableArray = [[NSMutableArray alloc] initWithObjects:nil]; for (id key in dictionary) { [stringsMutableArray addObject:[dictionary objectForKey:key]]; }

    Read the article

  • How to avoid exceptions catches copy-paste in .NET

    - by Budda
    Working with .NET framework I have a service with a set of methods that can generates several types of exceptions: MyException2, MyExc1, Exception... To provide proper work for all methods, each of them contains following sections: void Method1(...) { try { ... required functionality } catch(MyException2 exc) { ... process exception of MyException2 type } catch(MyExc1 exc) { ... process exception of MyExc1 type } catch(Exception exc) { ... process exception of Exception type } ... process and return result if necessary } It is very boring to have exactly same stuff in EACH service method with exactly same exceptions processing functionality... Is there any possibility to "group" these catch-sections and use only one line (something similar to C++ macros)? Probably something new in .NET 4.0 is related to this topic? Thanks. P.S. Any thoughts are welcome.

    Read the article

  • CommandManager "cannot resolve symbol"

    - by Budda
    After adding "RelayCommand" class (that uses CommandManager class) into my Silverlight App I've got an error: The name 'CommandManager' does not exist in the current context This class is a member of System.Windows.Input namespace that is in PresentationCore.dll assembly. The problem is that I can't add this dll into my app... I am having a strange assumption: this class (CommmandManager) can't be used in the Silverlight. Am I right? How can I implement MVVM-pattern (http://msdn.microsoft.com/en-us/magazine/dd419663.aspx)? Thanks.

    Read the article

  • Linq2Sql: query - subquery optimisation

    - by Budda
    I have the following query: IList<InfrStadium> stadiums = (from sector in DbContext.sectors where sector.Type=typeValue select new InfrStadium(sector.TeamId) ).ToList(); and InfrStadium class constructor: private InfrStadium(int teamId) { IList<Sector> teamSectors = (from sector in DbContext.sectors where sector.TeamId==teamId select sector) .ToList<>(); ... work with data } Current implementation perform 1+n queries, where n - number of records fetched the 1st time. I want to optimize that. And another one I would love to do using 'group' operator in way like this: IList<InfrStadium> stadiums = (from sector in DbContext.sectors group sector by sector.TeamId into team_sectors select new InfrStadium(team_sectors.Key, team_sectors) ).ToList(); with appropriate constructor: private InfrStadium(int iTeamId, IEnumerable<InfrStadiumSector> eSectors) { IList<Sector> teamSectors = eSectors.ToList(); ... work with data } But attempt to launch query causes the following error: Expression of type 'System.Int32' cannot be used for constructor parameter of type 'System.Collections.Generic.IEnumerable`1[InfrStadiumSector]' Question 1: Could you please explain, what is wrong here, I don't understand why 'team_sectors' is applied as 'System.Int32'? I've tried to change query a little (replace IEnumerable with IQueryeable): IList<InfrStadium> stadiums = (from sector in DbContext.sectors group sector by sector.TeamId into team_sectors select new InfrStadium(team_sectors.Key, team_sectors.AsQueryable()) ).ToList(); with appropriate constructor: private InfrStadium(int iTeamId, IQueryeable<InfrStadiumSector> eSectors) { IList<Sector> teamSectors = eSectors.ToList(); ... work with data } In this case I've received another but similar error: Expression of type 'System.Int32' cannot be used for parameter of type 'System.Collections.Generic.IEnumerable1[InfrStadiumSector]' of method 'System.Linq.IQueryable1[InfrStadiumSector] AsQueryableInfrStadiumSector' Question 2: Actually, the same question: can't understand at all what is going on here... P.S. I have another to optimize query idea (describe here: Linq2Sql: query optimisation) but I would love to find a solution with 1 request to DB).

    Read the article

  • Received memory warning on setimage

    - by Sam Budda
    This problem has completely stumped me. This is for iOS 5.0 with Xcode 4.2 What's going on is that in my app I let user select images from their photo album and I save those images to apps document directory. Pretty straight forward. What I do then is that in one of the viewController.m files I create multiple UIImageViews and I then set the image for the image view from one of the picture that user selected from apps dir. The problem is that after a certain number of UIImage sets I receive a "Received memory warning". It usually happens when there are 10 pictures. If lets say user selected 11 pictures then the app crashes with Error (GBC). NOTE: each of these images are at least 2.5 MB a piece. After hours of testing I finally narrowed down the problem to this line of code [button1AImgVw setImage:image]; If I comment out that code. All compiles fine and no memory errors happen. But if I don't comment out that code I receive memory errors and eventually a crash. Also note it does process the whole CreateViews IBAction but still crashes at the end. I cannot do release or dealloc since I am running this on iOS 5.0 with Xcode 4.2 Here is the code that I used. Can anyone tell me what did I do wrong? - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self CreateViews]; } -(IBAction) CreateViews { paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask ,YES); documentsPath = [paths objectAtIndex:0]; //here 15 is for testing purposes for (int i = 0; i < 15; i++) { //Lets not get bogged down here. The problem is not here UIImageView *button1AImgVw = [[UIImageView alloc] initWithFrame:CGRectMake(10*i, 10, 10, 10)]; [self.view addSubview:button1AImgVw]; NSMutableString *picStr1a = [[NSMutableString alloc] init]; NSString *dataFile1a = [[NSString alloc] init]; picStr1a = [NSMutableString stringWithFormat:@"%d.jpg", i]; dataFile1a = [documentsPath stringByAppendingPathComponent:picStr1a]; NSData *potraitImgData1a =[[NSData alloc] initWithContentsOfFile:dataFile1a]; UIImage *image = [[UIImage alloc] initWithData:potraitImgData1a]; // This is causing my app to crash if I load more than 10 images! //[button1AImgVw setImage:image]; } NSLog(@"It went to END!"); } //Error I get when 10 images are selected. App does launch and work 2012-10-07 17:12:51.483 ABC-APP[7548:707] It went to END! 2012-10-07 17:12:51.483 ABC-APP [7531:707] Received memory warning. //App crashes with this error when there are 11 images 2012-10-07 17:30:26.339 ABC-APP[7548:707] It went to END! (gdb)

    Read the article

  • Interview: Am I need to leave a hope for candidate?

    - by Budda
    Today I've interviewed a candidate who didn't answer any question. At all. After 3-4 answers (attempts to answer) for me was obvious: we won't hire him. Would you recommend me to say (definitely in polite form) something like: Sorry you don't meet our requirements? Or just to tell in another way: thank you, that are all my questions for now. Our HR department will let you know if/when we will need another interview session. Probably you see any other option. Thanks.

    Read the article

  • How to sign XML document or verify XML document signature with C++?

    - by Budda
    Subj. I need to sign/verify in native C++ (no .NET), using private key for signing, public key for verification. I saw few examples on MSDN (http://msdn.microsoft.com/en-us/library/ms761363(VS.85).aspx) that demonstrate how to sign the document with CSP (I don't know what this means). For my case I need to create a "key" from the binary data array... can somebody help me with that? Thank you in advance.

    Read the article

  • HTML+CSS: 'a' width doesn't work

    - by Budda
    I have the following code: CSS part: <style type="text/css"> .menu { width:200px; } .menu ul { list-style-image:none; list-style-type:none; } .menu li { margin:2px; } .menu A { height:25px; width:170px; background:url(./images/button-51.png); padding:2px 5px ; } .menu A:link { height:25px; width:170px; background:url(./images/button-51.png); padding:2px 5px ; } </style> HTML part: Everything work fine, but when I add 'DOCTYPE' element in the beginning of the HTML document: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> the width of 'a' element is not taken into account. Question 1: Why? Question 2: How to fix that? Thanks a lot!

    Read the article

  • ASP.NET: how can I compile in DEBUG mode?

    - by Budda
    AFAIK, usual ASP.NET web site/web application switched on into DEBUG mode when web/app-config setting "compilation" has debug="false". But I don't clearly understand how it works. Let's consider example: I have <compilation debug="true" />. I've added the following line into "Page_Load" method: System.Diagnostics.Debug.WriteLine("Page_Load"); When I launched web-site in 'debug' mode (using F5 button) It put me 'Page_Load' into output window. Everything is ok so far. When I change application compilation mode into non-debug: Will it recompile everything for 'non-debug' mode? Is this enough to go into "production" environment with this change only? I guess, it should be enough for web-site that doesn't use other project. Otherwise, I would better switch whole configuration into "Release" mode. In this case EACH project will be recompiled in "Release" mode. Am I right? Could you please point me if something is wrong here? Thanks a lot!

    Read the article

  • WCF: operations with out parameters are not supported

    - by Budda
    I've created a simple WCF service inside of WebApplication project. [ServiceContract(Namespace = "http://my.domain.com/service")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class MyService { [OperationContract] public string PublishProfile(out string enrollmentId, string registrationCode) { enrollmentId = null; return "Not supported"; } built - everything is compiled successfully After that I've tried to open service in browser, I've got the following error: Operation 'PublishProfile' in contract 'MyService' specifies an 'out' or 'ref' parameter. Operations with 'out' or 'ref' parameters are not supported Can't I use 'out' parameters? What is wrong here? Thanks

    Read the article

  • CSS+HTML: tds are overlapping

    - by Budda
    On my web-site http://vfm-elita.com (it is not in English, sorry for that) - center and right columns are overlapping, please see screenshot for details: Between left and center columns you can see a "gap" with a green background - it is expected and good. But there are no any gap between center and right columns, instead they are overlapping. Issue exists in all known browsers There are no special formatting applied to columns. They are usual 'TD' columns, the only CSS modifier is width that is "250px" for left and right columns, and for center - it is "auto". Please advise how can I correct that error. Thanks a lot!

    Read the article

  • LinQ optimization

    - by Budda
    Here is a peace of code: void MyFunc(List<MyObj> objects) { MyFunc1(objects); foreach( MyObj obj in objects.Where(obj1=>obj1.Good)) { // Do Action With Good Object } } void MyFunc1(List<MyObj> objects) { int iGoodCount = objects.Where(obj1=>obj1.Good).Count(); BeHappy(iGoodCount); // do other stuff with 'objects' collection } Here we see that collection is analyzed twice and each time the value of 'Good' property is checked for each member: 1st time when calculating count of good objects, 2nd - when iterating through all good objects. It is desirable to have that optimized, and here is a straightforward solution: before call to MyFunc1 makecreate an additional temporary collection of good objects only (goodObjects, it can be IEnumerable); get count of these objects and pass it as an additional parameter to MyFunc1; in the 'MyFunc' method iterate not through 'objects.Where(...)' but through the 'goodObjects' collection. Not too bad approach (as far as I see), but additional parameter is required to be passed. Question: is there any LinQ out-of-the-box functionality that allows any caching during 1st Where().Count(), remembering a processed collection and use it in the next iteration? Any thoughts are welcome. Thanks.

    Read the article

  • TFS: how to change custom field allowed values

    - by Budda
    I have my custom field of string type with predefined set of values: "1 - Cool", "2 - Good", "3 - Average",... Now it is necessary to remove "2 - Good" value and rename "3 - Average" into "2 - Average". I see easy solution: just delete 2 existing "2 - Good" and "3 - Average" and create the new "2 - Average". Question: Q1: What will happens with issues that contain values to be deleted? Probably, system won't accept such work item change? Q2: What is a good approach to do what I need? Thanks a lot! Any thoughts are welcome!

    Read the article

  • Can't get up with RIA demo

    - by Budda
    Based the article (http://blogs.msdn.com/brada/archive/2009/03/17/mix09-building-amazing-business-applications-with-silverlight-3.aspx) I've tried to start-up the RIA services. At the moment there are 2 blockers: 1. On the client side I don't have " Could anybody help to resolve problems? Thank you. P.S. I have VS2008, SP1, Silverlight, RIA Services installed.

    Read the article

  • MySql: Is it reasonable to use 'view' or I would better denormalize my DB?

    - by Budda
    There is 'team_sector' table with following fields: Id, team_id, sect_id, size, level It contains few records for each 'team' entity (referenced with 'team_id' field). Each record represent sector of team's stadium (totally 8 sectors). Now it is necessary to implement few searches: by overall stadium size (SUM(size)); the best quality (SUM(level)/COUNT(*)). I could create query something like this: SELECT TS.team_id, SUM(TS.size) as OverallSize, SUM(TS.Level)/COUNT(TS.Id) AS QualityLevel FROM team_sector GROUP BY team_id ORDER BY OverallSize DESC / ORDER BY QualityLevel DESC But my concern here is that calculation for each team will be done each time on query performed. It is not too big overhead (at least now), but I would like to avoid performance issues later. I see 2 options here. The 1st one is to create 2 additional fields in 'team' table (for example) and store there OverallSize and QualityLevel fields. If information if 'sector' table is changed - update those table too (probably would be good to do that with triggers, as sector table doesn't change too often). The 2nd option is to create a view that will provide required data. The 2nd option seems much easier for me, but I don't have a lot of experience/knowledge of work with views. Q1: What is the best option from your perspective here and why? Probably you could suggest other options? Q2: Can I create view in such way that it will do calculations rarely (at least once per day)? If yes - how? Q3: Is it reasonable to use triggers for such purpose (1st option). P.S. MySql 5.1 is used, overall number of teams is around 1-2 thousand, overall number of records in sector table - overall 6-8 thousand. I understand, those numbers are pretty small, but I would like to implement the best practice here.

    Read the article

  • Adventures on Enterprise Library 5.0: Who moved my cheese (namespace)

    - by Junior Mayhé
    Jesus, Krishna, Budda! I've migrated to EntLib 5.0, but classes like ISymmetricCryptoProvider are not recognized anymore. Funny to say that Data, Logging and other blocks are working compiling fine. Here's the problematic class: using System; using System.Collections.Generic; using System.Text; using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;//-->it's not working anymore using Microsoft.Practices.EnterpriseLibrary.Security.Cryptography;//-->it's not working anymore namespace MyClassLibrary.Security.EnterpriseLibrary { public sealed class Crypto { public static ISymmetricCryptoProvider MyProvider { get { //IConfigurationSource is not recognized either, neither SystemConfigurationSource IConfigurationSource cs = new SystemConfigurationSource(); SymmetricCryptoProviderFactory scpf = new SymmetricCryptoProviderFactory(cs); ISymmetricCryptoProvider p = scpf.CreateDefault(); return p; } } The references are fine on project too. I really don't know why this particular project it's causing too many trouble on VS2010! Older references were deleted, project was cleaned, rebuilt, but can't make it compile :-( The references are: Microsoft.Practices.EnterpriseLibrary.Common Microsoft.Practices.EnterpriseLibrary.Logging Microsoft.Practices.EnterpriseLibrary.Logging.Database Microsoft.Practices.EnterpriseLibrary.Security Microsoft.Practices.EnterpriseLibrary.Security.Cryptography Why some namespaces can be found while others can't?

    Read the article

< Previous Page | 1 2