Daily Archives

Articles indexed Monday April 5 2010

Page 19/106 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • width and height of Font

    - by shubha
    How to get Width and Height of a specified number of characters ,font Size , font type and font style. ex : font size = 14 font type = "Times New Roman" font style = "Regular" No of Characters = 50 What is the width and height ?

    Read the article

  • How to validate Login Details using Google apps API ?

    - by Pari
    Hi, I am using below code to to create Contact Service and to Validate login Details: ContactsService obj_ContactService = new ContactsService(""); obj_ContactService.setUserCredentials(userEmail, password); But even if user enters invalid detail above code does not throw any exception. User get verified only when i call "Insert" query after adding whole contact details. But in my application i want to notify user immediately after user enters login details. Thanx

    Read the article

  • Software Evaluation license - How safe it is?

    - by Manav Sharma
    almost all the software companies across the globe offer an evaluation version for download. Often the terms and conditions are so many that it's not feasible to go through them. we usually skim through the pages to get to the download link. I was wondering how safe is that? I recently downloaded Rational PurifyPlus for evaluation and I expect that it would cease to function beyond the evaluation period. Are there any changes that the software would quietly move beyond the evaluation period without letting me know thus making me liable? Thanks

    Read the article

  • How can I properly handle 404s in ASP.NET MVC?

    - by Brian
    I am just getting started on ASP.NET MVC so bear with me. I've searched around this site and various others and have seen a few implementations of this. EDIT: I forgot to mention I am using RC2 Using URL Routing: routes.MapRoute( "Error", "{*url}", new { controller = "Errors", action = "NotFound" } //404s ); The above seems to take care of requests like this (assuming default route tables setup by initial MVC project): "/blah/blah/blah/blah" Overriding HandleUnknownAction() in the controller itself: //404s - handle here (bad action requested protected override void HandleUnknownAction(string actionName) { ViewData["actionName"] = actionName; View("NotFound").ExecuteResult(this.ControllerContext); } However the previous strategies do not handle a request to a Bad/Unknown controller. For example, I do not have a "/IDoNotExist", if I request this I get the generic 404 page from the web server and not my 404 if I use routing + override. So finally, my question is: Is there any way to catch this type of request using a route or something else in the MVC framework itself? OR should I just default to using Web.Config customErrors as my 404 handler and forget all this? I assume if I go with customErrors I'll have to store the generic 404 page outside of /Views due to the Web.Config restrictions on direct access. Anyway any best practices or guidance is appreciated.

    Read the article

  • How do you pull the URL for an ASP.NET web reference from a configuration file in Visual Studio 2008

    - by Ian Robinson
    I have a web reference for our report server embedded in our application. The server that the reports live on could change though, and I'd like to be able to change it "on the fly" if necessary. I know I've done this before, but can't seem to remember how. Thanks for your help. update - I've manually driven around this for the time being. It's not a big deal to set the URL in the code, but I'd like to figure out what the "proper" way of doing this in VS 2008 is. Could anyone provide any further insights? Thanks!

    Read the article

  • sql create view in one to many relation

    - by new to sql
    i want to create a view in a one-to-many relatiom. here is my relations: (a -* b) and (a -* c). i want to create a view to have this data : a1 - (all b's related to a1 + all c's relted to a1) i don't wnat sth like (a1 ,b1,c1 - a1,b1,c2 ,...) how can i create this view ?

    Read the article

  • do i need a dns server?

    - by ajsie
    i have set up a website (lamp) in a vps from a hosting company. im wondering, in what circumstances would i want to set up a dns server on my vps? cause from what i have learned basically a dns just converts domain names into ip addresses. and at the moment my domain provider is doing this in their dns. so in what situations do i benefit from setting up an own dns server?

    Read the article

  • Update webreference gives troubles with different versions of dll

    - by Natrium
    In my application, I use some dll, let's say library.dll, version 1.0 In my webservice, I also use library.dll, but version 2.0 When I do an update of the webreference, the classes inside of the dll are also generated in the webreference. And this gives troubles because in my application, the classes that are defined in the dll now are also available in the reference and there is a mismatch. How can I solve this? I need to be able to tell the webservice to ignore the dll-code when updating the webreference in the one or the other way. I use Visual Studio 2008.

    Read the article

  • Problem in loading Ifrmae in FireFox!

    - by user309029
    Hello all, I'm trying to load an aspx page using Iframe in VB.net. I'm trying to do it(setting the source of Iframe) with the help of Ext(JavaScript). aspx code: &lt div id="container" &gt &lt iframe id="pane" name="pane" src="Empty.aspx" frameborder="0" &gt &lt /iframe &gt &lt /div &gt Javascript code: Pane = function() { var pane; return { init: function() { if (!document.body) { return; } pane = Ext.get('pane'); if ( something ) { this.load(); } else { this.navigateTo('Page.aspx?id=' + a.ID); } }, load: function() { pane.dom.src = 'HTTPURL'; }, navigateTo: function(url) { var agt = navigator.userAgent.toLowerCase(); if (agt.indexOf("firefox") != -1) { document.getElementById('pane').src = url; } else { pane.dom.src = url; } } }; } (); This works fine with IE and Ifrma gets loaded wuth page.aspx every time the parent page is requested. But with FireFox it doesn't. With FireFox the src attribute remains "Empty.aspx" when the page is loaded but when i refresh the page i.e. in post back event the scr attribute changes to "page.aspx?id=a.id" and iframe gets loaded properly. Has anyone faced such kind of problem before? and knows the solution please help me, it's killing me big. Thanks in Advance. Maddy.

    Read the article

  • Need help with a possible memory management problem(leak) regarding NSMutableArray

    - by user309030
    Hi, I'm a beginner level programmer trying to make a game app for the iphone and I've encountered a possible issue with the memory management (exc_bad_access) of my program so far. I've searched and read dozens of articles regarding memory management (including apple's docs) but I still can't figure out what exactly is wrong with my codes. So I would really appreciate it if someone can help clear up the mess I made for myself. - (void)viewDidLoad { [super viewDidLoad]; self.gameState = gameStatePaused; fencePoleArray = [[NSMutableArray alloc] init]; fencePoleImageArray = [[NSMutableArray alloc] init]; fenceImageArray = [[NSMutableArray alloc] init]; mainField = CGRectMake(10, 35, 310, 340); .......... [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(gameLoop) userInfo:nil repeats:YES]; } So basically, the player touches the screen to set up the fences/poles -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if(.......) { ....... } else { UITouch *touch = [[event allTouches] anyObject]; currentTapLoc = [touch locationInView:touch.view]; NSLog(@"%i, %i", (int)currentTapLoc.x, (int)currentTapLoc.y); if(CGRectContainsPoint(mainField, currentTapLoc)) { if([self checkFence]) { onFencePole++; //this 3 set functions adds their respective objects into the 3 NSMutableArrays using addObject: [self setFencePole]; [self setFenceImage]; [self setFencePoleImage]; ....... } } else { ....... } } } } The setFence function (setFenceImage and setFencePoleImage is similar to this) -(void)setFencePole { Fence *fencePole; if (!elecFence) { fencePole = [[Fence alloc] initFence:onFencePole fenceType:1 fencePos:currentTapLoc]; } else { fencePole = [[Fence alloc] initFence:onFencePole fenceType:2 fencePos:currentTapLoc]; } [fencePoleArray addObject:fencePole]; [fencePole release]; and whenever I press a button in the game, endOpenState is called to clear away all the extra images(fence/poles) on the screen and also to remove all existing objects in the 3 NSMutableArray -(void)endOpenState { ........ int xMax = [fencePoleArray count]; int yMax = [fenceImageArray count]; for (int x = 0; x < xMax; x++) { [[fencePoleImageArray objectAtIndex:x] removeFromSuperview]; } for (int y = 0; y < yMax; y++) { [[fenceImageArray objectAtIndex:y] removeFromSuperview]; } [fencePoleArray removeAllObjects]; [fencePoleImageArray removeAllObjects]; [fenceImageArray removeAllObjects]; ........ } The crash happens here at the checkFence function. -(BOOL)checkFence { if (onFencePole == 0) { return YES; } else if (onFencePole >= 1 && onFencePole < currentMaxFencePole - 1) { CGPoint tempPoint1 = currentTapLoc; CGPoint tempPoint2 = [[fencePoleArray objectAtIndex:onFencePole-1] returnPos]; // the crash happens at this line if ([self checkDistance:tempPoint1 point2:tempPoint2]) { return YES; } else { return NO; } } else if (onFencePole == currentMaxFencePole - 1) { ...... } else { return NO; } } What I'm thinking of is that fencePoleArray got messed up when I used [fencePoleArray removeAllObjects] because it doesn't crash when I comment it out. It would really be great if someone can explain to me what went wrong. And thanks in advance.

    Read the article

  • Reusing datasource

    - by nubby
    I'm tying to use one database call and reuse that data for other controls - without having to do another call. Scenario: I call the books table which returns all the authors and titles. I create an author's list control called list1 to displays all the titles by Shakespeare and a list2 to display titles by Charles Dickens. Void Bindme() { string commandText = "Select * from books"; SqlCommand mycommand = new SqlCommand(commandText, datasource1); datasource1.Open(); SqlDataReader myReader1 = mycommand.ExecuteReader(); list1.DataSource = myReader1; list1.DataBind(); list2.DataSource = myReader1; list2.DataBind(); datasource1.Close(); } In my example only the first bind to the source, list1, gets data. Any ideas?

    Read the article

  • WCF - WebReferences not working

    - by JMSA
    At the client end, I have generated a Proxy using SvcUtil.exe and it is working fine. Then I have added a WebReference to the client assembly and calling the same method. But it is not working. My program is running in console mode and the method is suppose to return a string. It is not returning the string. I just see a blank console window. No exception is thrown. And after setting a debug point on the method call I see that, program is halted on the method call for ever. What should I look for to solve the problem? I am using VS2005. And adding the webReference by right-clicking the client project and then clicking "Add Web Reference" pop-up menu.

    Read the article

  • How to add CSS classes to Zend_Form_Element_Select option

    - by Jah Selassie
    Hi, I'm trying to add a CSS class to a Zend_Form_Element_Select option, but I just can't find a way to do it. The desired output would be something like this: <select name="hey" id="hey"> <option value="value1" style="parent">label1</option> <option value="value2" style="sibling">sublabel1</option> <option value="value3" style="sibling">sublabel2</option> <option value="value4" style="parent">label2</option> <option value="value5" style="sibling">sublabel3</option> <option value="value6" style="sibling">sublabel4</option> </select> But I'm getting this: <select name="hey" id="hey"> <option value="value1">label1</option> <option value="value2">sublabel1</option> <option value="value3">sublabel2</option> <option value="value4">label2</option> <option value="value5">sublabel3</option> <option value="value6">sublabel4</option> </select> I can't seem to pass a CSS class attribute to any of the options in the select element although I can style the select element itselft. My code: $sel = new Zend_Form_Element_Select('hey'); $sel->setRequired(true)->setLabel('Select an Option:'); $sel->addMultiOption('value1', 'label1', array('class' => 'parent')) ->addMultiOption('value2', 'sublabel1', array('class' => 'sibling')) (etc...); After researching a bit I found out that Element_Select doesn't have a method for adding CSS styles to the options in the select box, only for the select itself. So, how can I add them? Should I extend the form_element_select? Or would a custom decorator suffice? Can anyone give me a hint? I'm baffled with this. Thanks in advance!

    Read the article

  • How to associate static entity instances in a Session without database retrieval

    - by Michael Hedgpeth
    I have a simple Result class that used to be an Enum but has evolved into being its own class with its own table. public class Result { public static readonly Result Passed = new Result(StatusType.Passed) { Id = [Predefined] }; public static readonly Result NotRun = new Result(StatusType.NotRun) { Id = [Predefined] }; public static readonly Result Running = new Result(StatusType.Running) { Id = [Predefined] }; } Each of these predefined values has a row in the database at their predefined Guid Id. There is then a failed result that has an instance per failure: public class FailedResult : Result { public FailedResult(string description) : base(StatusType.Failed) { . . . } } I then have an entity that has a Result: public class Task { public Result Result { get; set; } } When I save a Task, if the Result is a predefined one, I want NHibernate to know that it doesn't need to save that to the database, nor does it need to fetch it from the database; I just want it to save by Id. The way I get around this is when I am setting up the session, I call a method to load the static entities: protected override void OnSessionOpened(ISession session) { LockStaticResults(session, Result.Passed, Result.NotRun, Result.Running); } private static void LockStaticResults(ISession session, params Result[] results) { foreach (var result in results) { session.Load(result, result.Id); } } The problem with the session.Load method call is it appears to be fetching to the database (something I don't want to do). How could I make this so it does not fetch the database, but trusts that my static (immutable) Result instances are both up to date and a part of the session?

    Read the article

  • shared hacker houses in europe

    - by Mantas
    Hey, I'm a freelance web developer. I'm borred of my hometown, so I want to hit the road. Do you know any shared hacker houses in Europe? Do you have any ideas what is the best way to look for a shared flat? France, Spain, Holland, Italy... I'm interested in virtually any country :) P.S. I speak English and Lithuanian only, so it's hard to look up shared flat in local languages...

    Read the article

  • How to handle SalesForce WSDL files for sandbox and production sites in ASP.Net?

    - by Traveling Tech Guy
    I need to authenticate users and get info about them from an ASP.Net application. Since I have 2 sites (sandbox, production) and 2 org IDs - I needed to generate 2 SalesForce WSDL files. I diffed the 2 files (each about 600kb in size) and while they are 95% the same, there are enough differences strewn all over the place - enough for me to need to use them both. I added both as web references to my solution, and here's where my problem starts.Obviously, I cannot use both references in the same file, as they contain the same classes/functions. I had to write a quick-and-dirty solution over the weekend, so I just created 2 classes - each using a different web reference - but otherwise the exact functionality, and I use the appropriate one, based on the URL the user is coming from. This works well, but strikes me as a bad (read: quick-and-dirty) solution. My question: is there any way to do one or more of the following: change the web reference on the fly? use both web references in the same file, but put one in a different namespace? find a better solution to the whole situation? I nd up with a huge XmlSerializer.dll (3mb!) - probably due to using both huge WSDL files. Thanks for your time.

    Read the article

  • Jquery toggle event is messing with checkbox value

    - by John McCollum
    Hi all, I'm using Jquery's toggle event to do some stuff when a user clicks a checkbox, like this: $('input#myId').toggle( function(){ //do stuff }, function(){ //do other stuff } ); The problem is that the checkbox isn't being ticked when I click on the checkbox. (All the stuff I've put into the toggle event is working properly.) I've tried the following: $('input#myId').attr('checked', 'checked'); and $(this).attr('checked', 'checked'); and even simply return true; But nothing is working. Can anyone tell me where I'm going wrong? Edit - thanks to all who replied. Dreas' answer very nearly worked for me, except for the part that checked the attribute. This works perfectly (although it's a bit hacky) $('input#myInput').change(function () { if(!$(this).hasClass("checked")) { //do stuff if the checkbox isn't checked $(this).addClass("checked"); return; } //do stuff if the checkbox isn't checked $(this).removeClass('checked'); }); Thanks again to all who replied.

    Read the article

  • Serializability of enum-like class

    - by callisto
    I need to access an enum through a webservice. As a webservice allocates 0 based integers to an enumeration (ignoring preset values in enum definition), I built the following: public class StatusType { public StatusVal Pending { get { return new StatusVal( 1, "Pending"); } } public StatusVal Authorised { get { return new StatusVal(2, "Authorised"); } } public StatusVal Rejected { get { return new StatusVal(3, "Rejected"); } } public StatusVal Sent { get { return new StatusVal(4, "Sent"); } } public StatusVal InActive { get { return new StatusVal(5, "InActive"); } } public List<StatusVal> StatusList() { List<StatusVal> returnVal = new List<StatusVal>(); StatusType sv = new StatusType(); returnVal.Add(sv.Pending); returnVal.Add(sv.Authorised); returnVal.Add(sv.Rejected); returnVal.Add(sv.Sent); returnVal.Add(sv.InActive); return returnVal; } } public class StatusVal { public StatusVal(int a, string b) { this.ID = a; this.Name = b; } public int ID { get; set; } public string Name { get; set; } } I then get the list of StatusVal with the following webmethod: [WebMethod] public List<ATBusiness.StatusVal> GetStatus() { ATBusiness.StatusType a = new ATBusiness.StatusType(); return a.StatusList(); } I cannot however use this webmethod as referring it, I get the error: StatusVal cannot be serialized because it does not have a parameterless constructor. I don't quite understand: should I pass params into the StatusValue type defined as the WebMethod's return Type? I need this to return a list of StatusVals as per the StatusList() method.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >