Search Results

Search found 119 results on 5 pages for 'haroldo'.

Page 3/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • is there a native php function to see if one array of values is in another array?

    - by Haroldo
    Is there a better method than loop with strpos()? Not i'm looking for partial matches and not an in_array() type method. example needle and haystack and desired return: $needles[0] = 'naan bread'; $needles[1] = 'cheesestrings'; $needles[2] = 'risotto'; $needles[3] = 'cake'; $haystack[0] = 'bread'; $haystack[1] = 'wine'; $haystack[2] = 'soup'; $haystack[3] = 'cheese'; //desired output - but what's the best method of getting this array? $matches[0] = 'bread'; $matches[1] = 'cheese';

    Read the article

  • how can i find unused css in ajax app?

    - by Haroldo
    I've been searching and i can't find any ff addons or javascript for finding unused css in ajax apps. dust-me selectors can do a site-crawl, but i'm looking for something that examines loaded-in content... I'd like something where i can press 'record' and then make a load of clicks which will check off the used selectors, and hoping to find an existing one rather than try to write my own with jquery!

    Read the article

  • jquery hover event between mousedown and mouseup - possible?

    - by Haroldo
    If you imagine in microsoft paint you can click and hold to paint in an area, id like to do a similar but adding a class to cells in a table: (note this isnt for painting/art just an easy way of explaining it!) the following isnt working... $(function(){ $('td').mousedown(function(){ console.log('down'); $('td').bind('hover', function(){ $(this).addClass('booked'); }); }) $('td').mouseup(function(){ $('td').unbind('hover'); }); })

    Read the article

  • how to do new lines? [ textarea -> jquery -> p tag ]

    - by Haroldo
    I'm doing something very similar to the stackoverflow question preview only much more basic. user types in text area - keyup shows what they've typed in preview new lines aren't working $('input, textarea').keyup(function(){ var value = $this.attr('value').replace('\n', '<br />').replace('\r', '<br />'); $('p.preview').html(value); })

    Read the article

  • stop cript debug error dialogs occur in ie8 ?

    - by Haroldo
    I get this, clicking 'no' means the page displays flawlessly. it's refering to this part of jquery1.4.2.js: // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); }, I assume i'm calling something in the wrong context somewhere in one of my js files (which would be a real mission to find). Will standard IE8 users get this error? (i imagine ms make it pretty difficult to reinstall ie!)

    Read the article

  • Which Firefox extension checks html markup when you view source?

    - by Haroldo
    I used to have a great firefox addon for this and i can't remember the name of it.. when you looked at the source it would sit at the bottom (like firebug) and check your html markup and suggest things like "doctype given is html4.0, looks like xhtml strict" etc i though it was the web developer toolbar but that doesnt seem to add anything to the bottom of ym source pane?

    Read the article

  • help with converting javascript function to php

    - by Haroldo
    My javascript isnt so great, but i found a brilliant looking function here I'm not sure what to do with this bit: var ranges = [], rstart, rend; full function: function getRanges(array) { var ranges = [], rstart, rend; for (var i = 0; i < array.length; i++) { rstart = array[i]; rend = rstart; while (array[i + 1] - array[i] == 1) { rend = array[i + 1]; // increment the index if the numbers sequential i++; } ranges.push(rstart == rend ? rstart+'' : rstart + '-' + rend); } return ranges; } getRanges([2,3,4,5,10,18,19,20]); // returns ["2-5", "10", "18-20"] getRanges([1,2,3,5,7,9,10,11,12,14 ]); // returns ["1-3", "5", "7", "9-12", "14"] getRanges([1,2,3,4,5,6,7,8,9,10]) // returns ["1-10"]

    Read the article

  • best SEO method for date in url structure? [closed]

    - by Haroldo
    I'm working on an events website so dates are very important search terms, ie: 'whats on on fri 14th september' I've seen it done in various methods for example: domain/whats-on/city-hall/14-09-2010/event-name.html domain/whats-on/city-hall/2010/09/14/event-name.html the first is 'shallower'. the second could be clearer for google to synonym-ize as a date, has anyone else got any experience or input?

    Read the article

  • going to build a php MVC, what naming conventions do i need to be aware of?

    - by Haroldo
    I'm pretty new to OO PHP, however i get how it all works and am ready to start building an MVC for a big site i'm working on. I know it isnt necessary written that you must do it like this but there's gotta be some normal practises.... class names - camelcase? underscores? class files - same as class? url/post/get controll name - router.php? any other things i should be aware of before i embark?

    Read the article

  • restrict the scope of variables in a mysql query? with brackets?

    - by Haroldo
    I can't remember what the method is meant to be for ensuring the scope of a variable in a query is restricted to prevent mysql injection. where should i put brackets in the following examples? UPDATE table SET col_1 = '$var', col_2 = '$var2' WHERE col_1 = '$var3' and SELECT * FROM table WHERE WHERE col_1 >= '$var1' (Obviously looking for answers not using PDO!)

    Read the article

  • Negative margins: can they work in IE7 and IE8?

    - by Haroldo
    I'm trying to have a kind of dirty underline effect using a string of hyphens, but I want it slightly closer to the multi-line title than the line-height. Negative margin works a treat in FF but no joy in IE? <p>a multiline title here<p><p style="margin: -7px 0px 10px 0px;">-----------------------------------------------------------------------------</p>

    Read the article

  • MySQL not using index on DATE when used with '<' or '>' operators?

    - by Haroldo
    I'm using explain to test these queries. The col type is DATE this uses index: explain SELECT events.* FROM events WHERE events.date = '2010-06-11' this doesnt explain SELECT events.* FROM events WHERE events.date >= '2010-06-11' index as follows (phpmyadmin) Action Keyname Type Unique Packed Field Cardinality Collation Null Comment Edit Drop PRIMARY BTREE Yes No event_id 18 A Edit Drop date BTREE No No date 0 A i notice cardinality is 0, though there are some rows with the same date..

    Read the article

  • method for creating PHP templates (ie html with variables)?

    - by Haroldo
    I'm designing my html emails, these are to be a block of html containing variables that i can store in a $template variable. My problem comes with the storing in the variable part. putting all my html into php makes it a pain in the bum to work with. for example, the below code is fine for a simple email but once i start getting nested tables etc its going to get really confusing... $template.= 'Welcome ' . $username . '<br /><br /><br />'; $template.= 'Thank-you for creating an account <br /><br />'; $template.= 'Please confirm your account by click the link below! <br /><br />'; $template.= '<a href="' . $sitepath . '?email=' . $email . '&conf_key=' . $key . '" style="color: #03110A;"><font size="5" font-family="Verdana, Geneva, sans-serif" color="#03110A">' . $key . '</font></a>'; $template.='</body></html>'; is there a way i can still store the html in a $var but not have to write it like this?

    Read the article

  • php: how do i store an array in a file to access as an array later with php?

    - by Haroldo
    I just want to quickly store an array which i get from a remote API, so that i can mess around with it on a local host. So: i currently have an array i want to people to use the array without having to get it from the API There are no needs for efficiency etc here, this isnt for an actual site just for getting some sanitizing/formatting methods made etc is there a function like store_array() restore_arrray() ?!

    Read the article

  • php class that auto attaches .js and .css files, possible?

    - by Haroldo
    I want the class to auto-attach its required css and js files when instantiated... is there any way of a class knowing where it is (and its files) in relation to the root? if 1 is possible, is there a way to check if a css/js file has already been referenced in the file, or is this not necessary(do browsers ignore duplicate css/js file references)?

    Read the article

  • MySQL indexes - what are the best practises?

    - by Haroldo
    I've been using indexes on my mysql databases for a while now but never properly learnt about them. Generally I put an index on any fields that i will be searching or selecting using a WHERE clause but sometimes it doesn't seem so black and white. What are the best practises for mysql indexes? example situations/dilemas: If a table has six columns and all of them are searchable, should i index all of them or none of them? . What are the negetive performance impacts of indexing? . If i have a VARCHAR 2500 column which is searchable from parts of my site, should i index it?

    Read the article

  • css: top and bottom with flexible centre

    - by Haroldo
    is it possible with just css2 to have the following: 3 divs: <div id="wrap_centre"> <div class="top"></div> <div class="mid"></div> <div class="bot"></div> </div> all the content to be in the flexible div.mid section overlap the top and bottom parts not fussed about ie6 here's the photoshop with centre slice: as you can see the top and bottom parts are quite large and i need to overlap them from the middle slice...

    Read the article

  • mysql : possible to put IF statment in LEFT JOIN ?

    - by Haroldo
    Ok so i want to get an artists info from the db, but i want to know if they have any forthcoming events. To do this i need to traverse 2 tables, where events_artists is a 2 col link table... (this doesnt work but is what id like to do) SELECT art.*, events.event_id FROM art LEFT JOIN events_artists ON art.art_id = events_artists.art_id LEFT JOIN events ON events_artists.event_id = events.event_id IF ( {criteria} ) what should i be doing here to get this to work?!!

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >