Search Results

Search found 1071 results on 43 pages for 'jon harley'.

Page 7/43 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • How do I adjust the origin of rotation for a group of sprites?

    - by Jon
    I am currently grouping sprites together, then applying a rotation transformation on draw: private void UpdateMatrix(ref Vector2 origin, float radians) { Vector3 matrixorigin = new Vector3(origin, 0); _rotationMatrix = Matrix.CreateTranslation(-matrixorigin) * Matrix.CreateRotationZ(radians) * Matrix.CreateTranslation(matrixorigin); } Where the origin is the Centermost point of my group of sprites. I apply this transformation to each sprite in the group. My problem is that when I adjust the point of origin, my entire sprite group will re-position itself on screen. How could I differentiate the point of rotation used in the transformation, from the position of the sprite group? Is there a better way of creating this transformation matrix? EDIT Here is the relevant part of the Draw() function: Matrix allTransforms = _rotationMatrix * camera.GetTransformation(); spriteBatch.Begin(SpriteSortMode.BackToFront, null, null, null, null, null, allTransforms); for (int i = 0; i < _map.AllParts.Count; i++) { for (int j = 0; j < _map.AllParts[0].Count; j++) { spriteBatch.Draw(_map.AllParts[i][j].Texture, _map.AllParts[i][j].Position, null, Color.White, 0, _map.AllParts[i][j].Origin, 1.0f, SpriteEffects.None, 0f); } } This all works fine, again, the problem is that when a rotation is set and the point of origin is changed, the sprite group's position is offset on screen. I am trying to figure out a way to adjust the point of origin without causing a shift in position. EDIT 2 At this point, I'm looking for workarounds as this is not working. Does anyone know of a better way to rotate a group of sprites in XNA? I need a method that will allow me to modify the point of rotation (origin) without affecting the position of the sprite group on screen.

    Read the article

  • Introducing a (new) test method to a team

    - by Jon List
    A couple of months ago i was hired in a new job. (I'm fresh out of my Masters in software engineering) The company mainly consists of ERP consultants, but I was hired in their fairly small web department (6 developers), our main task is ERP/ecom integration (ERP-integrated web shops). The department is growing, and recently my manager asked me to start thinking about introducing tests to the team, i love a challenge, but frankly I'm a bit scared (I'm the least experience member of the team). Currently the method of testing is clicking around in the web shop and asking the customer if the products are there, if they look okay, and if orders are posted correctly to the ERP. We are getting a lot of support cases on previous projects, where a customer or a customer's customer have run into errors, which - i suppose - is why my manager wants more structured testing. Off the top of my head, I though of some (obvious?) improvements, like looking at the requirement specification, having an issue tracker, enabling team members to register their time on a "tests"-line on the budget, and to circulate tasks amongst members of the team. But as i see it we have three main challenges: general website testing. (javascript, C#, ASP.NET and CMS integration tests) (live) ERP integration testing (customers rarely want to pay for test environments). adopting a method in the team I like the responsibility, but I am afraid that I'm in a little bit over my head. I expect that my manager expects me to set up some kind of workshop for the team where I present some techniques and ideas and where we(the team) can find some solutions together. What I learned in school was mostly unit testing and program verification, not so much testing across multiple systems and applications. What I'm looking for here, is references/advice/pointers/anecdotes; anything that might help me to get smarter and to improve the current method of my team. Thanks!! (TL;DR: read the bold parts)

    Read the article

  • Compare Two NameValueCollections Extension Method

    - by Jon Canning
    public static class NameValueCollectionExtension     {         public static bool CollectionEquals(this NameValueCollection nameValueCollection1, NameValueCollection nameValueCollection2)         {             return nameValueCollection1.ToKeyValue().SequenceEqual(nameValueCollection2.ToKeyValue());         }         private static IEnumerable<object> ToKeyValue(this NameValueCollection nameValueCollection)         {             return nameValueCollection.AllKeys.OrderBy(x => x).Select(x => new {Key = x, Value = nameValueCollection[x]});         }     }

    Read the article

  • How should I manage a team with different skill levels?

    - by Jon Purdy
    I'll be working on a software project with some friends of mine, and I've been appointed technical lead. None of these guys is a bad programmer at all, but I do have significantly more experience than them. I need to be able to distribute the work among everyone on the team, while also making sure that we don't tread on one another's toes; that they meet the relatively high standards of quality and scalability that we need to make this project successful, without requiring me to review everything they commit. How should I maintain standards while avoiding micromanagement? Is it enough to make some diagrams, schedule some code reviews, and trust that I'll be able to fix anything that they might break, or should I go the TDD route and write explicit tests for the team to satisfy?

    Read the article

  • What are some reasonable stylistic limits on type inference?

    - by Jon Purdy
    C++0x adds pretty darn comprehensive type inference support. I'm sorely tempted to use it everywhere possible to avoid undue repetition, but I'm wondering if removing explicit type information all over the place is such a good idea. Consider this rather contrived example: Foo.h: #include <set> class Foo { private: static std::set<Foo*> instances; public: Foo(); ~Foo(); // What does it return? Who cares! Just forward it! static decltype(instances.begin()) begin() { return instances.begin(); } static decltype(instances.end()) end() { return instances.end(); } }; Foo.cpp: #include <Foo.h> #include <Bar.h> // The type need only be specified in one location! // But I do have to open the header to find out what it actually is. decltype(Foo::instances) Foo::instances; Foo() { // What is the type of x? auto x = Bar::get_something(); // What does do_something() return? auto y = x.do_something(*this); // Well, it's convertible to bool somehow... if (!y) throw "a constant, old school"; instances.insert(this); } ~Foo() { instances.erase(this); } Would you say this is reasonable, or is it completely ridiculous? After all, especially if you're used to developing in a dynamic language, you don't really need to care all that much about the types of things, and can trust that the compiler will catch any egregious abuses of the type system. But for those of you that rely on editor support for method signatures, you're out of luck, so using this style in a library interface is probably really bad practice. I find that writing things with all possible types implicit actually makes my code a lot easier for me to follow, because it removes nearly all of the usual clutter of C++. Your mileage may, of course, vary, and that's what I'm interested in hearing about. What are the specific advantages and disadvantages to radical use of type inference?

    Read the article

  • Having troubles with LibNoise.XNA and generating tileable maps

    - by Jon
    Following up on my previous post, I found a wonderful port of LibNoise for XNA. I've been working with it for about 8 hours straight and I'm tearing my hair out - I just can not get maps to tile, I can't figure out how to do this. Here's my attempt: Perlin perlin = new Perlin(1.2, 1.95, 0.56, 12, 2353, QualityMode.Medium); RiggedMultifractal rigged = new RiggedMultifractal(); Add add = new Add(perlin, rigged); // Initialize the noise map int mapSize = 64; this.m_noiseMap = new Noise2D(mapSize, perlin); //this.m_noiseMap.GeneratePlanar(0, 1, -1, 1); // Generate the textures this.m_noiseMap.GeneratePlanar(-1,1,-1,1); this.m_textures[0] = this.m_noiseMap.GetTexture(this.graphics.GraphicsDevice, Gradient.Grayscale); this.m_noiseMap.GeneratePlanar(mapSize, mapSize * 2, mapSize, mapSize * 2); this.m_textures[1] = this.m_noiseMap.GetTexture(this.graphics.GraphicsDevice, Gradient.Grayscale); this.m_noiseMap.GeneratePlanar(-1, 1, -1, 1); this.m_textures[2] = this.m_noiseMap.GetTexture(this.graphics.GraphicsDevice, Gradient.Grayscale); The first and third ones generate fine, they create a perlin noise map - however the middle one, which I wanted to be a continuation of the first (As per my original post), is just a bunch of static. How exactly do I get this to generate maps that connect to each other, by entering in the mapsize * tile, using the same seed, settings, etc.?

    Read the article

  • OData &ndash; The easiest service I can create

    - by Jon Dalberg
    I wanted to create an OData service with the least amount of code so I fired up Visual Studio and got cracking. I decided to serve up a list of naughty words and make them read-only. Create a new web project. I created an empty MVC 2 application but MVC is not required for OData. Add a new WCF Data Service to the project. I named mine NastyWords.svc since I’m serving up a list of nasty words. Add a class to expose via the service: NastyWord 1: [DataServiceKey("Word")] 2: public class NastyWord 3: { 4: public string Word { get; set; } 5: }   I need to be able to uniquely identify instances of NastyWords for the DataService so I used the DataServiceKey attribute with the “Word” property as the key. I could have added an “ID” property which would have uniquely identified them and would then not need the “DataServiceKey” attribute because the DataService would apply some reflection and heuristics to guess at which property would be the unique identifier. However, the words themselves are unique so adding an “ID” property would be redundantly repetitive. Then I created a data source to expose my NastyWord objects to the service. This is just a simple class with IQueryable<T> properties exposing the entities for my service: 1: public class NastyWordsDataSource 2: { 3: private static IList<NastyWord> words = new List<NastyWord> 4: { 5: new NastyWord{ Word="crap"}, 6: new NastyWord{ Word="darn"}, 7: new NastyWord{ Word="hell"}, 8: new NastyWord{ Word="shucks"} 9: }; 10:   11: public NastyWordsDataSource() 12: { 13: NastyWords = words.AsQueryable(); 14: } 15:   16: public IQueryable<NastyWord> NastyWords { get; private set; } 17: }   Now I can go to the NastyWords.svc class and tell it which data source to use and which entities to expose: 1: public class NastyWords : DataService<NastyWordsDataSource> 2: { 3: // This method is called only once to initialize service-wide policies. 4: public static void InitializeService(DataServiceConfiguration config) 5: { 6: config.SetEntitySetAccessRule("*", EntitySetRights.AllRead); 7: config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; 8: } 9: }   Compile and browse to my NastWords.svc and weep with joy Now I can query my service just like any other OData service. Next time, I’ll modify this service to allow updates to sent so I can build up my list of nasty words. Enjoy!

    Read the article

  • Some files not copied when moving an encrypted home to a different partition

    - by Jon Herrin
    I have "successfully" moved my encrypted home to a separate partition using the instructions here: How can i move an encrypted home directory to another partition? However, some files are not being copied over. Most notably, I have a directory in my old home that contains the themes I use. This directory and it's contents are not copied over to the new home and therefore I come up with the default theme. Permissions on the directory that was not moved are identical to the other directories in home. Another discrepancy is that my Dropbox folder came over empty and had to resync itself. My concern is what else might be missing from the copied home. At this point, I've flipped back to the old home by re-editing /etc/fstab, but I'd really like to get /home cleanly and completely off of root without having to core the system.

    Read the article

  • How to change root password for mysql and phpmyadmin

    - by Jon
    I've set up mysql and phpmyadmin and chose not to set a password when installing hoping that once set up i could login with root and no password but i get the following error from phpmyadmin Login without a password is forbidden by configuration (see AllowNoPassword) I have previously moved the phpmyadmin folder to /var/www/ I have tried changing the following line $cfg['Servers'][$i]['AllowNoPassword'] = false; to $cfg['Servers'][$i]['AllowNoPassword'] = true; but still had no success, so i am wondering is there a way i can change the root passwords for both so i can access phpmyadmin and create databases. Thanks

    Read the article

  • Can I install Natty alongside Maverick and retain my encrypted /home partition?

    - by Jon
    This is my partitioning scheme: 10GB partition empty -- will be installing Natty here 10GB partition containing Maverick 2GB swap partition 300GB encrypted /home partition I've had few problems in the past with having two ubuntu installs on two separate partitions, giving /home it's own partition, but I'm a little concerned since I'm now using an encrypted /home partition. Install won't try to wipe my /home if I click " encrypt home directory," will it?

    Read the article

  • What do you look for in a scripting language?

    - by Jon Purdy
    I'm writing a little embedded language for another project. While game development was not its original intent, it's starting to look like a good fit, and I figure I'll develop it in that vein at some point. Without revealing any details (to avoid bias), I'm curious to know: What features do you love in a scripting language for game development? If you've used Lua, Python, or another embedded language such as Tcl or Guile as your primary scripting language in a game project, what aspects did you find the most useful? Language features (lambdas, classes, parallelism) Implementation features (performance optimisations, JIT, hardware acceleration) Integration features (C, C++, or .NET bindings) Or something entirely different?

    Read the article

  • How to detect image dimensions and run commands on them?

    - by Jon
    I have a directory full of images, some of which are portrait-sized instead of landscape-sized, and I want to open the portrait-sized ones with an image editor. I can run the imagemagick command identify and I get an output like something.jpg JPEG 1920x1255 1920x1255+0+0 8-bit DirectClass 159KB 0.000u 0:00.000. How can I have a script interpret this output, i.e. decide which is bigger, the 1920 or the 1255, and then run a command on it if it is?

    Read the article

  • How can I have the passphrase for a private key remembered for a user?

    - by Jon Cram
    I have a collection of web services running on Ubuntu Server 12.04 that pull code from a github repository. These services run under a specific user (let's call that user 'example'). In /home/example/.ssh/is_rsa is the private key associated with the relevant github account. When performing an operation such as git pull I am greeted with: Enter passphrase for key '/home/simplytestable/.ssh/id_rsa':. Enter the correct password and all is ok. The same private key is present on local development Ubuntu Desktop 12.04 machines and no passphrase is asked for. I'd like to be able to have the passphrase remembered so that upon entering it once it is never asked for again. This will aid in automating various web service updates. I'm guessing that the passphrase needs to be stored in the relevant user's keychain such that I don't have to enter it every time the private key needs to be unlocked. How can I achieve this?

    Read the article

  • Move Joomla website to new folder

    - by Jon
    I currently have a website. I have created a new folder on the website called V2. Under this folder I have installed Joomla and configured my new looking site. I now want to make V2 the default website. I could point the website to that V2 directory however I have other folders under the current root website that I need to keep. How can I transfer V2 to the root of my website? Is it just a case of copying all the files?

    Read the article

  • Why is the dash so unresponsive, and is there a way to fix this?

    - by Jon
    I just upgraded to 12.04. When I press the super key to open the dash, there's a lag of 1-3 seconds before it displays, with no other programs running. (This is similar, but not identical, to the issue described in Dash application search unresponsive at startup about 11.10.) At login time, this lag is up to 10 seconds, and sometimes the dash doesn't respond at all to the super key. In contrast, the launcher Kupfer immediately responds to its hotkey, in milliseconds, and responds to my typing an application name also in fractions of a second. Is there a way to load the dash in memory or a RAM disk of some sort to make it more responsive?

    Read the article

  • Serialize plain clean XML in .NET

    - by Jon Canning
    public static string ToXml<T>(this T obj) where T : class         {             using (var stringWriter = new StringWriter())             {                 var xmlWriterSettings = new XmlWriterSettings { OmitXmlDeclaration = true };                 using (var xmlWriter = XmlWriter.Create(stringWriter, xmlWriterSettings))                 {                     var xmlSerializerNamespaces = new XmlSerializerNamespaces(new[] { XmlQualifiedName.Empty });                     var xmlSerializer = new XmlSerializer(typeof(T));                     xmlSerializer.Serialize(xmlWriter, obj, xmlSerializerNamespaces);                 }                 return stringWriter.ToString();             }         }

    Read the article

  • Why is there no facility to overload static properties in PHP?

    - by Jon
    Intro PHP allows you to overload method calls and property accesses by declaring magic methods in classes. This enables code such as: class Foo { public function __get($name) { return 42; } } $foo = new Foo; echo $foo->missingProperty; // prints "42" Apart from overloading instance properties and methods, since PHP 5.3.0 we can also overload static methods calls by overriding the magic method __callStatic. Something missing What is conspicuously missing from the available functionality is the ability to overload static properties, for example: echo Foo::$missingProperty; // fatal error: access to undeclared static property This limitation is clearly documented: Property overloading only works in object context. These magic methods will not be triggered in static context. Therefore these methods should not be declared static. As of PHP 5.3.0, a warning is issued if one of the magic overloading methods is declared static. But why? My questions are: Is there a technical reason that this functionality is not currently supported? Or perhaps a (shudder) political reason? Have there been any aborted attempts to add this functionality in the past? Most importantly, the question is not "how can I have dynamic static properties in userland PHP?". That said, if you know of an especially cute implementation based on __callStatic that you want to share then by all means do so.

    Read the article

  • What do you do when your naming convention clashes with your language?

    - by Jon Purdy
    Okay, this is one of those little things that always bugged me. I typically don't abbreviate identifiers, and the only time I use a short identifier (e.g., i) is for a tight loop. So it irritates me when I'm working in C++ and I have a variable that needs to be named operator or class and I have to work around it or use an abbreviation, because it ends up sticking out. Caveat: this may happen to me disproportionately often because I work a lot in programming language design, where domain objects may mirror concepts in the host language and inadvertently cause clashes. How would you deal with this? Abbreviate? (op) Misspell? (klass) Something else? (operator_)

    Read the article

  • Getting "boot error" when trying to boot from USB

    - by Jon Ball
    I'm wanting to try out Ubuntu, so followed the instructions for how to install Ubuntu onto a USB. I downloaded the .iso file, then the pendrivelinux 3 part process to make the USB bootable. I can see what looks like a full list of files on the USB (including the wubi.exe application and the syslinux folder). When I try to restart the computer with the USB in, I get the Dell start up screen, and then a black screen with "Boot Error" in the top right hand corner. Setup options (default) are to boot from Removable Device, then Hard Disc. USB is brand new, straight out of the packet. Computer: Dell Inspiron 530S BIOS: 1.0.13 OS: Windows Vista Home Edition USB: EMTEC 8Gb, formatted to FAT32 I've tried some of the tips in other help topics (holding down CTRL key while restarting, removing all other USB devices). I tried to reformat the USB to something other than FAT32, but my only other options were NTFS or exFAT (not FAT16 which was suggested in another topic).

    Read the article

  • Opening / using WUBI after downloading

    - by Jon
    I have no problem downloading WUBI either using Firefox or IE. Either way, however, when I try to run or open it, I get a message to the effect that the file cannot run because the configuration is incorrect and "re-installing the file may help" (which it doesn't - I've tried several times). What am doing wrong ? I am running XP Pro. (Note: my Ubuntu CD works just fine but I want to install Ubuntu inside Windows).

    Read the article

  • Scaling along an arbitrary axis (Dealing with non-uniform scale)

    - by Jon
    I'm trying to build my own little engine to get more familiar with the concepts of 3D programming. I have a transform class that on each frame it creates a Scaling Matrix (S), a Rotation Matrix from a Quaternion (R) and concatenates them together (S*R). Once i have SR, I insert the translation values into the bottom of the three columns. So i end up with a transformation matrix that looks like: [SR SR SR 0] [SR SR SR 0] [SR SR SR 0] [tx ty tz 1] This works perfectly in all cases except when rotating an object that has a non-uniform scale. For example a unit cube with ScaleX = 4, ScaleY = 2, ScaleZ = 1 will give me a rectangular box that is 4 times as wide as the depth and twice as high as the depth. If i then translate this around, the box stays the same and looks normal. The problem happens whenever I try to rotate this scaled box. The shape itself becomes distorted and it appears as though the Scale factors are affecting the object on the World X,Y,Z axis rather than the local X,Y,Z axis of the object. I've done some pretty extensive research through a variety of textbooks (Eberly, Moller/Hoffman, Phar etc) and there isn't a ton there to go off of. Online, most of the answers say to avoid non-uniform scaling which I understand the desire to avoid it, but I'd still like to figure out how to support it. The only thing I can think off is that when constructing a Scale Matrix: [sx 0 0 0] [0 sy 0 0] [0 0 sz 0] [0 0 0 1] This is scaling along the World Axis instead of the object's local Direction, Up and Right vectors or it's local Z, Y, X axis. Does anyone have any tips or ideas on how to handle construction a transformation matrix that allows for non-uniform scaling and rotation? Thanks!

    Read the article

  • Implementing a ILogger interface to log data

    - by Jon
    I have a need to write data to file in one of my classes. Obviously I will pass an interface into my class to decouple it. I was thinking this interface will be used for testing and also in other projects. This is my interface: //This could be used by filesystem, webservice public interface ILogger { List<string> PreviousLogRecords {get;set;} void Log(string Data); } public interface IFileLogger : ILogger { string FilePath; bool ValidFileName; } public class MyClassUnderTest { public MyClassUnderTest(IFileLogger logger) {....} } [Test] public void TestLogger() { var mock = new Mock<IFileLogger>(); mock.Setup(x => x.Log(Is.Any<string>).AddsDataToList()); //Is this possible?? var myClass = new MyClassUnderTest(mock.Object); myClass.DoSomethingThatWillSplitThisAndLog3Times("1,2,3"); Assert.AreEqual(3,mock.PreviousLogRecords.Count); } This won't work I don't believe as nothing is storing the items so is this possible using Moq and also what do you think of the design of the interface?

    Read the article

  • IE8 HTTPs Download Issue

    - by Jon Egerton
    I have a problem with a system I develop related to IE8 downloading over SSL (ie on sites using https://...) and is described on this MS kb article: http://support.microsoft.com/kb/323308 We use the HTTPCacheability.NoCache option as the data being downloaded is sensitive, and is downloaded from a secured site. I don't want that data to be cached on any of the proxies etc that the response passes through back to the client. The article describing the issue details a fix to the client side registry changing a BypassSSLNoCacheCheck setting. I don't want to loosen the system security just for IE8, as the system works fine on anything more upto date. Getting all the clients to apply the hotfix is difficult at best, and impossible at worst. We need to support IE8 in the system, at least for now. So: 1: Does the detailed hotfix have any implications for the security at the browser end in IE8 - does it mean the file will be cached? (in a place other than where the user saves the file). 2: Is there some way I can get these files downloadable with a change at the server end that doesn't break the security side of things?

    Read the article

  • How can I store all my level data in a single file instead of spread out over many files?

    - by Jon
    I am currently generating my level data, and saving to disk to ensure that any modifications done to the level are saved. I am storing "chunks" of 2048x2048 pixels into a file. Whenever the player moves over a section that doesn't have a file associated with the position, a new file is created. This works great, and is very fast. My issue, is that as you are playing the file count gets larger and larger. I'm wondering what are techniques that can be used to alleviate the file count, without taking a performance hit. I am interested in how you would store/seek/update this data in a single file instead of multiple files efficiently.

    Read the article

  • Fan very loud in Ubuntu 12.10

    - by Jon
    I recently installed 12.10 on my Desktop PC, moving away from Windows 7. For some reason, the fan in my computer is making an enormous amount of noise (it is running at full speed constantly). Under Windows 7, the fan would slow itself down and run at an acceptable noise level. Now, it is nearly unbearable. Checked the processes, and none are taking up a huge load on the CPU. Please help as I really can't endure this noise, and I do not want to go back to Windows 7 on this box. Some specs: - Intel 2.26 duo core - ATI 4870 - 4GB - 650W power supply

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >