Search Results

Search found 3484 results on 140 pages for 'chris dubois'.

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

  • For what purposes have YOU used T4?

    - by Chris Melinn
    T4 has existed for several years in Visual Studio, but doesn't get a lot of attention. However, for those that know it, there seems to be some very creative and useful purposes. I am researching some different ways that T4 is used, and I would appreciate to hear how YOU may have used it for real life scenarios. I am primarily interested in non-standard and creative uses. Some interesting examples: Phil Haack uses T4 to create static CSS files from .less To Generate WPF and Silverlight Dependency Properties using T4 Templates Note: I realize this is a discussion-oriented question, but the answers could be helpful to others. I have tagged it as subjective and also marked as "community wiki", so please allow the question to remain open. Thanks!

    Read the article

  • SQL Query to select upcoming events with a start and end date

    - by Chris T
    I need to display upcoming events from a database. The problem is when I use the query I'm currently using any events with a start day that has passed will show up lower on the list of upcoming events regardless of the fact that they are current My table (yaml): columns: title: type: string(255) notnull: true default: Untitled Event start_time: type: time end_time: type: time start_day: type: date notnull: true end_day: type: date description: type: string(500) default: This event has no description category_id: integer My query (doctrine): $results = Doctrine_Query::create() ->from("sfEventItem e, e.Category c") ->select("e.title, e.start_day, e.description, e.category_id, e.slug") ->addSelect("c.title, c.slug") ->orderBy("e.start_day, e.start_time, e.title") ->limit(5) ->execute(array(), Doctrine_Core::HYDRATE_ARRAY); Basically I'd like any events that is currently going on (so if today is in between start_day and end_day) to be at the top of the list. How would I go about doing this if it's even possible? Raw sql queries are good answers too because they're pretty easy to turn into DQL.

    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

  • What's the best way to use hamcrest-AS3 to test for membership in an IList?

    - by Chris R
    I'm using Flex 3.3, with hamcrest-as3 used to test for item membership in a list as part of my unit tests: var myList: IList = new ArrayCollection(['a', 'b', 'c']).list; assertThat(myList, hasItems('a', 'b', 'c')); The problem is that apparently the IList class doesn't support for each iteration; for example, with the above list, this will not trace anything: for each (var i: * in myList) { trace (i); } However, tracing either an Array or an ArrayCollection containing the same data will work just fine. What I want to do is (without having to tear apart my existing IList-based interface) be able to treat an IList like an Array or an ArrayCollection for the purposes of testing, because that's what hamcrest does: override public function matches(collection:Object):Boolean { for each (var item:Object in collection) { if (_elementMatcher.matches(item)) { return true; } } return false; } Is this simply doomed to failure? As a side note, why would the IList interface not be amenable to iteration this way? That just seems wrong.

    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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • .Net SQL Server Connection String - hide password from other developers

    - by Chris Klepeis
    We're migrating one of our sites to ASP.Net. We do not want to use integrated security, which uses the windows account to connect to sql server (not going to get into why, its just out of the question). We created a username and password to connect to SQL Server, and would like to use that username and password, however, we also do not want other developers to see this information (easily read from the web.config).... I know it can be encrypted, but it can just as easily be decrypted by the developers - plus encryption has a performance hit. Is there any solution to this problem?

    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

  • PHP login, getting wrong count value from query / fetch array

    - by Chris
    Hello, *EDIT*Thanks to the comments below it has been figured out that the problem lies with the md5, without everything works as it should. But how do i implent the md5 then? I am having some troubles with the following code below to login. The database and register system are already working. The problem lies that it does not find any result at all in the query. IF the count is 0 it should redirect the user to a secured page. But this only works if i write count = 0, but this should be 0 , only if the user name and password is found he should be directed to the secure (startpage) of the site after login. For example root (username) root (password) already exists but i cannot seem to properly login with it. <?php session_start(); if (!empty($_POST["send"])) { $username = ($_POST["username"]); $password = (md5($_POST["password"])); $count = 0; $con = mysql_connect("localhost" , "root", ""); mysql_select_db("testdb", $con); $result = mysql_query("SELECT name, password FROM user WHERE name = '".$username."' AND password = '".$password."' ") or die("Error select statement"); $count = mysql_num_rows($result); if($count > 0) // always goes the to else, only works with >=0 but then the data is not found in the database, hence incorrect { $row = mysql_fetch_array($result); $_SESSION["username"] = $row["name"]; header("Location: StartPage.php"); } else { echo "Wrong login data, please try again"; } mysql_close($con); } ?>

    Read the article

  • In PHP can I check a boolean on a function call?

    - by Chris
    I have a function which checks the passed value and returns false or true, if false I want it to add something to an array. The code I've written is below. if(!check_input($_POST['username'])){ $errors[] = "Username"; } Right now it adds to my array anyway, regardless of what is entered in the form. Is the way I've written that the correct way to check if the return from check_input() is false? I've checked the function's logic by altering the returns to echoes and it's returning the correct value, I'm just not sure if I'm checking it wrong. I'd previously attempted to write it as $X=check_input etc, and then if(check_value == false) but that doesn't seem to give me the desired result either. Hmmm a quick pointer please!

    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

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