Search Results

Search found 4288 results on 172 pages for 'mark griffin'.

Page 63/172 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • Embedded Windows Media Player background image

    - by Mark
    Hi all, I'm loading an external video stream in my embedded player. Since it takes a little while to connect and preload you see a black background for +- 7 secs untill video plays . I would like to know if its possible to have a background image saying 'Stand by loading video' with my logo on it before the video starts to play. Only thing i could find was bgcolor parameter but that's not what I want. I hope someone can help me thanks!!

    Read the article

  • Combining multiple jQuery functions

    - by Mark
    Is there any way to combine all of this to reduce the amount of js? This is just an example of some of the jquery dialogs I have in my site, there are a few more too. Thanks. //initiate Search refinement dialog here $("#chooseMoreCnt, #chooseMoreCat, #chooseMorePr").dialog({ bgiframe: true, autoOpen: false, width: 500, modal: true, open: function(type, data) { $(this).parent().appendTo(jQuery("form:first")); } }); //trigger country dialog $('a.chooseMoreCnt').click(function() { $('#chooseMoreCnt').dialog('open'); return false; }); //trigger category dialog $('a.chooseMoreCat').click(function() { $('#chooseMoreCat').dialog('open'); return false; }); //trigger price dialog $('a.chooseMorePr').click(function() { $('#chooseMorePr').dialog('open'); return false; });

    Read the article

  • Storing year/make/model in a database?

    - by Mark
    Here's what I'm thinking (excuse the Django format): class VehicleMake(Model): name = CharField(max_length=50) class VehicleModel(Model): make = ForeignKey(VehicleMake) name = CharField(max_length=50) class VehicleYear(Model): model = ForeignKey(VehicleModel) year = PositiveIntegerField() This is going to be used in those contingent drop-down select boxes, which would visually be laid out like [- Year -][- Make -][- Model -]. So, to query the data I need I would first have to select all distinct years from the years table, sorted descending. Then I'd find all the vehicle makes that have produced a model in that year. And then all the models by that make in that year. Is this a good way to do it, or should I re-arrange the foreign keys somehow? Or use a many-to-many table for the years/models so that no year is repeated?

    Read the article

  • Print a JavaScript array to HTML, square brackets and quotation marks intact

    - by Mark Gia Bao Nguyen
    I'd like to set the attribute of an input form with an array of values (to use for autocomplete search). I have a JS array that looks a little something like this: var suggestions = ["value1", "value2", "value3"]; Using jQuery, I did this: $("#search-input").attr("data-source", suggestions); Desired output: <input type='search' data-source='["value1", "value2", "value3"]' /> Actual output: <input type='search' data-source='value1, value2, value3' /> This breaks the autocomplete as it requires an array (or at least something that looks like a JavaScript array).

    Read the article

  • Custom language - FOR loop in a clojure interpeter?

    - by Mark
    I have a basic interpreter in clojure. Now i need to implement for (initialisation; finish-test; loop-update) { statements } Implement a similar for-loop for the interpreted language. The pattern will be: (for variable-declarations end-test loop-update do statement) The variable-declarations will set up initial values for variables.The end-test returns a boolean, and the loop will end if end-test returns false. The statement is interpreted followed by the loop-update for each pass of the loop. Examples of use are: (run ’(for ((i 0)) (< i 10) (set i (+ 1 i)) do (println i))) (run ’(for ((i 0) (j 0)) (< i 10) (seq (set i (+ 1 i)) (set j (+ j (* 2 i)))) do (println j))) inside my interpreter. I will attach my interpreter code I got so far. Any help is appreciated. Interpreter (declare interpret make-env) ;; needed as language terms call out to 'interpret' (def do-trace false) ;; change to 'true' to show calls to 'interpret' ;; simple utilities (def third ; return third item in a list (fn [a-list] (second (rest a-list)))) (def fourth ; return fourth item in a list (fn [a-list] (third (rest a-list)))) (def run ; make it easy to test the interpreter (fn [e] (println "Processing: " e) (println "=> " (interpret e (make-env))))) ;; for the environment (def make-env (fn [] '())) (def add-var (fn [env var val] (cons (list var val) env))) (def lookup-var (fn [env var] (cond (empty? env) 'error (= (first (first env)) var) (second (first env)) :else (lookup-var (rest env) var)))) ;; for terms in language ;; -- define numbers (def is-number? (fn [expn] (number? expn))) (def interpret-number (fn [expn env] expn)) ;; -- define symbols (def is-symbol? (fn [expn] (symbol? expn))) (def interpret-symbol (fn [expn env] (lookup-var env expn))) ;; -- define boolean (def is-boolean? (fn [expn] (or (= expn 'true) (= expn 'false)))) (def interpret-boolean (fn [expn env] expn)) ;; -- define functions (def is-function? (fn [expn] (and (list? expn) (= 3 (count expn)) (= 'lambda (first expn))))) (def interpret-function ; keep function definitions as they are written (fn [expn env] expn)) ;; -- define addition (def is-plus? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '+ (first expn))))) (def interpret-plus (fn [expn env] (+ (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define subtraction (def is-minus? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '- (first expn))))) (def interpret-minus (fn [expn env] (- (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define multiplication (def is-times? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '* (first expn))))) (def interpret-times (fn [expn env] (* (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define division (def is-divides? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '/ (first expn))))) (def interpret-divides (fn [expn env] (/ (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define equals test (def is-equals? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '= (first expn))))) (def interpret-equals (fn [expn env] (= (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define greater-than test (def is-greater-than? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '> (first expn))))) (def interpret-greater-than (fn [expn env] (> (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define not (def is-not? (fn [expn] (and (list? expn) (= 2 (count expn)) (= 'not (first expn))))) (def interpret-not (fn [expn env] (not (interpret (second expn) env)))) ;; -- define or (def is-or? (fn [expn] (and (list? expn) (= 3 (count expn)) (= 'or (first expn))))) (def interpret-or (fn [expn env] (or (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define and (def is-and? (fn [expn] (and (list? expn) (= 3 (count expn)) (= 'and (first expn))))) (def interpret-and (fn [expn env] (and (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define print (def is-print? (fn [expn] (and (list? expn) (= 2 (count expn)) (= 'println (first expn))))) (def interpret-print (fn [expn env] (println (interpret (second expn) env)))) ;; -- define with (def is-with? (fn [expn] (and (list? expn) (= 3 (count expn)) (= 'with (first expn))))) (def interpret-with (fn [expn env] (interpret (third expn) (add-var env (first (second expn)) (interpret (second (second expn)) env))))) ;; -- define if (def is-if? (fn [expn] (and (list? expn) (= 4 (count expn)) (= 'if (first expn))))) (def interpret-if (fn [expn env] (cond (interpret (second expn) env) (interpret (third expn) env) :else (interpret (fourth expn) env)))) ;; -- define function-application (def is-function-application? (fn [expn env] (and (list? expn) (= 2 (count expn)) (is-function? (interpret (first expn) env))))) (def interpret-function-application (fn [expn env] (let [function (interpret (first expn) env)] (interpret (third function) (add-var env (first (second function)) (interpret (second expn) env)))))) ;; the interpreter itself (def interpret (fn [expn env] (cond do-trace (println "Interpret is processing: " expn)) (cond ; basic values (is-number? expn) (interpret-number expn env) (is-symbol? expn) (interpret-symbol expn env) (is-boolean? expn) (interpret-boolean expn env) (is-function? expn) (interpret-function expn env) ; built-in functions (is-plus? expn) (interpret-plus expn env) (is-minus? expn) (interpret-minus expn env) (is-times? expn) (interpret-times expn env) (is-divides? expn) (interpret-divides expn env) (is-equals? expn) (interpret-equals expn env) (is-greater-than? expn) (interpret-greater-than expn env) (is-not? expn) (interpret-not expn env) (is-or? expn) (interpret-or expn env) (is-and? expn) (interpret-and expn env) (is-print? expn) (interpret-print expn env) ; special syntax (is-with? expn) (interpret-with expn env) (is-if? expn) (interpret-if expn env) ; functions (is-function-application? expn env) (interpret-function-application expn env) :else 'error))) ;; tests of using environment (println "Environment tests:") (println (add-var (make-env) 'x 1)) (println (add-var (add-var (add-var (make-env) 'x 1) 'y 2) 'x 3)) (println (lookup-var '() 'x)) (println (lookup-var '((x 1)) 'x)) (println (lookup-var '((x 1) (y 2)) 'x)) (println (lookup-var '((x 1) (y 2)) 'y)) (println (lookup-var '((x 3) (y 2) (x 1)) 'x)) ;; examples of using interpreter (println "Interpreter examples:") (run '1) (run '2) (run '(+ 1 2)) (run '(/ (* (+ 4 5) (- 2 4)) 2)) (run '(with (x 1) x)) (run '(with (x 1) (with (y 2) (+ x y)))) (run '(with (x (+ 2 4)) x)) (run 'false) (run '(not false)) (run '(with (x true) (with (y false) (or x y)))) (run '(or (= 3 4) (> 4 3))) (run '(with (x 1) (if (= x 1) 2 3))) (run '(with (x 2) (if (= x 1) 2 3))) (run '((lambda (n) (* 2 n)) 4)) (run '(with (double (lambda (n) (* 2 n))) (double 4))) (run '(with (sum-to (lambda (n) (if (= n 0) 0 (+ n (sum-to (- n 1)))))) (sum-to 100))) (run '(with (x 1) (with (f (lambda (n) (+ n x))) (with (x 2) (println (f 3))))))

    Read the article

  • REST API for driving distance?

    - by Mark
    Is there a service that will give me the driving distance between two addresses? Apparently Google Maps API requires you to display a map, which I don't want to do (on that particular page), and I'd like to just snag the data and save it to my DB after a user submits a form, rather than waiting for JS to do it's thing. If it's relevant, this is going into a Django app. I discovered that CloudMade offers a Python API, which is nice, except their latest dev release has a bug in it (can't use the API object), but more importantly, it's support for Canada is awful/worthless (couldn't find directions from any major city around here!).

    Read the article

  • jquery nextUntil has element

    - by Mark
    jquery nextUntil has element I have a bunch of elements like this: <div></div> <span></span> <table></table> <div></div> <span></span> <div></div> I need to check whether or not there's a table element in between the divs, and if so do something. $('div').each(function () { if ($(this).nextUntil('div').include('table')) { $(this).addClass('got-a-table'); } } Something like this? I know that there's no include method, is there something that can get me what I need? Thanks. Result should be like this: <div class='got-a-table'></div> <span></span> <table></table> <div></div> <span></span> <div></div>

    Read the article

  • What is the best algorithm to locate a point in an image file?

    - by suugaku
    Hi all, I want to create a mark sheet recognizer. Here is the description: My system uses black and white color scheme. The mark sheet paper has a small black rectangle on each corner and an additional small black rectangle, to determine orientation, near one of the previous rectangles. The paper is scanned to yield an image (in bmp format for example). The first step is to locate these five references in image as eficient as possible. My rough idea is to trace row by row and from left to right for each row. It sounds very slow I think. Is there any better way to do that? Thank you in advance. regards, Suugaku

    Read the article

  • Magento database query to get number of products for a price range

    - by mark
    I have staically added price range with hyperlinks $0 - $500 $500 - $1,000 $1,000 - $2,500 $2,500 - $5,000 $5,000 - $10,000 $10,000 - $15,000 $15,000 and up For exa mple when i click the link $1000-$2500 the url is http://localhost/magento/index.php/catalogsearch/advanced/result/?price[from]=1000&price[to]=2500&category=9 This is working fine. I want to display the nuber of prodects for each price range only by checking the price field in the table. What might be the query

    Read the article

  • SQLAlchemy - select for update example

    - by Mark
    I'm looking for a complete example of using select for update in SQLAlchemy, but haven't found one googling. I need to lock a single row and update a column, the following code doesn't work (blocks forever): s = table.select(table.c.user=="test",for_update=True) u = table.update().where(table.c.user=="test") u.execute(email="foo") Do I need a commit? How do I do that? As far as I know you need to: begin transaction select ... for update update commit

    Read the article

  • I can't get mailto links to open the Mail app from Mobile Safari when using jQTouch. What could be w

    - by Mark B
    Hi all, I'm developing an iPhone web app using jQTouch, and it contains a simple mailto: link to a valid email address, which should launch the iPhone mail application when tapped—but it doesn't. If I visit a "normal" web page in Mobile Safari which contains the exact same link, and tap on it, I get the expected result: the mail app pops up with the correct email address in the To field. Here's the link HTML (with the address changed) just in case I'm going nuts and have made a stupid mistake, but it appears perfectly fine: <p><a href="mailto:[email protected]">[email protected]</a></p> Has anyone come across this when using jQTouch? Or can anyone at least suggest a way that I can debug this? At the moment when I tap the non-working link it flashes red (the active link state) and absolutely nothing else happens.

    Read the article

  • Lightbox close and loading images not showing

    - by Mark Szymanski
    I am using Lightbox 2 and I have followed the short tutorial on how to insert it in a webpage and it works perfectly but the close and refresh images don't show. They are replaced with the classic Mac OS X '?' box. I have checked the paths of these images in the lightbox.js file and they are correct. Thanks in advance!

    Read the article

  • CollectionChanged notification across threads?

    - by Mark
    I'm writing a download manager using C#/WPF, and I just encountered this error: This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread. The basic flow of my program is that a few web pages/downloads are enqueued at the start, and then they're downloaded asynchronously. When an HTML page has completed downloading, I parse it and look for more stuff to download, then enqueue it directly from within the worker thread. I get that error when trying to send out the CollectionChanged event on my customized queue class. However, I need to fire that event so that the GUI can get updated. What are my options?

    Read the article

  • How to use SMS content provider? Where are the docs?

    - by Mark
    Hi, I'd like to be able to read the system's SMS content provider. Basically I wanted to make an SMS messaging app, but it would only be useful if I could see past threads etc. It seems like there's a content provider for this, but I can't find documentation for it - anyone know where that is? Thanks -------- edit ----------- Ok I found a way to get the sms inbox provider, and I just dumped all the column names in that provider, looks like this: Uri uriSms = Uri.parse("content://sms/inbox"); Cursor c = context.getContentResolver().query(uriSms, null,null,null,null); // column names for above provider: 0: _id 1: thread_id 2: address 3: person 4: date 5: protocol 6: read 7: status 8: type 9: reply_path_present 10: subject 11: body 12: service_center 13: locked I'm just piecing this together from random threads I find around the net, I'm really wondering where this is all documented (if at all)? Thanks again

    Read the article

  • Google Maps and Json structure

    - by mark
    I found a great script to plot markers on Google Maps. It uses an Json file to laod it. The problem is I don't know what the structure looks like in this case. Can you help? function loadMarkers() { var bounds = map.getBounds(); var zoomLevel = map.getZoom(); $.post("/gmaps/markers/index.php", {zoom: zoomLevel, swLat: bounds.getSouthWest().lat(), swLon: bounds.getSouthWest().lng(), neLat: bounds.getNorthEast().lat(), neLon: bounds.getNorthEast().lng()}, function(data) { processMarkers(data, _smallMarkerSize); }, "json" ); } function processMarkers(webcams, markerSize) { var marker = null; var markersInView = new Array(); var idsInView = new Array(); // Loop through the new webcams for (var i = 0; i < webcams.length; i++) { var idx = markers.indexOf(webcams[i].id); if (idx == -1) { var info_html = "<table class='infowindow'>"; info_html += "<tr><td class='img'>"; info_html += "<img src='" + webcams[i].smallimg + "' /><td>"; info_html += "<td><p><b>" + webcams[i].loc + "</b>"; info_html += "<br /><a href='/webcam/" + webcams[i].url + "' target='_blank'>Show webcam</a></p></td></tr>"; info_html += "</table>"; marker = new WebcamMarker(new GLatLng(webcams[i].latitude, webcams[i].longitude), {image: "" + webcams[i].smallimg + "", height: markerSize, width: markerSize}); marker.myhtml = info_html; map.addOverlay(marker); markersInView[webcams[i].id] = marker; } else { markersInView[webcams[i].id] = markers[webcams[i].id]; } idsInView.push(webcams[i].id); } // Now remove the markers outside of the viewport for (var i = 0; i < webcamids.length; i++) { var idx = markersInView.indexOf(webcamids[i]); if (idx == -1) { marker = markers[webcamids[i]]; map.removeOverlay(marker); } } markers = markersInView; webcamids = idsInView; }

    Read the article

  • embedded Italic, bold fonts don't look the same in flex as in Windows...

    - by Mark
    ...unless they're something like "Times New Roman" or some other established font with a fully designed italic and bold, presumably in seperate files. Let me explain what I mean (though why no one has commented on this before I have no idea.) Numerous, numerous fonts do not have a seperate file for italic and bold, and in fact to the best of my knowledge don't even have italic and bold defined as such. But if you install them on windows (for example) and then use them in an app, You can still make use of italic and bold with those fonts. For italic, and oblique angle is just given to it, presumably by Windows, and it looks the same in all Windows apps, and the bold is just given a heavier weight. OK, well here's the problem: if you embed a font like that in a Flex app, as a "SystemFont" the italic and bold will not look the same as they do in Windows. Specifically, the oblique angle is invariably much less than in Windows (i.e the italic slant is much less) and the bold version is not bold enough. I vaguely recall thinking that there was some flex mechanism to assign custom oblique angles for italic (and weight for bold) but now can't recall what it is. Does anyone know the correct established way to do this. The following is actually a seperate (but related) font question (in case anyone is expert in all this.) Its rather a lengthy question and can be skipped, but its something that's plagued me for a long time. I mention above embedding as a "SystemFont", so iow something like this: package fonts { import flash.display.Sprite; public class FLW_Script_I extends Sprite { [Embed(systemFont='FLW Script', fontName='FLW Script', fontStyle='italic', fntWeight='normal', mimeType='application/x-font-truetype')] public var wrFont:Class; } } The other alternative to SystemFont for embedding, is "Source" followed by the name of an actual font file. If you try to embed one of the aformentioned single file fonts as a Source file (as opposed to SystemFont) and specify fontStyle='italic', then the mxmlc compiler will return an error and say there is no italic info in the font file. So up to now I have only been embedding these fonts as "SystemFont". The problem is, flex uses two different font compilers internally for Source embedding and SystemFont embedding. For source font embeds it uses the "Batik" compiler and for SystemFont, the JRE (Java Runtime) font compiler. Well actually the Batik is considered a superior compiler and generally produces better looking fonts. And also if you mix normal fonts compiled with Batik and italic compiled with JRE, sometimes the line spacing is different for the two, and it doesn't look right. So does anyone have an idea how to get mxmlc to do italic and bold for these single file fonts when embedding as "Source". Would there be a way using C++ or whatever to construct an "italic" font file from the SystemFont for such a font in windows.

    Read the article

  • Python: Get items at depth? (set library?)

    - by Mark
    I have a nested list something like this: PLACES = ( ('CA', 'Canada', ( ('AB', 'Alberta'), ('BC', 'British Columbia' ( ('van', 'Vancouver'), ), ... )), ('US', 'United States', ( ('AL', 'Alabama'), ('AK', 'Alaska'), ... I need to retrieve some data out of it. If depth is 0 I need to retrieve all the countries (and their codes), if depth == 1, I need to retrieve all the states/provinces, if depth == 2 I need to retrieve all the cities... and so forth. Is there some set library for doing stuff like this? Or can someone point me in the right direction? I started coding up a solution only to realize it wouldn't work for levels deeper than 1 because you have to go in and out of each list...

    Read the article

  • Python named print?

    - by Mark
    I know it's a really simple question, but I have no idea how to google it. how can I do print '<a href="%s">%s</a>' % (my_url) So that my_url is used twice? I assume I have to "name" the %s and then use a dict in the params, but I'm not sure of the proper syntax? just FYI, I'm aware I can just use my_url twice in the params, but that's not the point :)

    Read the article

  • Artificially create a connection timeout error

    - by Mark Ingram
    I've had a bug in our software that occurs when I receive a connection timeout. These errors are very rare (usually when my connection gets dropped by our internal network). How can I generate this kind of effect artificially so I can test our software? If it matters the app is written in C++/MFC using CAsyncSocket classes. Edit: I've tried using a non-existant host, and I get the socket error: WSAEINVAL (10022) Invalid argument My next attempt was to use Alexander's suggestion of connecting to a different port, e.g. 81 (on my own server though). That worked great. Exactly the same as a dropped connection (60 second wait, then error). Thank you!

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >