Search Results

Search found 3479 results on 140 pages for 'chris condy'.

Page 117/140 | < Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >

  • Protecting routes with authentication in an AngularJS app

    - by Chris White
    Some of my AngularJS routes are to pages which require the user to be authenticated with my API. In those cases, I'd like the user to be redirected to the login page so they can authenticate. For example, if a guest accesses /account/settings, they should be redirected to the login form. From brainstorming I came up with listening for the $locationChangeStart event and if it's a location which requires authentication then redirect the user to the login form. I can do that simple enough in my applications run() event: .run(['$rootScope', function($rootScope) { $rootScope.$on('$locationChangeStart', function(event) { // Decide if this location required an authenticated user and redirect appropriately }); }]); The next step is keeping a list of all my applications routes that require authentication, so I tried adding them as parameters to my $routeProvider: $routeProvider.when('/account/settings', {templateUrl: '/partials/account/settings.html', controller: 'AccountSettingCtrl', requiresAuthentication: true}); But I don't see any way to get the requiresAuthentication key from within the $locationChangeStart event. Am I overthinking this? I tried to find a way for Angular to do this natively but couldn't find anything.

    Read the article

  • How do I automatically update hundreds of images in an HTML page using jquery?

    - by Chris
    I have an HTML page where I want to refresh a lot of images every 30 seconds after the HTML page has been downloaded. I understand how to do this with Jquery and a single image, but I want to use about 200 custom urls to determine the current image to display for over 200 images. I need to find an efficient way to have jquery call the custom url associated with each image to download the url for the needed image as it changes, and then update the image in the page when it changes. Current hyperlink example to demonstrate the custom urls. <A href="/urlThatReturnsCurrentImageURL/1234/4567">link to url for image</A> Each custom url will return an image tag like this (or any other text that makes this simpler for jquery) <img src="/static/someImage.jpg"> What is the simplest way to have jquery call the custom url for each image to download the image url, image html, or some other text that jquery can use to download the right image every 30 seconds? Please keep in mind that I will have about 200 of these on a page.

    Read the article

  • Media Disconnected Networking Issue

    - by Chris
    After rearranging my physical network in my apartment my Windows Vista machine can no longer connect to the network. I have tested all of the cabling by connecting other devices and everything is fine. I'm able to connect using other computers, I've even tested a brand new ethernet adapter and the network status still reads "media disconnected". I have no idea where to go from here. My setup is as follows: Cable modem - router - hardwired ethernet cable to computer.

    Read the article

  • Get drop down selection from GridView on button press

    - by Chris Stewart
    I have an ASP.NET GridView that has four columns. The first three are typical BoundField elements bound to a DataTable. The forth is a TemplateField element that I create a DropDownList in on the OnRowCreated event for the GridView. What I'm attempting to do is walk down the data source for the GridView when a button is pressed. I really just need to get the values for columns one and four of each row. The first three columns have data as expected but the forth is displaying as empty. Is this because it wasn't a part of the DataTable originally? Is there any way to get the value for each drop down as I've described it, or will I need to rework this so each drop down list is a part of the DataTable?

    Read the article

  • [MS Access 2003 SQL] Switch is causing #error, why and how can I fix it...

    - by Chris
    I have 3 fields in my table: start, end (dates) and length (number, might be blank). My Aim is to calculate an end date using start and length where end doesn't exist... I have: SELECT Switch((g.length<>0) And IsDate(g.end),DateAdd("m",g.length,g.start)) AS field FROM table g If there is no start, end or length, Access displays blank - this is fine. If there is no end, but start and length are ok, the calculated date is shown - again fine. BUT If there is no end, or length, but a start exists, access displays #Error I don't understand why, and can't fix it, please help!

    Read the article

  • Why does setting document.domain require me to set it in all popups and iframes too?

    - by Chris
    I'm using a long-polling iframe solution for a chat script. Unfortunately, this requires me to set document.domain='yourdomain.com' in the iframe and main document, because the iframe is a subdomain call. The huge problem is...now all my other scripts that use popups and iframes are broken. They now require me to put document.domain in them too. It does fix it, but this is not an ideal solution at all. Is there another way around this problem?

    Read the article

  • How can I remove this query from within a loop?

    - by Chris
    I am currently designing a forum as a personal project. One of the recurring issues I've come across is database queries in loops. I've managed to avoid doing that so far by using table joins or caching of data in arrays for later use. Right now though I've come across a situation where I'm not sure how I can write the code in such a way that I can use either of those methods easily. However I'd still prefer to do at most 2 queries for this operation rather than 1 + 1 per group of forums, which so far has resulted in 5 per page. So while 5 isn't a huge number (though it will increase for each forum group I add) it's the principle that's important to me here, I do NOT want to write queries in loops What I'm doing is displaying forum index groupings (eg admin forums, user forums etc) and then each forum within that group on a single page index, it's the combination of both in one page that's causing me issue. If it had just been a single group per page, I'd use a table join and problem solved. But if I use a table join here, although I can potentially get all the data I need it'll be in one mass of results and it needs displaying properly. Here's the code (I've removed some of the html for clarity) <?php $sql= "select * from forum_groups"; //query 1 $result1 = $database->query($sql); while($group = mysql_fetch_assoc($result1)) //first loop {?> <table class="threads"> <tr> <td class="forumgroupheader"> <?php echo $group['group_name']; ?> </td> </tr> <tr> <td class="forumgroupheader2"> <?php echo $group['group_desc']; ?> </td> </tr> </table> <table> <tr> <th class="thforum"> Forum Name</th> <th class="thforum"> Forum Decsription</th> <th class="thforum"> Last Post </th> <tr> <?php $group_id = $group['id']; $sql = "SELECT forums.id, forums.forum_group_id, forums.forum_name, forums.forum_desc, forums.visible_rank, forums.locked, forums.lock_rank, forums.topics, forums.posts, forums.last_post, forums.last_post_id, users.username FROM forums LEFT JOIN users on forums.last_post_id=users.id WHERE forum_group_id='{$group_id}'"; //query 2 $result2 = $database->query($sql); while($forum = mysql_fetch_assoc($result2)) //second loop {?> So how can I either a) write the SQL in such a way as to remove the second query from inside the loop or b) combine the results in an array either way I need to be able to access the data as an when so I can format it properly for the page output, ie within the loops still.

    Read the article

  • Python lxml - returns null list

    - by Chris Finlayson
    I cannot figure out what is wrong with the XPATH when trying to extract a value from a webpage table. The method seems correct as I can extract the page title and other attributes, but I cannot extract the third value, it always returns an empty list? from lxml import html import requests test_url = 'SC312226' page = ('https://www.opencompany.co.uk/company/'+test_url) print 'Now searching URL: '+page data = requests.get(page) tree = html.fromstring(data.text) print tree.xpath('//title/text()') # Get page title print tree.xpath('//a/@href') # Get href attribute of all links print tree.xpath('//*[@id="financial"]/table/tbody/tr/td[1]/table/tbody/tr[2]/td[1]/div[2]/text()') Unless i'm missing something, it would appear the XPATH is correct: Chrome screenshot I checked Chrome console, appears ok! So i'm at a loss $x ('//*[@id="financial"]/table/tbody/tr/td[1]/table/tbody/tr[2]/td[1]/div[2]/text()') [ "£432,272" ]

    Read the article

  • UITableView headings shown on top of MBProgressHUD

    - by Chris Ballinger
    So I have a subclass of UITableViewController that loads some data from the internet and uses MBProgressHUD during the loading process. I use the standard MBProgressHUD initialization. HUD = [[MBProgressHUD alloc] initWithView:self.view]; [self.view addSubview:HUD]; HUD.delegate = self; HUD.labelText = @"Loading"; [HUD show:YES]; This is the result: . Is there any way to resolve this issue, or should I just abandon MBProgressHUD? Thanks!

    Read the article

  • Find closest number in range?

    - by Chris
    What is the best way to find the closes value in a range... for example i have an array with 0, 90, 180, 270, 360.. And a number 46... What is the best way to find 90 in the array? (in actipnscript 3)

    Read the article

  • MySql mutliple tables

    - by Chris Harrison
    I've been looking into JOIN, subqueries and other ways of doing this, but I can't work out the best way to do this is... I have a table (ps_category_product): id_product, id_category I want to perform a query on it like: SELECT id_product FROM ps_category_product WHERE id_category='$this_cat' BUT, I only want to perform this query where the ID's are returned by a query on another table (ps_product): id_product, active SELECT id_product FROM ps_product WHERE active='1' Can anyone help me with getting these two queries working together?

    Read the article

  • How do I make TODO comments show up in the task list for C++ projects in Visual Studio 2010?

    - by Chris Simmons
    I'm trying to get my TODO comments to show up in the task list in Visual Studio 2010 for a C++ project, but they don't. I looked at this, but see no caveats other than the TODO comments need to be in the currently-open file. For example, creating a new Win32 console app places this: // TODO: reference additional headers your program requires here in a new file, stdafx.h. However, there's nothing in the task list. I have "Comments" chosen from the drop-down in the task list, but it's always empty. And it's not this problem; I can open the file and be looking at the TODO comment in the code editor and no task is shown. This is not a problem for C# projects as TODO comments show up as designed in those projects; this appears to be an issue specific to C++ projects. What else can I check?

    Read the article

  • naming a function that exhibits "set if not equal" behavior

    - by Chris Sears
    This might be an odd question, but I'm looking for a word to use in a function name. I'm normally good at coming up with succinct, meaningful function names, but this one has me stumped so I thought I'd appeal for help. The function will take some desired state as an argument and compare it to the current state. If no change is needed, the function will exit normally without doing anything. Otherwise, the function will take some action to achieve the desired state. For example, if wanted to make sure the front door was closed, i might say: my_house.<something>_front_door('closed') What word or term should use in place of the something? I'd like it to be short, readable, and minimize the astonishment factor. A couple clarifying points... I would want someone calling the function to intuitively know they didn't need to wrap the function an 'if' that checks the current state. For example, this would be bad: if my_house.front_door_is_open(): my_house.<something>_front_door('closed') Also, they should know that the function won't throw an exception if the desired state matches the current state. So this should never happen: try: my_house.<something>_front_door('closed') except DoorWasAlreadyClosedException: pass Here are some options I've considered: my_house.set_front_door('closed') my_house.setne_front_door('closed') # ne=not equal, from the setne x86 instruction my_house.ensure_front_door('closed') my_house.configure_front_door('closed') my_house.update_front_door('closed') my_house.make_front_door('closed') my_house.remediate_front_door('closed') And I'm open to other forms, but most I've thought of don't improve readability. Such as... my_house.ensure_front_door_is('closed') my_house.conditionally_update_front_door('closed') my_house.change_front_door_if_needed('closed') Thanks for any input!

    Read the article

  • How do I test the speed of a mySQL query?

    - by Chris
    I have a select and query like below... $sql = "SELECT * FROM notifications WHERE to_id='".$userid."' AND (alert_read != '1' OR user_read != '1') ORDER BY alert_time DESC"; $result = mysql_query($sql); how do I test how long the query took to run?

    Read the article

  • NoSQL vs Relational Coding Styles

    - by Chris Henry
    When building objects that make use of data stored in a RDBMS, it's normally pretty clear what you're getting back, as dictated by the tables and columns being queried. However, when dealing with NoSQL, document-based systems, it's less clear what is being retrieved. What are common methods of keeping track of structure in which data is stored?

    Read the article

  • Wordpress Hooks vs. includes?

    - by Chris J. Lee
    This is somewhat a subjective question. Noticed themes like thematic and carrington use hooks to display their themes. Trying to figure out which works best for a more efficient workflow. Which seems more efficient at theming? Trying to weigh in the cons and pros of hooks vs. just including static files.

    Read the article

  • Placing and removing element on array trough object

    - by Chris
    Hello, Lets assume i have 2 methods 1 that places a element on the array and one that removes it. const int Max = 10; int[] table= new int[Max]; I would like to call it up like this: s1.Place(5); // 5 0 0 0 0 0 0 0 0 0 0 s1.Place(9); // 5 9 0 0 0 0 0 0 0 0 0 s1.Remove(9); // 5 0 0 0 0 0 0 0 0 0 0 I would only like to use : using system for this. The result i get right now when i run the program is s1 = "nameofprogram" "name of class object" Normally i should get 0 0 0 0 0 0 0 0 0 0 to begin with. Any ideas how i can exactly add or remove those elements on the array? public void Place(int g) { if (top == Max) { throw new Exception("Stack overflow..."); } else { table[top] = g; top++; } .... Best Regards.

    Read the article

  • Proper mechanism for sending PHP errors to the client

    - by Chris
    Greetings, I was trying to discover a proper way to send captured errors or business logic exceptions to the client in an Ajax-PHP system. In my case, the browser needs to react differently depending on whether a request was successful or not. However in all the examples I've found, only a simple string is reported back to the browser in both cases. Eg: if (something worked) echo "Success!"; else echo "ERROR: that failed"; So when the browser gets back the Ajax response, the only way to know if an error occurred would be to parse the string (looking for 'error' perhaps). This seems clunky. Is there a better/proper way to send back the Ajax response & notify the browser of an error? Thank you.

    Read the article

  • What's the easiest way to create an extensible custom container in Flex?

    - by Chris R
    I want to create an MXML container component that has some of its own chrome -- a standard query display, et al -- and that supports the addition of child components to it. Something a lot like the existing mx:Panel class, which includes a title label, but acts like a plain mx:Box with regards to adding children. What's the easiest way to do this? Edit: To be clear, I want to be able to extend the container using MXML, so the "Multiple visual children" problem is relevant.

    Read the article

< Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >