Search Results

Search found 532 results on 22 pages for 'anthony garand'.

Page 16/22 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Python function correctly/incorrectly?

    - by Anthony Kernan
    I'm just starting too use python, learning experience. I know the basics logic of programming. I have a function in python that is running everytime, even when it's not supposed to. I use an if statement in the beginning of the function. I don't know why this if statement is not working, confused. I have another function that is similar and works correctly. Am I missing something simple? Here's the function that is not working... def check_artist_art(): if os.path.exists("/tmp/artistinfo") and open("/tmp/artistinfo").read() != title: #if artist == "": if os.path.exists(home + "/.artist"): os.remove(home + "/.artist") if os.path.exists("/tmp/artistinfo"): os.remove("/tmp/artistinfo") print artist return False else: os.path.exists("/tmp/artistinfo") and open("/tmp/artistinfo").read() == artist return False return True And this is the similar function that is working correctly.. def check_album(): if os.path.exists("/tmp/albuminfo") and open("/tmp/albuminfo").read() != album: if os.path.exists(home + "/.album"): os.remove(home + "/.album") if os.path.exists("/tmp/albuminfo"): os.remove("/tmp/albuminfo") return False elif os.path.exists("/tmp/trackinfo") and open("/tmp/trackinfo").read() == artist + album: return False return True Any help is greatly appreciated.

    Read the article

  • Can you control pinterest's "find image" results?

    - by anthony
    Rather than add Pin It buttons through our site, I would like to simply control what images show up in Pinterest's "Find Image" results if a user decides to pin one of our URLs. As of now, "Find Images" allows the user to scroll through the images it finds on the page so they can select which image to pin. The "found" images start with the first jpg in the html file, I'm assuming (could that be a bad assumption??). On our site, this forces a user to scroll through about 15 navigation and promotion images before arriving at the featured product image. Is there any way to specify this image to show first in those results? Maybe through a meta tag, or by adding a class or id to the element? Without a public Pinterest API, this seems like just guesswork, but I wanted to see if anyone else has run into this, or solved this. Thanks.

    Read the article

  • UIActivityViewController 101

    - by Anthony Guay
    I'm starting to get familiar with the new iOS 6 way to share: UIActivityViewController (the same as when you share a photo from the native iOS photo app), but I'm experiencing a few problems. First, when I choose to share via email, I can't find a way to set the subject of the email. Second, when I post on twitter, I can't find how to post a URL (except explicitly writing it in a NSString). Before, on iOS 5, I was using MFMailComposeViewController for Mail and SLComposeViewController for Twitter. It worked well. If there's no way to choose the subject with UIActivityViewController, could there be a way that I put my own custom buttons on the ActivityViewController, buttons that will call MFMailComposeViewController and SLComposeViewController when touched? I'm just speculating here. Thanks!

    Read the article

  • Google map - How to escape charaters in the title of a marker in a google map?

    - by Anthony
    Say have this piece of code: var marker = new google.maps.Marker({ position: location, title: 'B&#250;fals', map: map }); This creates a marker as expected but if I hover the mouse over it I don’t see 'Búfals' as I would expect (instead I see the html code). This doesn't make any difference: var marker = new google.maps.Marker({ position: location, title: unescape('B&#250;fals'), map: map }); Any ideas? Thanks.

    Read the article

  • Does a lazy-programmer file auto-generator tags exist?

    - by Anthony Forloney
    I was wondering (if possible) if there was a program/tool/utility that when I create a new file and provide it with an extension that it creates the tags automatically? For example, a new file I create called index.php would have the appropriate tags auto-generated inside: <?php ?> I hope you get the idea. Does one, or could one, exist, preferably Windows based? Any information regarding this would be helpful.

    Read the article

  • JQuery validation with default input.

    - by Anthony
    I am using this technique to place default input in the text fields as a hint to users. http://www.dailycoding.com/Posts/default_text_fields_using_simple_jquery_trick.aspx I would like to also validate the fields using jquery validate. How can i get the validater to ignore the default input?

    Read the article

  • Redirect based on Accept-Language

    - by Anthony Faull
    I need to honor the web browser's list of language preferences. Supported languages are English and French. For example: http_accept_language="jp-JP;fr;en-US;en" redirects to a directory called /French/. How can I do this with rewrite rules in my .htaccess file?

    Read the article

  • Trouble decoding JSON string with PHP

    - by Anthony
    I'm trying to send an array of objects from JS to PHP using JSON. I have an array of players as follows: var player; var players = new Array(); //loop for number of players player = new Object(); player.id = theID; players[i] = player; Then my AJAX call looks like this: JSONplayers = JSON.stringify(players); $.ajax({ type: "POST", url: "php/ajax_send_players.php", data: { "players" : JSONplayers } On the PHP side the decode function looks like this $players = $_REQUEST['players']; echo var_dump($players); $players = json_decode($players); echo 'players: ' .$players. '--'. $players[0] . '--'. $players[0]->id; Debugging in chrome, the JSON players var looks like this before it is sent: JSONplayers: "[{"id":"Percipient"},{"id":"4"}]" And when I vardump in PHP it looks OK, giving this: string(40) "[{\"id\":\"Percipient\"},{\"id\":\"4\"}]" But I can't access the PHP array, and the echo statement about starting with players: outputs this: players: ---- Nothing across the board...maybe it has something to do with the \'s in the array, I am new to this and might be missing something very simple. Any help would be greatly appreciated. note I've also tried json_decode($players, true) to get it as an assoc array but get similar results.

    Read the article

  • Does a lazy-programmer "document template" with tags exist for Windows?

    - by Anthony Forloney
    I was wondering (if possible) if there was a program/tool/utility that when I create a new file and provide it with an extension that it creates the tags automatically? For example, a new file I create called index.php would have the appropriate tags auto-generated inside: <?php ?> I hope you get the idea. Does one, or could one, exist, preferably Windows based? Any information regarding this would be helpful.

    Read the article

  • Oauth : Get user's permissions without any redirection to a server.

    - by Anthony
    Hello, in my website, I want to add a "invite friend of my contacts book" functionnality. I would like that the user fills the loggin form in my website. Then the website contacts Google Mail, Yahoo Mail, Live Mail and retrieves the contact list. In the Oauth protocole supported by Google and Yahoo, the user is redirected to a Google or Yahoo page (like Facebook) in order to permit the user to give permissions. But I saw two websites which didn't any redirections to get the contacts book (LinkedIn for a Google mail account and Theauteurs with a live mail.) Do you know how I can get a contacts book without redirect the user to Google, Microsoft or Yahoo website.

    Read the article

  • Android: Custom Clock widget Service work-around?

    - by Anthony Forloney
    I was interested in developing a clock widget for the homescreen and upon reading Home Screen Widgets tutorial, is there a pre-existing Service I could reference for updating the current time rather than re-inventing the wheel? I have currently Retro Clock on my android phone and noticed that when I click it, it pops up the Alarm Clock settings, but with the default Google Analog Clock widget, upon click does nothing. Is that because the Retro Clock widget implements the Alarm Clock service? If so, how can I go about referencing that service? Or do I have this all wrong and misunderstood? Any help is appreciated. EDIT: I believe implementing the service to update the clock would drain the battery life tremendously, any ideas on a work around or help shed some light on any performance issues with using Service?

    Read the article

  • jQuery UI dialog + WebKit + HTML response with script

    - by Anthony Koval'
    Once again I am faced with a great problem! :) So, here is the stuff: on the client side, I have a link. By clicking on it, jQuery makes a request to the server, gets response as HTML content, then popups UI dialog with that content. Here is the code of the request-function: function preview(){ $.ajax({ url: "/api/builder/", type: "post", //dataType: "html", data: {"script_tpl": $("#widget_code").text(), "widgets": $.toJSON(mwidgets), "widx": "0"}, success: function(data){ //console.log(data) $("#previewArea").dialog({ bgiframe: true, autoOpen: false, height: 600, width: 600, modal: true, buttons: { "Cancel": function() { $(this).dialog('destroy'); } } }); //console.log(data.toString()); $('#previewArea').attr("innerHTML", data.toString()); $("#previewArea").dialog("open"); }, error: function(){ console.log("shit happens"); } }) } The response (data) is: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript">var smakly_widget_sid = 0 ,widgets = [{"cols": "2","rows": "2","div_id": "smakly_widget","wid": "0","smakly_style": "small_image",}, ] </script> <script type="text/javascript" src="/media/js/smak/smakme.js"></script> </head> <body> preview <div id="smakly_widget" style="width:560px;height:550px"> </div> </body> </html> As you see, there is a script to load: smakme.js, somehow it doesn't execute in WebKit-based browsers (I tried in Safari and Chrome), but in Firefox, Internet Explorer and Opera it works as expected! Here is that script: String.prototype.format = function(){ var pattern = /\{\d+\}/g; var args = arguments; return this.replace(pattern, function(capture){ return args[capture.match(/\d+/)]; }); } var turl = "/widget" var widgetCtrl = new(function(){ this.render_widget = function (w, content){ $("#" + w.div_id).append(content); } this.build_widgets = function(){ for (var widx in widgets){ var w = widgets[widx], iurl = '{0}?sid={1}&wid={2}&w={3}&h={4}&referer=http://ya.ru&thrash={5}'.format( turl, smakly_widget_sid, w.wid, w.cols, w.rows, Math.floor(Math.random()*1000).toString()), content = $('<iframe src="{0}" width="100%" height="100%"></iframe>'.format(iurl)); this.render_widget(w, content); } } }) $(document).ready(function(){ widgetCtrl.build_widgets(); }) Is that some security issue, or anything else?

    Read the article

  • starting a windows executable via batch script, exe not in Program Files

    - by Anthony
    This is probably batch scripting 101, but I can't find any clear explanation/documentation on why this is happening or if my workaround is actually the solution. So basically any terminology or links to good sources is really appreciated. So I have a program I want to execute via batch script (along with several other programs). It's the only one where the exe is not in a Program Files folder. I can get it to start like this: C:\WeirdProgram\WeirdProgramModule\weirdmodule.exe But I get an error along the lines of: Run-time Error '3024': Could not find file C:\Users\MyUserName\Desktop\ModuleSettings.mdb So it seems that the program is looking for its settings files from the same location that the batch script starts up. Given that I finally got everything to work by doing the following: cd C:\WeirdProgram\WeirdProgramModule\ weirdmodule.exe That works fine, and it's not the end of the world to have to go this route (just one extra line), but I've convinced myself that I'm doing something wrong based on lack of basic understanding. Anybody know or can point me to why it works this way? Oh, and doing the following: start "C:\WeirdProgram\WeirdProgramModule\weirdmodule.exe" doesn't do anything at all. Thanks,

    Read the article

  • jquery append() method on empty XML element

    - by Anthony
    This could just be a syntax error, but I'm trying to create a Document object from scratch, starting with document.implementation.createDocument() and then using jquery's append() method to add the elements. But it's not appending: var myDoc = document.implementation.createDocument("", 'stuff', null); $("stuff",myDoc).attr("test","tested"); $("stuff",myDoc).append("<test>A</test>"); $("<test>B</test>").appendTo("stuff",soapEnv); var s = new XMLSerializer(); alert(s.serializeToString(soapEnv)); This should output: <stuff test="tested"> <test>A</test> <test>B</test> </stuff> But instead it outputs: <stuff test="tested" /> So the selector seems to be working, just not the method. My only guess is the method doesn't account for the fact that elements are empty (<stuff />) until they have children. But that's just a guess.

    Read the article

  • Adding relative week number column to MySQl results

    - by Anthony
    I have a table with 3 columns: user, value, and date. The main query returns the values for a specific user based on a date range: SELECT date, value FROM values WHERE user = '$user' AND date BETWEEN $start AND $end What I would like is for the results to also have a column indicating the week number relative to the date range. So if the date range is 1/1/2010 - 1/20/2010, then any results from the first Sun - Sat of that range are week 1, the next Sun - Sat are week 2, etc. If the date range starts on a Saturday, then only results from that one day would be week 1. If the date range starts on Thursday but the first result is on the following Monday, it would be week 2, and there are no week 1 results. Is this something fairly simple to add to the query? The only ideas I can come up with would be based on the week number for the year or the week number based on the results themselves (where in that second example above, the first result always gets week 1).

    Read the article

  • What's the best way to fix memory leaks on the iPhone?

    - by Anthony Glyadchenko
    I'm trying to use XCode's Leaks utility to fix some memory leaks in my code. Is there a better and more understandable way to check for leaks with explanations that pinpoint the exact line and/or offer suggestions? Another question, I'm using AVAudioRecorder in my code in one of my view controllers. Should I load the recorder in viewDidLoad or in viewWillAppear?

    Read the article

  • What is the best practice to segment c#.net projects based on a single base project

    - by Anthony
    Honestly, I can't word my question any better without describing it. I have a base project (with all its glory, dlls, resources etc) which is a CMS. I need to use this project as a base for othe custom bake projects. This base project is to be maintained and updated among all custom bake projects. I use subversion (Collabnet and Tortise SVN) I have two questions: 1 - Can I use subversion to share the base project among other projects What I mean here is can I "Checkout" the base project into another "Checked Out" project and have both update and commit seperatley. So, to paint a picture, let's say I am working on a custom project and I modify the core/base prject in some way (which I know will suit the others) can I then commit those changes and upon doing so when I update the base project in the other "Checked out" resources will it pull the changes? In short, I would like not to have to manually deploy updated core files whenever I make changes into each seperate project. 2 - If I create a custom file (let's say an webcontrol or aspx page etc) can I have it compile seperatley from the base project Another tricky one to explain. When I publish my web application it creates DLLs based on the namespaces of projects attached to it. So I may have a number of DLLs including the "Website's" namespace DLL, which could simply be website. I want to be able to make a seperate, custom, control which does not compile into those DLLs as the custom files should not rely on those DLLS to run. Is it as simple to set a seperate namespace for those files like CustomFiles.ProjectName for example? Think of the whole idea as adding modules to the .NET project, I don't want the module's code in any of the core DLLs but I do need for module to be able to access the core dlls. (There is no need for the core project to access the module code as it should be one way only in theory, though I reckon it woould not be possible anyway without using JSON/SOAP or something like that, maybe I am wrong.) I want to create a pluggable environment much like that of Joomla/Wordpress as since PHP generally doesn't have to be compiled first I see this is the reason why all this is possible/easy. The idea is to allow pluggable themes, modules etc etc. (I haven't tried simply adding .NET themes after compile/publish but I am assuming this is possible anyway? OR does the compiler need to reference items in the files?)

    Read the article

  • How do I group a SSRS report by month?

    - by Anthony K
    I have a set of data that includes a field with the datetime that events happen. i want to group the events by month. I haven't come across a simple and elegant expression to achieve this. So far all I can come up with is to convert the field to a date, then take the year and month as integers and then convert this back to a string with the day set to 1. In Crystal Reports I would group on the datetime field and then set the period to month, very easy. I am sure there is an easy answer to this that I haven't been able to find.

    Read the article

  • Java "Pool" of longs or Oracle sequence with reusable values

    - by Anthony Accioly
    Several months ago I implemented a solution to choose unique values from a range between 1 and 65535 (16 bits). This range is used to generate unique Route Targets suffixes, which for this customer massive network (it's a huge ISP) are a very disputed resource, so any free index needs to become immediately available to the end user. To tackle this requirement I used a BitSet. Allocate on the RT index with set and deallocate a suffix with clear. The method nextClearBit() can find the next available index. I handle synchronization / concurrency issues manually. This works pretty well for a small range... The entire index is small (around 10k), it is blazing fast and can be easy serialized into a Blob field. The problem is, some new devices can handle RTs of 32 bits (range 1 / 4294967296). Which can't be managed with a BitSet (it would, by itself, consume around 600Mb, plus be limited to int range). Even with this massive range available, the client still wants to free available Route Targets for the end user, mainly because the lowest ones (up to 65535) - which are compatible with old routers - are being heavily disputed. Before I tell the customer that this is impossible and he will have to conform with my reusable index for lower RTs (up to 65550) and use a database sequence for the other ones (which means that when the user frees a Route Target, it will not become available again). Would anyone shed some light? Maybe some kind soul already implemented a high performance number pool for Java (6 if it matters), or I am missing a killer feature of Oracle database (11R2 if it matters)... Wishful thinking. Thank you very much in advance.

    Read the article

  • YouTube API, jQuery attr won't swap element attributes (I think) in IE, but works in FF

    - by Anthony
    JavaScript (jQuery) function display_youtube(new_url) { $('#movie_url').removeAttr('value'); $('#embed_url').removeAttr('src'); $(document).ready(function() { $('#movie_url').attr('value', new_url); $('#embed_url').attr('src', new_url); $('#shade').css('display', 'block'); $('#youtube_player').css('display', 'block'); $('#exit_youtube').css('display', 'block'); }); } HTML <object width="720" height="480"> <param id="movie_url" name="movie" value="http://www.youtube.com/v/_eaToCSn7yU?f=user_uploads&app=youtube_gdata&autoplay=0" /> <param name="allowFullScreen" value="true" /> <param name="allowscriptaccess" value="always" /> <embed id="embed_url" src="http://www.youtube.com/v/_eaToCSn7yU?f=user_uploads&app=youtube_gdata&autoplay=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="720" height="480" /> </object> Hyperlink <a href="javascript:display_youtube('http://www.youtube.com/v/_eaToCSn7yU?f=user_uploads&app=youtube_gdata&autoplay=1');">Click Here for Fun!</a> What I've done is parsed YouTube's API for the videos on my user channel. The hyperlink above is php generated, meant to trigger the above JavaScript function, and swap the url from attributes contained in ids "movie_url" and "embed_url". Works just like it should in FF, but IE will only perform the .css commands. My guess? IE doesn't like me assigning IDs to PARAM and EMBED, perhaps? What do you think?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22  | Next Page >