Daily Archives

Articles indexed Thursday May 20 2010

Page 22/120 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • improve my jquery validation plugin code

    - by Jared
    Hi All Just hoping soemone can help me to write better code than I can come up with on my own. I am using the jquery validation plugin. I have some fields that are mandatory ONLY if certain options are chosen. The below code works fine. But the thing is, is that that my list of 'OR's is much longer than I've put here. and it needs to be applied not just to 'directorsName' but a whole long list of inputs, selects etc. My question is.. how can I wrap up the code contained inside the RETURN? (so I dont have to keep repeating my 'OR's. I'm guessign I need a function but I'm unsure of the syntax) $("#myForm").validate({ rules: { directorsName : { required: function(element) { return ( $('#account_for').val() == "Joint" || $('#directors_number').val() == "2" || $('#directors_number').val() == "3" ); } } } }); Thanks in advance

    Read the article

  • Deploying web service

    - by baron
    I am trying to build a webservice that manipulates http requests POST and GET. Here is a sample: public class CodebookHttpHandler: IHttpHandler { public void ProcessRequest(HttpContext context) { if (context.Request.HttpMethod == "POST") { //DoHttpPostLogic(); } else if (context.Request.HttpMethod == "GET") { //DoHttpGetLogic(); } } ... public void DoHttpPostLogic() { ... } public void DoHttpGetLogic() { ... } I need to deploy this but I am struggling how to start. Most online references show making a website, but really, all I want to do is respond when an HttpPost is sent. I don't know what to put in the website, just want that code to run. Some links i've tried so far: http://my.execpc.com/~gopalan/dotnet/webservices/webservice_server.html http://www.beansoftware.com/asp.net-tutorials/deploy-asp.net.aspx http://msdn.microsoft.com/en-us/library/6x71sze4%28VS.80%29.aspx http://www.c-sharpcorner.com/UploadFile/rajaduraip/SimplestwaytoCreateNDeployWebServices12232005054219AM/SimplestwaytoCreateNDeployWebServices.aspx

    Read the article

  • Blackberry coading

    - by lalita
    Hello friends, I am using blackberry using java eclips I have a lengthy of code in single class.so I need to divide code into different classess(need to implement methode in diffferent classes), how to write code in diff classes and how to access diiferent classes methodes in a single class. Can you please give me suggesion.

    Read the article

  • How to use startMethodTracing APIs on Android?

    - by Rajorshi
    I have recently started working on an app which has both Java and native components. I am trying to generate trace information for both components using Debug.startMethodTracing("myapp") and Debug.startNativeTracing() alternately. However, both are behaving unexpectedly. When I use Debug.startMethodTracing("myapp"), I can see a file /sdcard/myapp.trace being created but it is always empty no matter how long I run my app. When I use Debug.startNativeTracing() and start the emulator with the -trace <tracename> switch, I see a message saying "Trace started", but when I try to run my app, the emulator crashes. Am I missing something obvious here? How do I debug this problem?

    Read the article

  • In MVC view page javascript file url not resolving

    - by Ashwani K
    Hello All: I have one MVC view page in which I show different links and I am using ThickBox to show a different page when ever one of these links is clicked. In these pages, I am using jQuery functions to do some changes, but I am not able to resolve the jquery file path on the view pages. I need to give absolute path something like "http://test.com/js/jquery.js". But is there any way to make it relative? I also tried getting the host url and using <%=% and <%# % but none is working. Any help? Thanks Ashwani

    Read the article

  • Cannot redirect after HTTP headers have been sent.

    - by Anilkumar
    When I try to redirect to another page through Response.Redirect(URL) am getting the following error:- System.Web.HttpException: Cannot redirect after HTTP headers have been sent. I wrote one Response.Write("Sometext"); and Response.Flush() before calling redirect Method. In this case how do we use Response.Redirect(URL)?

    Read the article

  • SMS Library in C#

    - by Prasad
    I need to develop an application that sends SMS to the users that are interested to get the updates about the website. I am looking for Library in C# which is useful to integrate with my application. The Library can be GSM Modem dependent or free service which i can make use of it. Please can anyone suggest the library or SMS gateway which can be integrated with C# application.

    Read the article

  • Dark color scheme for Eclipse?

    - by Bartosz Radaczynski
    Is Eclipse at all themeable? I would like to install a dark color scheme for it, since I much prefer white text on dark background than the other way around. Edit: so apparently there is NO easy way to do it. Shame, I really prefer Eclipse to NetBeans, but I cannot stand the white background (and NetBeans does support themes).

    Read the article

  • Clip a wpf Popup at bounds of a main window

    - by BrandonS
    From what I understand, the popup exists within it's own visual tree. However, I've noticed a few properties, Clip and ClipToBounds. What I am wanting to do is Visually clip a popup at the right and bottom edges of a window regardless of the fact that the popup is independent of the bounds of the window. I'm not using XAML, but if somebody knows how to do it in XAML, then that's fine. I can get to the main window using System.Windows.Application.Current.MainWindow. Is it possible from this to get a value that I can use to clip the popup? I'm assuming that if there is a value that I can use, then I would be able to bind the clipping of the popup to that value. This is really not necessary since after the popup initially opens, if the window gets moved or resized, the popup closes. So I would really only need to clip the popup when it opens. The reason I would like to do this is because although I am using a popup, I don't want it to appear as a popup that exists outside of the window. FYI this is for a popup calendar for a custom datebox. Any ideas, as well as clarification of misconceptions that I may have, would be greatly appreciated. Thanks, Brandon

    Read the article

  • Write STDOUT & STDERR to a logfile, also write STDERR to screen

    - by Stefan Lasiewski
    I would like to run several commands, and capture all output to a logfile. I also want to print any errors to the screen (or optionally mail the output to someone). Here's an example. The following command will run three commands, and will write all output (STDOUT and STDERR) into a single logfile. { command1 && command2 && command3 ; } > logfile.log 2>&1 Here is what I want to do with the output of these commands: STDERR and STDOUT for all commands goes to a logfile, in case I need it later--- I usually won't look in here unless there are problems. Print STDERR to the screen (or optionally, pipe to /bin/mail), so that any error stands out and doesn't get ignored. It would be nice if the return codes were still usable, so that I could do some error handling. Maybe I want to send email if there was an error, like this: { command1 && command2 && command3 ; } logfile.log 2&1 || mailx -s "There was an error" [email protected] The problem I run into is that STDERR loses context during I/O redirection. A '2&1' will convert STDERR into STDOUT, and therefore I cannot view errors if I do 2 error.log Here are a couple juicier examples. Let's pretend that I am running some familiar build commands, but I don't want the entire build to stop just because of one error so I use the '--keep-going' flag. { ./configure && make --keep-going && make install ; } > build.log 2>&1 Or, here's a simple (And perhaps sloppy) build and deploy script, which will keep going in the event of an error. { ./configure && make --keep-going && make install && rsync -av --keep-going /foo devhost:/foo} > build-and-deploy.log 2>&1 I think what I want involves some sort of Bash I/O Redirection, but I can't figure this out.

    Read the article

  • How do you determine up/down latency of a web app.

    - by Brodie
    I am trying to work out how to calculate the latency of requests through a web-app (Javascript) to a .net webservice. Currently I am essentially trying to sync both client and server time, which when hitting the webservice I can look at the offset (which would accurately show the 'up' latency. The problem is - when you sync the time's, you have to factor in latency for that also. So currently I am timeing the sync request (round trip) and dividing by 2, in an attempt to get the 'up' latency...and then modify the sync accordingly. This works on the assumption that latency is symmetrical, which it isn't. Does anyone know a procedure that would be able to determine specifically the up/down latency of a JS http request to a .net service? If it needs to involve multiple handshakes thats fine, what ever is as accurate as possible. Thanks!!

    Read the article

  • Android SecurityException with entry in Manifest

    - by Taranfx
    I'm doing a Gdata Blogger from Android device: GoogleLoginServiceHelper.getCredentials(this, REQUEST_CODE_LOGIN, null, GoogleLoginServiceConstants.REQUIRE_GOOGLE, BLOGGER_SERVICE, true); I have this permissions in my manifest: But I got a SecurityException: ERROR/AndroidRuntime(20985): java.lang.SecurityException: caller pid 20985 uid 10044 lacks com.google.android.googleapps.permission.GOOGLE_AUTH.BLOGGER What could be wrong?

    Read the article

  • iTextSharp Set content of ListBox?

    - by Petoj
    Well im trying to set the content of a ListBox but even if it returns true nothing happens.. PdfStamper stamper = new PdfStamper(reader, context.Response.OutputStream); AcroFields fields = stamper.AcroFields; bool result = fields.SetListOption("listbox", data.ToArray(), data.ToArray()); So what am i doing wrong the data never gets to the pdf?

    Read the article

  • Rails app is prepending tunnlr web address when using link helpers

    - by mathee
    I set up facebooker to tunnel my Ruby on Rails application. The issue is that I would like to test locally. That is, I don't want to have to start a tunnel every time I want to see my changes. Right now, when I start the application using ruby script/server (not calling rake facebooker:tunnel:background_start beforehand), links created by helpers (e.g., stylesheet_link_tag, javascript_include_tag, image_tag) are prepended with my tunnlr address: http://web1.tunnlr.com:myPort/. (For example, a CSS link looks like this in the page source: http://web1.tunnlr.com:myPort//stylesheets/appName.css?1234567890.) I don't want that functionality; I can't see my CSS or JavaScript changes without starting the tunnel first. I want the links to be relative to what's running on my machine, not the tunnel. So, stylesheet_link_tag should produce /stylesheets/appName.css?1234567890. Does anyone know why it's doing that in the first place and how to fix it? Thanks in advance.

    Read the article

  • Problem using DataGridView Control of VB.NET 2008

    - by Tareq
    Hi, I am using VB.NET 2008 based on Framework 3.5 I use a datagridview control on a form and the form's load event as follows: Private Sub frmServiceSettings_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load With dgvFinishedProduct Dim myCombo As New DataGridViewComboBoxColumn ... I generate the combo here from the result of my database .Columns.Add(myCombo) End With End Sub Now when i want to get the data that is set in this column, there is no problem. But if I want to set the data programmatically, there arises problem. How can I solve the problem? If you want more info, please let me know.

    Read the article

  • how to create embedded browser in Netbeans ?

    - by fwfwfw
    The user needs to browse sites through the Java program (not netbeans IDE), it should behave exactly like FireFox browser or IE, any suggestions ? I need to be able to access the DOM so I can manipulate DOM elements. Also, is there something equivalent to Perl's CPAN but for Java ?

    Read the article

  • Using DrawString to draw text with no border

    - by griegs
    I have this code; public static Image AddText(this Image image, ImageText text) { Graphics surface = Graphics.FromImage(image); Font font = new Font("Tahoma", 10); System.Drawing.SolidBrush brush = new SolidBrush(Color.Red); surface.DrawString(text.Text, font, brush, new PointF { X = 30, Y = 10 }); surface.Dispose(); return image; } However, when the text is drawn onto my image it's red with a black border or shadowing. How can I write text to an image without any border or shadow?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >