Search Results

Search found 44 results on 2 pages for 'dixon crews'.

Page 2/2 | < Previous Page | 1 2 

  • Stack data storage order

    - by Jamie Dixon
    When talking about a stack in either computing or "real" life we usually assume a "first on, last off" type of functionality. Because the idea of a stack is based around something in the physical world, does it matter how the data in the stack is stored? I notice in a lot of examples that the storage of the stack data is quite often done using an array and the newest item added to the stack is placed at the bottom of the array. (like adding a new plate to an existing stack of plates except putting it underneath the other plates rather than on top). As a paradigm, does it matter in what order the data is stored within the stack as long as the operation of the stack acts as expected?

    Read the article

  • Returning value of static property from public instance property

    - by Jamie Dixon
    I was just playing around with some code in LINQPad and managed to crash the program with a stackoverflow exception. I basically created a static property in a class and used another property to return the value from an instance. The getter of my instance property would return the value of the static property, but the setter would set itself. When would this type of pattern be used and how come it generated a stackoverflow exception? Code example of what I did: void Main() { SomeClass myinstance = new SomeClass(); SomeClass.x = "Some Value"; myinstance.y = "Some other value"; myinstance.y.Dump(); } public class SomeClass { public static string x; public string y { get { return x; } set { y = value; } } }

    Read the article

  • HTML Encoding Blocks - Invalid expression term ':'

    - by Jamie Dixon
    Hey everyone, I'm developing a new ASP.NET MVC 2.0 application and wanting to use the new ASP.NET 4 encoding blocks. My View code contains <%: Model.ActivityName %> however Visual Studio is reporting: Unexpected toke at the position of the : (colon). When I run the application I get the following compilation error: Compiler Error Message: CS1525: Invalid expression term ':' What am i missing? Cheers for any help/advice.

    Read the article

  • Socket Lose Connection

    - by Dave Dixon
    I know Twisted can do this well but what about just plain socket? How'd you tell if you randomly lost your connection in socket? Like, If my internet was to go out of a second and come back on.

    Read the article

  • Twisted Python getPage

    - by David Dixon II
    I tried to get support on this but I am TOTALLY confused. Here's my code: from twisted.internet import reactor from twisted.web.client import getPage from twisted.web.error import Error from twisted.internet.defer import DeferredList from sys import argv class GrabPage: def __init__(self, page): self.page = page def start(self, *args): if args == (): # We apparently don't need authentication for this d1 = getPage(self.page) else: if len(args) == 2: # We have our login information d1 = getPage(self.page, headers={"Authorization": " ".join(args)}) else: raise Exception('Missing parameters') d1.addCallback(self.pageCallback) dl = DeferredList([d1]) d1.addErrback(self.errorHandler) dl.addCallback(self.listCallback) def errorHandler(self,result): # Bad thingy! pass def pageCallback(self, result): return result def listCallback(self, result): print result a = GrabPage('http://www.google.com') data = a.start() # Not the HTML I wish to get the HTML out which is given to pageCallback when start() is called. This has been a pita for me. Ty! And sorry for my sucky coding.

    Read the article

  • DataReader already open when using LINQ

    - by Jamie Dixon
    I've got a static class containing a static field which makes reference to a wrapper object of a DataContext. The DataContext is basically generated by Visual Studio when we created a dbml file & contains methods for each of the stored procedures we have in the DB. Our class basically has a bunch of static methods that fire off each of these stored proc methods & then returns an array based on a LINQ query. Example: public static TwoFieldBarData[] GetAgesReportData(string pct) { return DataContext .BreakdownOfUsersByAge(Constants.USER_MEDICAL_PROFILE_KEY, pct) .Select(x => new TwoFieldBarData(x.DisplayName, x.LeftValue, x.RightValue, x.TotalCount)) .ToArray(); } Every now and then, we get the following error: There is already an open DataReader associated with this Command which must be closed firs This is happening intermittently and I'm curious as to what is going on. My guess is that when there's some lag between one method executing and the next one firing, it's locking up the DataContext and throwing the error. Could this be a case for wrapping each of the DataContext LINQ calls in a lock(){} to obtain exclusivity to that type and ensure other requests are queued?

    Read the article

  • Int[] Reverse - What does this actually do?

    - by Jamie Dixon
    I was just having a play around with some code in LINQPad and noticed that on an int array there is a Reverse method. Usually when I want to reverse an int array I'd do so with Array.Reverse(myIntArray); Which, given the array {1,2,3,4} would then return 4 as the value of myIntArray[0]. When I used the Reverse() method directly on my int array: myIntArray.Reverse(); I notice that myIntArray[0] still comes out as 1. What is the Reverse method actually doing here?

    Read the article

  • How to embed cover art in an MP3 file so that the iPhone player displays it when downloaded

    - by Paul Dixon
    I want to be able to provide a URL to a music track, and when that track is played on an iPhone, to show the cover art. I've tried embedding the cover art as an ID3 v2.3 tag, and while desktop players like VLC and Windows Media Player can see it, it seems the iPhone doesn't. Is this possible? Does anyone know of a way to achieve this - preferably a method which can be automated? Edit: this may not be possible - even if I add cover art with iTunes, the resulting file will still not have the coverart displayed when played as a download :(

    Read the article

  • Eliminating static properties - What patterns do I have at my disposal?

    - by Jamie Dixon
    I currently have a type that I inject into my controllers that's used for getting and setting session data. I use this so that I can obtain relevant session information as _sessionData.Username rather than using Session["username"]. I'd like to use this session information across all of my views and would previously have done this by making the SessionData members static instead of injecting the SessionData class into my controller. I want to avoid using static members as well as having to pass the object to the view in each controller. What patterns best suit this type of scenario? What do you do to solve this same problem?

    Read the article

  • Agile version control?

    - by Paul Dixon
    I'm trying to work out a good method to manage code changes on a large project with multiple teams. We use subversion at the moment, but I want more flexibility in building a new release than I seem to be able to get with subversion. Here's roughly I want: for each developer to create easily identifiable patches for the project. Each patch delivers a complete user story (a releasable feature or fix). It might encompass many changes to many files. developers are able to easily apply and remove their own and other patches to facilitate testing release manager selects the patches to be used in the next release into a new branch branch is tested, fixes merged in, and ultimately merged into live teams can then pull these changes back down into their sandboxes. I'm looking at stacked git as a way of achieving this, but what other tools or techniques can deliver this sort of workflow?

    Read the article

  • Injecting a dependancy into a base class

    - by Jamie Dixon
    Hey everyone, I'm on a roll today with questions. I'm starting out with Dependency Injection and am having some trouble injecting a dependency into a base class. I have a BaseController controller which my other controllers inherit from. Inside of this base controller I do a number of checks such as determining if the user has the right privileges to view the current page, checking for the existence of some session variables etc. I have a dependency inside of this base controller that I'd like to inject using Ninject however when I set this up as I would for my other dependencies I'm told by the compiler that: Error 1 'MyProject.Controllers.BaseController' does not contain a constructor that takes 0 argument This makes sense but I'm just not sure how to inject this dependency. Should I be using this pattern of using a base controller at all or should I be doing this in a more efficient/correct way?

    Read the article

  • Updating database row from model

    - by Jamie Dixon
    Hey everyone, I'm haing a few problems updating a row in my database using Linq2Sql. Inside of my model I have two methods for updating and saving from my controller, which in turn receives an updated model from my view. My model methods like like: public void Update(Activity activity) { _db.Activities.InsertOnSubmit(activity); } public void Save() { _db.SubmitChanges(); } and the code in my Controller likes like: [HttpPost] public ActionResult Edit(Activity activity) { if (ModelState.IsValid) { UpdateModel<Activity>(activity); _activitiesModel.Update(activity); _activitiesModel.Save(); } return View(activity); } The problem I'm having is that this code inserts a new entry into the database, even though the model item i'm inserting-on-submit contains a primary key field. I've also tried re-attaching the model object back to the data source but this throws an error because the item already exists. Any pointers in the right direction will be greatly appreciated. UPDATE: I'm using dependancy injection to instantiate my datacontext object as follows: IMyDataContext _db; public ActivitiesModel(IMyDataContext db) { _db = db; }

    Read the article

  • Does it make sense to have a model with only static methods?

    - by Jamie Dixon
    Hey everyone, I have an ASP.NET MVC 2 project that I'm working on and I'm wondering where I should place some of my code. I currently have a UsersModel which consists of a bunch of static methods that operate against my data context. These methods include such things as: UserExistsInDatabase, UserIsRegisteredForActivity, GetUserIdFromFacebookId etc etc. Should these methods be inside a UsersModel class or would they be more suited to a user helper class outside of the models context? Cheers for any pointers.

    Read the article

  • need to print 5 column list in alpha order, vertically

    - by Brad
    Have a webpage that will be viewed by mainly IE users, so CSS3 is out of the question. I want it to list like: A D G B E H C F I Here is the function that currently lists like: A B C D E F G H I function listPhoneExtensions($group,$group_title) { $adldap = new adLDAP(); $group_membership = $adldap->group_members(strtoupper($group),FALSE); sort($group_membership); print " <a name=\"".strtolower($group_title)."\"></a> <h2>".$group_title."</h2> <ul class=\"phone-extensions\">"; foreach ($group_membership as $i => $username) { $userinfo = $adldap->user_info($username, array("givenname","sn","telephonenumber")); $displayname = "<span class=\"name\">".substr($userinfo[0]["sn"][0],0,9).", ".substr($userinfo[0]["givenname"][0],0,9)."</span><span class=\"ext\">".$userinfo[0]["telephonenumber"][0]."</span>"; if($userinfo[0]["sn"][0] != "" && $userinfo[0]["givenname"][0] != "" && $userinfo[0]["telephonenumber"][0] != "") { print "<li>".$displayname."</li>"; } } print "</ul><p class=\"clear-both\"><a href=\"#top\" class=\"link-to-top\">&uarr; top</a></p>"; } Example rendered html: <ul class="phone-extensions"> <li><span class="name">Barry Bonds</span><span class="ext">8281</span></li> <li><span class="name">Gerald Clark</span><span class="ext">8211</span></li> <li><span class="name">Juan Dixon</span><span class="ext">8282</span></li> <li><span class="name">Omar Ebbs</span><span class="ext">8252</span></li> <li><span class="name">Freddie Flank</span><span class="ext">2281</span></li> <li><span class="name">Jerry Gilmore</span><span class="ext">4231</span></li> <li><span class="name">Kim Moore</span><span class="ext">5767</span></li> <li><span class="name">Barry Bonds</span><span class="ext">8281</span></li> <li><span class="name">Gerald Clark</span><span class="ext">8211</span></li> <li><span class="name">Juan Dixon</span><span class="ext">8282</span></li> <li><span class="name">Omar Ebbs</span><span class="ext">8252</span></li> <li><span class="name">Freddie Flank</span><span class="ext">2281</span></li> <li><span class="name">Jerry Gilmore</span><span class="ext">4231</span></li> <li><span class="name">Kim Moore</span><span class="ext">5767</span></li> <li><span class="name">Barry Bonds</span><span class="ext">8281</span></li> <li><span class="name">Gerald Clark</span><span class="ext">8211</span></li> <li><span class="name">Juan Dixon</span><span class="ext">8282</span></li> <li><span class="name">Omar Ebbs</span><span class="ext">8252</span></li> <li><span class="name">Freddie Flank</span><span class="ext">2281</span></li> <li><span class="name">Jerry Gilmore</span><span class="ext">4231</span></li> <li><span class="name">Kim Moore</span><span class="ext">5767</span></li> </ul> Any help is appreciated to getting it to list alpha vertically.

    Read the article

  • How to toggle wifi / bluetooth in Macbook Air with Windows 7 installed

    - by Barry Kelly
    I'm writing this on a MacBook Air 13" (the ones just released), but I have a problem. BootCamp provides no easy way of turning off the bluetooth or wifi radios, and nor are there any hotkey combinations on the keyboard, nor any hard or soft switches on the body to toggle these radios. As I'll be travelling a lot with this machine, what's the best way for me to comply with the cabin service crews' instructions and disable the radios before takeoff, and reenable them after landing?

    Read the article

  • Can EC2 instances be set up to come from different IP ranges?

    - by Joshua Frank
    I need to run a web crawler and I want to do it from EC2 because I want the HTTP requests to come from different IP ranges so I don't get blocked. So I thought distributing this on EC2 instances might help, but I can't find any information about what the outbound IP range will be. I don't want to go to the trouble of figuring out the extra complexity of EC2 and distributed data, only to find that all the instances use the same address block and I get blocked by the server anyway. NOTE: This isn't for a DoS attack or anything. I'm trying to harvest data for a legitimate business purpose, I'm respecting robots.txt, and I'm only making one request per second, but the host is still shutting me down. Edit: Commenter Paul Dixon suggests that the act of blocking even my modest crawl indicates that the host doesn't want me to crawl them and therefore that I shouldn't do it (even assuming I can work around the blocking). Do people agree with this?

    Read the article

< Previous Page | 1 2