Search Results

Search found 35302 results on 1413 pages for 'string literals'.

Page 286/1413 | < Previous Page | 282 283 284 285 286 287 288 289 290 291 292 293  | Next Page >

  • Calling a method on a Object says "disallows late binding"

    - by Maury Markowitz
    I have a calls called DtaDate that stores an integer "key", a string name, a string for the date, and a Date object that is created from that string. I have some code that needs to accept a date-like object. I'd like the user to be able to pass in anything date like - a Date object which I'll extract the information from, another DtaDate, a string with the date in it, or even the key, which I'll use to look up the DtaDate from a collection. So I have this: Friend Sub New(NameIn As String, DateFormulaIn As String, Optional FromDateIn As Object = Nothing) [stuff that works] [check that we got a FromDateIn...] If TypeOf FromDateIn Is DtaDate Then fdk = FromDateIn.Key Ans.FromDate = fdk VB tells me that "Option Strict On disallows late binding". The other cases, where a string or integer is the TypeOf, I use CInt or CStr. But this is the first time I've actually run into a case where the casting is a non-base type. What's the trick?

    Read the article

  • Java - Can i have a faster performance for this loop ?

    - by Brad
    I am reading a book and deleting a number of words from it. My problem is that the process takes long time, and i want to make its performance better(Less time), example : Vector<String> pages = new Vector<String>(); // Contains about 1500 page, each page has about 1000 words. Vector<String> wordsToDelete = new Vector<String>(); // Contains about 50000 words. for( String page: pages ) { String pageInLowCase = page.toLowerCase(); for( String wordToDelete: wordsToDelete ) { if( pageInLowCase.contains( wordToDelete ) ) page = page.replaceAll( "(?i)\\b" + wordToDelete + "\\b" , "" ); } // Do some staff with the final page that does not take much time. } This code takes around 3 minutes to execute. If i skipped the loop of replaceAll(...) i can save more than 2 minutes. So is there a way to do the same loop with a faster performance ?

    Read the article

  • problem in jdbc preparestatement

    - by akshay
    i am geting error when i try to use following,why is it so? ResultSet findByUsername(String tablename,String field,String value) { pStmt = cn.prepareStatement("SELECT * FROM" + tablename +" WHERE ? = ? "); pStmt.setString(1, tablename); pStmt.setString(2,field); pStmt.setString(3,value); return(pStmt.executeQuery()); } also i tried following , but its not working too ResultSet findByUsername(String tablename,String field,String value) { String sqlQueryString = " SELECT * FROM " + tablename +" WHERE " + filed + "= ? ") cn.prepareStatement(sqlQuery); pStmt.setString(1, value); return(pStmt.executeQuery()); }

    Read the article

  • Google App Engine query data store by a string start with ...

    - by Frank
    How to write a query that can find me all item_number start with a certain value ? For instance there are item_numbers like these : 123_abc 123_xyz ierireire 321_add 999_pop My current query looks like this : "select from "+PayPal_Message.class.getName()+" where item_number == '"+Item_Number+"' order by item_number desc" What's a query look like that can return all item_numbers start with "123_" ?

    Read the article

  • Finding the specific type held in an ArrayList<Object> (ie. Object = String, etc.)

    - by Christopher Griffith
    Say I have an ArrayList that I have cast to an ArrayList of objects. I know that all the objects that were in the ArrayList I cast were of the same type, but not what the type was. Now, if the ArrayList is not empty, I could take one of the objects in it and use the instanceof operator to learn what the actual type is. But what of the case where the ArrayList is empty? How do I determine what type Object actually is then? Is it possible?

    Read the article

  • How can I forward a query string using htaccess?

    - by Eric
    I am using this, at present, to rewrite URLS: RewriteEngine on RewriteRule ^([^/?\.]+)$ /page.php?name=$1 [NC] So mysite.com/home gets rewritten to mysite.com/page.php?name=home How can I make it also rewrite mysite.com/home?param=value to mysite.com/page.php?name=home&param=value? Ideally, I'd like this to work for any name/value querystring pairs. Am I missing something obvious?

    Read the article

  • In PHP how do a translate a date to numerical format not knowing the format of the string beforehand

    - by stormist
    Examples of the translations I need to do: $stringDate = "November 2009"; $output = "11/09"; $stringDate = "October 1 2010"; $output = "10/01/2010"; $stringDate = "January 2010"; $output = "01/10"; $stringDate = "January 9 2010"; $output = "01/09/2010"; Note that I do not know which format the $stringDate will be in and the lack of commas in the month day year set. Thanks for any help anyone might offer.

    Read the article

  • jquery ajax sucess - possible to return JSON instead of string?

    - by Haroldo
    To return an error from a $.ajax call, there's gotta be a better way than echoing an error in the ajax.php file and then trimming it! this seems very clumsy and in-robust: success: function(e){ var e = trim(e); if(e == 'SUCCESS') {alert('your password has been changed!');} if(e == 'ERROR1') {alert('please fill in all inputs!');} if(e == 'ERROR2') {alert('password incorrect!');} if(e == 'ERROR3') {alert('change failed!');} } what should i be doing instead?!

    Read the article

  • How can I pad part of a string with spaces, in Perl?

    - by sid_com
    Hello! Which version would you prefer? #!/usr/bin/env perl use warnings; use strict; use 5.010; my $p = 7; # 33 my $prompt = ' : '; my $key = 'very important text'; my $value = 'Hello, World!'; my $length = length $key . $prompt; $p -= $length; Option 1: $key = $key . ' ' x $p . $prompt; Option 2: if ( $p > 0 ) { $key = $key . ' ' x $p . $prompt; } else { $key = $key . $prompt; } say "$key$value"

    Read the article

  • How do I create if statements in php to perform a specific action depending on what form has string in it

    - by user1637284
    Im trying to create a grid on my page in each cell there will be a simple one line form. If a person enters data into lets say FieldA I would like the php to perform actionA but if the data was entered in FieldF I would like actionF performed. Is this possible without having to create a php for each cell and upload all those php files? Or is there a way to perform the GET method in each form to append the data to the end of the action url without the field name showing (ie sample.com/somestuff/fieldA instead of sample.com/somestuff/fieldname=fieldA) thus not needing php at all?

    Read the article

  • access a property via string with array in php?

    - by sprugman
    (This is in drupal, but I don't really think that matters.) I have a big list of properties that I need to map between two objects, and in one, the value that I need to map is buried inside an array. I'm hoping to avoid hard-coding the property names in the code. If I have a class like this: class Product { public $colors, $sizes; } I can access the properties like this: $props = array('colors', 'sizes'); foreach ($props as $p) { $this->$p = $other_object->$p; } As far as I can tell, if each of the properties on the left are an array, I can't do this: foreach ($props as $p) { $this->$p[0]['value'] = $other_object->$p; } Is that correct, or am I missing some clever way around this?

    Read the article

  • Getting the first row of the mysql resource string?

    - by mrNepal
    Here is my problem. I need more than one row from the database, and i need the first row for certain task and then go through all the list again to create a record set. $query = "SELECT * FROM mytable"; $result = mysql_query($query); $firstrow = //extract first row from database //add display some field from it while($row = mysql_fetch_assoc($result)) { //display all of them } Now, how to extract just the first row?

    Read the article

  • How can I determine if a specified string is in a specific MySQL column? (and also perhaps a tutoria

    - by Rob
    This is a fairly simple question. Basically, I'm having a program send HardWare ID's to my PHP script as GET data. I need the PHP script check to make sure that HardWare ID is in a specific MySQL column, and if it is, { continue the script, } else { exit(); } Problem is I'm not too good with MySQL and have no idea how to do this. However, I feel that I should know this by now, so if someone could also link me to a good tutorial site for MySQL, that kind of keeps it "humanized" if you know what I mean. One that "dumbs it down." I'm not dumb or anything, I just get sidetracked easily, and if all its doing is showing me code and not explaining it, I won't pick it up. If you don't have any tutorial sites off the top of your head, I'll settle for help with the first question, and try to hunt down a tutorial later.

    Read the article

< Previous Page | 282 283 284 285 286 287 288 289 290 291 292 293  | Next Page >