Search Results

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

Page 204/1413 | < Previous Page | 200 201 202 203 204 205 206 207 208 209 210 211  | Next Page >

  • Warning: date() expects parameter 2 to be long, string given in

    - by Simon
    its the $birthDay = date("d", $alder); $birthYear = date("Y", $alder); i dont know what it is here is my code //Dag $maxDays = 31; $birthDay = date("d", $alder); echo '<select name="day">'; echo '<option value="">Dag</option>'; for($i=1; $i<=$maxDays; $i++) { echo '<option '; if($birthDay == $i){ echo 'selected="selected"'; } echo ' value="'.$i.'">'.$i.'</option>'; } echo '</select>'; //Måned echo '<select name="month">'; $birthMonth = date("m", $alder); $aManeder = 12; echo '<option value="">Måned</option>'; for($i = 1; $i <= $aManeder; $i++) { echo '<option '; if($birthMonth == $i) { echo 'selected="selected"'; } echo ' value="'.$i.'">'.$ManderArray[$i].'</option>'; } echo '</select>'; //År $startYear = date("Y"); $endYear = $startYear - 30; $birthYear = date("Y", $alder); echo '<select name="year">'; echo '<option value="">år</option>'; while($endYear <= $startYear) { echo '<option '; if($birthYear == $endYear) { echo 'selected="selected"'; } echo ' value="'.$endYear.'">'.$endYear.'</option>'; $endYear++; } echo '</select>';

    Read the article

  • .NET Regex - need matching string for parsing...

    - by TomTom
    Hello, I am a regex idiot and never found a good tutorial (links welcome, as well as a pointer to an interactive VS2010 integrated editor). I need to parse strings in the following form: [a/b]:c/d a, b: double with "." as possible separator. CAN be empty c: double with "." as separator d: integer, positive I.e. valid strings are: [/]:0.25/2 [-0.5/0.5]:0.05/2 [/0.1]:0.05/2 ;) Anyone can help? Thanks

    Read the article

  • Explode URL Query String Issue

    - by Ian McAbee
    PHP newbie here.. I am trying to create a function where the user is redirected back to the previous page after adding an item to their cart. However, when they are redirected back with the code below it leaves a duplicate of the directory (ie. example.com/catalog/garden-tools/garden-tools function custom_add_to_cart_redirect() { $_SERVER['REQUEST_URI_PATH'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $url = explode('/', rtrim($_SERVER['REQUEST_URI_PATH'], '/')); return $url[3]; } A print_r reveals the following: Array ( [0] => [1] => thefarmshop [2] => catalog [3] => garden-tools [4] => gardening-glove ) What could the issue be?

    Read the article

  • Validate string in javascript with parenthesis

    - by user2932856
    I just need to validate 2 strings in javascript. One of them must contain only 0 or more open parenthesis ( . The other must contain only 0 or more close parenthesis ) . This means only those characters are allowed in each value. After spending a lot of time trying to understand the regex, I can't find a way to achieve this. With the escape characters I make a mess of the regex function. This is what I thought: /\(*/ Could anyone help me?

    Read the article

  • Python3k parse string re help

    - by dsaccount1
    "8,5,,1,4,7,,,,7,,1,9,3,6,,,8,6,3,9,,2,5,4,,,,,3,2,,,7,4,1,1,,4,,6,9,,5,,,,5,,,1,,6,3,,,6,5,,,,7,4,,1,7,6,,,,8,,5,,,7,1,,3,9," I'm doing a programming challenge where i need to parse this sequence into my sudoku script. Need to get the above sequence into 8,5,0,1,4,7,0,0,0,7,0,1,9,3,6,0,0,8......... I tried re but without success, help is appreciated, thanks.

    Read the article

  • Adding characters to string (input field)

    - by Zaps
    Hi, I have a text box where the value the result of a calculation carried out in jQuery. What I would like to do, using jQuery, is to display brackets around the number in the text box if the number is negative. The number may be used again later so I would then have to remove the brackets so further calculations could be carried out. Any ideas as to how I could implement this? Thanks Zaps

    Read the article

  • Set attribute disabled to options NOT containing a certain string

    - by kuswantin
    I know this should be easier if I could only use optgroups. But I am trying to avoid hacking core of my CMS, so jQuery should come to rescue again, hopefully. I have a select with options in a hierarchy sometimes, and I want to put attributes disabled to any of options containing text NOT starting with a dash. I want to code like: Set disabled attributes to selectors with options text NOT starting with a dash ("-"). <select id="options"> <option value="" selected="selected">- Please choose -</option> <option value="1">Parent1</option> <option value="2">-child1</option> <option value="3">-child2</option> <option value="4">-child3</option> <option value="5">-child4</option> <option value="6">Parent2</option> <option value="7">-child5</option> <option value="8">-child6</option> <option value="9">-child7</option> <option value="10">-child8</option> </select> The closest solution is here http://stackoverflow.com/questions/2012299/contain-start-by, $.extend($.expr[':'], { startsWith: function(elem,match) { return (elem.textContent || elem.innerText || "").indexOf(match[3]) == 0; } }); But I can't seem to do it right this far. Any help would be very much appreciated. Thank you very much.

    Read the article

  • Adding characters to string

    - by Jamza
    I am currently trying to build a very basic serial shell with my arduino. I am able to get an output from the device using Serial.read() and can get the character it has outputted, but I cannot work out how to then add that character to a longer to form the full command. I tried the logical thing but it doesn't work: char Command[]; void loop(){ if(Serial.available() > 0){ int clinput = Serial.read(); Command = Command + char(clinput); } Can anybody help? Thank You.

    Read the article

  • C# Reading a file and writing out replacing string

    - by Mike
    What I have is a C# windows app that reads a bunch of SQL tables and creates a bunch of queries based on the results. What I'm having a small issue with is the final "," on my query This is what I have ColumnX, from I need to read the entire file, write out exactly what is in the file and just replace the last , before the from with nothing. I tried .replace(@",\n\nfrom),(@"\n\nfrom) but it's not finding it. Any help is appreciated. Example: ColumnX, from Result: ColumnX from

    Read the article

  • Changing a Widget's name based on a string read in from an XML form in Qt.

    - by Nick
    I'm writing a code for a voting machine that will allow user to read in custom XML ballots and then vote on them, however in the current build I have in QtCreator, I don't see an easy way to edit buttons in my GUI directly. In the code snippet below, I assign an element to pull out the names and type of ballot being read in, but I need to append a label on the GUI as well as change buttons to the names of candidates read in. Any ideas on how to do this? while(!n.isNull()){ QDomNode x = n.firstChildElement(); QDomElement e = n.toElement(); QMessageBox::information(0, tr( "Loading Element" ), tr( "Our element is %1" ).arg(e.tagName()) ); QDomElement p = x.firstChildElement();//p finds Races QMessageBox::information(0,tr("Foo"),tr("p = %1").arg(p.text()));//finds Race and Ballot types n = n.nextSibling(); } }

    Read the article

  • Inserting empty string into auto_increment column in MySQL 5

    - by QmunkE
    Hi, I've inherited a project which we are trying to migrate to MySQL 5 from MySQL 4.0(!) and from myISAM to InnoDB. Queries are now falling down because they are being constructed using an ADODB connection's -qstr() on all parameters, including ints. Where no value is provided I end up with: INSERT INTO tablename VALUES ('', 'stuff'...) where the first column is an auto_increment. This causes an error (fair enough since '' isn't an int). Is there a switch in MySQL to make it behave as it used to (I assume it just silently converted to 0?) Thanks.

    Read the article

  • PHP string enocding issue - Extra characters appearing

    - by ryan
    I see extra characters like â showing because of encoding issues as I found out here - HTML encoding issues - "Â" character showing up instead of "&nbsp;" I understand that if I set the browser meta encoding to UTF-8, these will not affect anything but I need to strip these extra characters from the database for other purposes. For eg. : Text: ↑ should be become Text: ? But if I run it through utf8_decode it gives me Text: ??? For every other occurrence of the â character, it converts properly to a blank space. Any help will be appreciated.

    Read the article

  • C#: Converting string to namespace

    - by Am
    Hi, I have an interface named IHarvester. There are 3 implementations of that interface, each under their own namespace: Google Yahoo Bing A HarvesterManager uses the given harvester. It knows the interface and all 3 implementations. I want some way of letting the class user say in which harvester it wants to use. And in the code select that implementation, without a switch-case implementation. Can reflection save my day? Here is the code bits: // repeat for each harvester namespace Harvester.Google { public abstract class Fetcher : BaseHarvester, IInfoHarvester {...} } public enum HarvestingSource { Google, Yahoo, Bing, } class HarvesterManager { public HarvestingSource PreferedSource {get;set;} public HarvestSomthing() { switch (PreferedSource) .... // awful... } } Thanks.

    Read the article

  • Substr from end of string php?

    - by Gorostas
    I have this kind of array, i will make it very simple to understand $picture = ( 'artist2-1_thumb.jpg', 'artist2-2.jpg' , 'artist2-3_thumb.jpg', 'artist2-4.jpg', 'artist2-5_thumb.jpg'); Now i want use substr to get new array that only have thumb, to have new array like this $picturethumbs = ( 'artist2-1_thumb.jpg', 'artist2-3_thumb.jpg', 'artist2-5_thumb.jpg'); Can some substr but where to start?

    Read the article

  • Normalized class design and code first

    - by dc7a9163d9
    There are the following two classes. public class Employee { int EmployeeId { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Street { get; set; } public string Street2 { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { get; set; } } public class Company { int CompanyId { get; set; } public string Name { get; set; } public string Street { get; set; } public string Street2 { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { get; set; } } In a DDD seminar, the speaker said the better design should be, class PersonName { public string FirstName { get; set; } public string LastName { get; set; } } class Address { public string Street { get; set; } public string Street2 { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { get; set; } } public class Employee { int EmployeeId { get; set; } public PersonName Name { get; set; } [ForeignKey("EmployerAddress")] public int EmployerAddressId { get; set; } public virtual Address EmployerAddress { get; set; } } public class Company { int CompanyId { get; set; } public string Name { get; set; } [ForeignKey("CompanyAddress")] public int CompanyAddressId { get; set; } public virtual Address CompanyAddress { get; set; } } Is it the optimized design? How the code first generate the PersonName table and link it to Employee?

    Read the article

  • Check string for link

    - by Mike
    I have rather long entries being submitted to a database. How can I create a function to see if this entry has a link within it? Can someone get me started? Pretty much, I want the function to find any I'd prefer not to throw the entry into an array. Are there any other ways to accomplish this?

    Read the article

< Previous Page | 200 201 202 203 204 205 206 207 208 209 210 211  | Next Page >