Search Results

Search found 4765 results on 191 pages for 'gh unit'.

Page 70/191 | < Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >

  • Strategy for hosting 700+ domains names, each with a static HTML site

    - by jonschlinkert
    I have a portfolio of more than 700 domain names, and ideally I'd like to put up a single-page HTML/CSS/JavaScript webpage for each domain. Is there a system/strategy/workflow that will allow me to: Automate the deployment of new websites, quickly and easily without having to manually initiate each new website in an admin panel. For instance, I've seen dropbox-based solutions that claim to make it simple to setup new websites on your dropbox account, but you still have to set each one up in an admin interface first. It would be so much easier to have a folder naming convention that allowed the user to easily clone/copy/duplicate sites inside their Dropbox App folder (https://www.dropbox.com/developers/blog/23) to create new ones. Sounds interesting, however... It's easy to manage CNAMEs on the registrar-side, but is there a way to quickly associate CNAMEs with new websites (on the hosting side), maybe using the method offered by gh-pages-style (https://help.github.com/articles/setting-up-a-custom-domain-with-pages)? With GitHub's gh-pages, all you have to do is drop a file called CNAME into your repo, with the domain name you want associated with the repo inside the file. gh-pages isn't a good solution for what I'm doing though unfortunately. I'm also a front-end developer, specializing in rapid web development and "front-end build systems", so I building and maintaining static assets for hundreds of sites is no problem. It's the hosting-side that I really struggle with. Any suggestions?

    Read the article

  • CodeStock 2012 Review: Eric Landes( @ericlandes ) - Automated Tests in to automated Builds! How to put the right type of automated tests in to the right automated builds.

    Automated Tests in to automated Builds! How to put the right type of automated tests in to the right automated builds.Speaker: Eric LandesTwitter: @ericlandesBlog: http://ericlandes.com/ This was one of the first sessions I attended during CodeStock 2012. Eric’s talk focused mostly on unit testing, and that the lack of proper unit testing can be compared to stealing from an employer. His point was that if you’re not doing proper unit testing then all of the time wasted on fixing issues that could have been detected with unit tests is like stealing money from employer. He makes the assumption that that time spent on fixing these issues could have been better spent developing new features that drive the business. To a point I can agree with Eric’s argument regarding unit testing and stealing from a company’s perspective. I can see how he relates resources being shifted from new development to bug fixes as stealing based on the fact that the resources used to fix bugs are directly taken from other projects. He also states that Boring/Redundant and Build/Test tasks should be automated because it reduces the changes of errors and frees up developer to do what they do best, DEVELOP! When he refers to testing, he breaks testing down in to four distinct types. Unit Test Acceptance Test (This also includes Integration Tests) Performance Test UI Test With this he also recommends that developers should not go buck wild striving for 100% code coverage because some test my not provide a great return on investment. In his experience he recommends that 70% test coverage was a very acceptable rate.

    Read the article

  • Problems moving a rectangle in Pygame.

    - by Yann Core
    Hi guys! I'm making a game in Pygame and I want to be able to target enemy unit. I made it so when I click on them a variable "targeted" becomes true, and stays true until I click somewhere else on the screen. I also want targeted units to have a small green circle around them, so I made it in GEDIT. I have made a function that draws everything on the screen (the background, the player, objects, etc) and in the part where it draws the units it checks if the variable "targeted" is true and if it is it should move that little green circle over the enemy units. here is the code that does that: screen.blit(enemy_unit.pic, enemy_unit.rect) #draw the unit if enemy_unit.targeted == True: #if the unit has been targeted then draw a circle over it target_rect.move_ip(enemy_unit.pos) #move the circle to the unit target_rect.fit(enemy_unit.rect) #there are some bigger units and some smaller ones, so we have to "scale" the circle screen.blit(target_pic, target_rect) #actually draw the circle This doesn't work, when I target the unit the circle just appears for a 1/5 of second next (not on, but just next) to the unit and then disappears. I am sure that I am keeping a good track of "enemy_unit.pos" because I tested it (I added a piece of code that would print one units position and mouse's position every time i clicked the mouse and when i was near him the numbers were same). If you could give me a hint about what I'm doing wrong. I think its in move_ip function, but I tried just move and it didn't work either (the circle didn't even show at all)!

    Read the article

  • How do I Unit Test Actions without Mocking that use UpdateModel?

    - by Hellfire
    I have been working my way through Scott Guthrie's excellent post on ASP.NET MVC Beta 1. In it he shows the improvements made to the UpdateModel method and how they improve unit testing. I have recreated a similar project however anytime I run a UnitTest that contains a call to UpdateModel I receive an ArgumentNullException naming the controllerContext parameter. Here's the relevant bits, starting with my model: public class Country { public Int32 ID { get; set; } public String Name { get; set; } public String Iso3166 { get; set; } } The controller action: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(Int32 id, FormCollection form) { using ( ModelBindingDataContext db = new ModelBindingDataContext() ) { Country country = db.Countries.Where(c => c.CountryID == id).SingleOrDefault(); try { UpdateModel(country, form); db.SubmitChanges(); return RedirectToAction("Index"); } catch { return View(country); } } } And finally my unit test that's failing: [TestMethod] public void Edit() { CountryController controller = new CountryController(); FormCollection form = new FormCollection(); form.Add("Name", "Canada"); form.Add("Iso3166", "CA"); var result = controller.Edit(2 /*Canada*/, form) as RedirectToRouteResult; Assert.IsNotNull(result, "Expected to be redirected on successful POST."); Assert.AreEqual("Show", result.RouteName, "Expected to redirect to the View action."); } ArgumentNullException is thrown by the call to UpdateModel with the message "Value cannot be null. Parameter name: controllerContext". I'm assuming that somewhere the UpdateModel requires the System.Web.Mvc.ControllerContext which isn't present during execution of the test. I'm also assuming that I'm doing something wrong somewhere and just need to pointed in the right direction. Help Please!

    Read the article

  • SQLAlchemy: who is in charge of the "session"? ( and how to unit-test with sessions )

    - by Nick Perkins
    I need some guidance on how to use session objects with SQLAlchemy, and how to organize Unit Tests of my mapped objects. What I would like to able to do is something like this: thing = BigThing() # mapped object child = thing.new_child() # create and return a related object thing.save() # will also save the child object In order to achieve this, I was thinking of having the BigThing actually add itself ( and it's children ) to the database -- but maybe this not a good idea? One reason to add objects as soon as possible is Automatic id values that are assigned by the database -- the sooner they are available, the fewer problems there are ( right? ) What is the best way to manage session objects? Who is in charge of the session? Should it be created only when required? or saved for a long time? What about Unit Tests for my mapped objects?...how should the session be handled? Is it ever OK to have mapped objects just automatically add themselves to a database? or is that going to lead to trouble?

    Read the article

  • Method works on Emulator but no on Microsoft Surface unit?

    - by Roflcoptr
    I have the following code. The StartRecord method trows an error on the Microsoft Surface Unit. But when I'm testing it on the emulator, it all works great. Any hints how 1) to find the exception that is thrown on the Microsoft Surface Unit? 2) to find the error in the code? any assumptions? private void StartRecord(object sender, ContactEventArgs e) { isRecording = true; StartButton.IsEnabled = false; recordTimer = new Timer(10); recordTimer.Elapsed += new ElapsedEventHandler(recordTimer_Elapsed); PlaybackRoot.Visibility = System.Windows.Visibility.Collapsed; EllapsedRecord.Visibility = System.Windows.Visibility.Visible; InputLevel.Visibility = System.Windows.Visibility.Visible; long time = DateTime.Now.Ticks; String fileName = Convert.ToString(time) + ".wav"; Console.WriteLine(fileName); startTime = DateTime.UtcNow; recordTimer.Start(); record = new AudioRecording(fileName); record.getSampleAggregator().MaximumCalculated += new EventHandler<MaxSampleEventArgs>(AudioControl_MaximumCalculated); record.start(); }

    Read the article

  • What is the appropriate HTML 5 element for a hero unit/showcase?

    - by deb
    A lot of marketing and content-heavy sites showcase the page's primary content using large text and/or images, sometimes with a slider, containing a call to action for signing up for a service, or downloading an app, etc.. I'm not sure what this design element is called, I got the term hero unit from twitter bootstrap: http://twitter.github.com/bootstrap/components.html#typography I think most of you know what I'm trying to describe... If it's not clear I can add screenshots or links to this question. I looked at a few different sites, and some put this hero unit inside a ASIDE element, others use SECTION, ARTICLE and even HEADER. Using twitter bootstrap as an example again: <header class="jumbotron masthead"> <div class="inner"> <h1>Bootstrap, from Twitter</h1> <p>Simple and flexible HTML, CSS, and Javascript for popular user interface components and interactions.</p> <p class="download-info"> Is HEADER the most appropriate tag for this type of content? Or should I use ASIDE, ARTICLE or SECTION?

    Read the article

  • ggplot2 footnote

    - by user338714
    What is the best way to add a footnote to the bottom of a plot created with ggplot2? I've tried using a combination of the logic noted here http://www.r-bloggers.com/r-good-practice-%E2%80%93-adding-footnotes-to-graphics/ as well as the ggplot2 annotate function p + annotate("text",label="Footnote", x=unit(1,"npc") - unit(2, "mm"),y=unit(2, "mm"), just=c("right", "bottom"),gp=gpar(cex= 0.7, col=grey(.5))) but I am getting the error "Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class c("unit.arithmetic", "unit") into a data.frame".

    Read the article

  • Howoto get id of new record after model.save

    - by tonymarschall
    I have a model with the following db structure: mysql> describe units; +------------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+----------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(128) | NO | | NULL | | | created_at | datetime | NO | | NULL | | | updated_at | datetime | NO | | NULL | | +------------+----------+------+-----+---------+----------------+ 7 rows in set (0.00 sec) After creating a new record an saving i can not get the id of the record. 1.9.3p194 :001 > unit = Unit.new(:name => 'test') => #<Unit id: nil, name: "test", created_at: nil, updated_at: nil> 1.9.3p194 :002 > unit.save (0.2ms) BEGIN SQL (0.3ms) INSERT INTO `units` (`created_at`, `name`, `updated_at`) VALUES ('2012-08-31 23:48:12', 'test', '2012-08-31 23:48:12') (144.6ms) COMMIT => true 1.9.3p194 :003 > unit.inspect => "#<Unit id: nil, name: \"test\", created_at: \"2012-08-31 23:48:12\", updated_at: \"2012-08-31 23:48:12\">" # unit.rb class Unit < ActiveRecord::Base attr_accessible :name end # migration class CreateUnits < ActiveRecord::Migration def change create_table :units do |t| t.string :name, :null => false t.timestamps end end end Tried this with other models and have the same result (no id). Data is definitily saved and i can get data with Unit.last Another try with Foo.id = nil # /var/www# rails g model Foo name:string invoke active_record create db/migrate/20120904030554_create_foos.rb create app/models/foo.rb invoke test_unit create test/unit/foo_test.rb create test/fixtures/foos.yml # /var/www# rake db:migrate == CreateFoos: migrating ===================================================== -- create_table(:foos) -> 0.3451s == CreateFoos: migrated (0.3452s) ============================================ # /var/www# rails c Loading development environment (Rails 3.2.8) 1.9.3p194 :001 > foo = Foo.new(:name => 'bar') => #<Foo id: nil, name: "bar", created_at: nil, updated_at: nil> 1.9.3p194 :002 > foo.save (0.2ms) BEGIN SQL (0.4ms) INSERT INTO `foos` (`created_at`, `name`, `updated_at`) VALUES ('2012-09-04 03:06:26', 'bar', '2012-09-04 03:06:26') (103.2ms) COMMIT => true 1.9.3p194 :003 > foo.inspect => "#<Foo id: nil, name: \"bar\", created_at: \"2012-09-04 03:06:26\", updated_at: \"2012-09-04 03:06:26\">" 1.9.3p194 :004 > Foo.last Foo Load (0.5ms) SELECT `foos`.* FROM `foos` ORDER BY `foos`.`id` DESC LIMIT 1 => #<Foo id: 1, name: "bar", created_at: "2012-09-04 03:06:26", updated_at: "2012-09-04 03:06:26">

    Read the article

  • Downgrade to Nautilus 3.4 from Ubuntu 13.10 / Nautilus 3.8

    - by duxk.gh
    I just updated to Ubuntu 13.10 and greatly dislike Nautilus 3.8 that comes with it. In Ubuntu 13.04 I used the instructions in this article to get back some of the features from Nautilus 3.4, but unfortunately that doesn't work anymore. I particularly miss dividing up the window with F3 to have two folders show at the same time. The new search function I also find pretty terrible. I checked out Nemo but I would much prefer downgrading to Nautilus 3.4.

    Read the article

  • Where to store front-end data for "object calculator"

    - by Justin Grahn
    I recently have completed a language library that acts as a giant filter for food items, and flows a bit like this :Products -> Recipes -> MenuItems -> Meals and finally, upon submission, creates an Order. I have also completed a database structure that stores all the pertinent information to each class, and seems to fit my needs. The issue I'm having is linking the two. I imagined all of the information being local to each instance of the product, where there exists one backend user who edits and manipulates data, and multiple front end users who select their Meal(s) to create an Order. Ideally, all of the front end users would have all of this information stored locally within the library, and would update the library on startup from a database. How should I go about storing the data so that I can load it into the library every time the user opens the application? Do I package a database onboard and just load and populate every time? The only method I can currently conceive of doing this, even if I only have 500 possible Product objects, would require me to foreach the list for every Product that I need to match to a Recipe and so on and so forth every time I relaunch the program, which seems like a lot of wasteful loading. Here is a general flow of my architecture: Products: public class Product : IPortionable { public Product(string n, uint pNumber = 0) { name = n; productNumber = pNumber; } public string name { get; set; } public uint productNumber { get; set; } } Recipes: public Recipe(string n, decimal yieldAmt, Volume.Unit unit) { name = n; yield = new Volume(yieldAmt, unit); yield.ConvertUnit(); } /// <summary> /// Creates a new ingredient object /// </summary> /// <param name="n">Name</param> /// <param name="yieldAmt">Recipe Yield</param> /// <param name="unit">Unit of Yield</param> public Recipe(string n, decimal yieldAmt, Weight.Unit unit) { name = n; yield = new Weight(yieldAmt, unit); } public Recipe(Recipe r) { name = r.name; yield = r.yield; ingredients = r.ingredients; } public string name { get; set; } public IMeasure yield; public Dictionary<IPortionable, IMeasure> ingredients = new Dictionary<IPortionable,IMeasure>(); MenuItems: public abstract class MenuItem : IScalable { public static string title = null; public string name { get; set; } public decimal maxPortionSize { get; set; } public decimal minPortionSize { get; set; } public Dictionary<IPortionable, IMeasure> ingredients = new Dictionary<IPortionable, IMeasure>(); and Meal: public class Meal { public Meal(int guests) { guestCount = guests; } public int guestCount { get; private set; } //TODO: Make a new MainCourse class that holds pasta and Entree public Dictionary<string, int> counts = new Dictionary<string, int>(){ {MainCourse.title, 0}, {Side.title , 0}, {Appetizer.title, 0} }; public List<MenuItem> items = new List<MenuItem>(); The Database just stores and links each of these basic names and amounts together usings ID's (RecipeID, ProductID and MenuItemID)

    Read the article

  • SOLID Principles and code structure

    - by S-Unit
    My question is on SOLID principles, because I couldn't answer a question (beyond the obvious meaning of the various principles of SOLID) at an interview and it really bugs me. I have done a couple of days worth of digging around and have yet to come up with a satisfactory summary. The question was: If you were to look at a .Net project that I told you strictly followed SOLID principles, what would expect to see in terms of the project and code structure ? I sort of floundered around a bit, didn't really answer the question and then bombed out. Any help or thoughts will really be appreciated.

    Read the article

  • Remove dropped shadown in nemo previews

    - by duxk.gh
    I recently started using Nemo because Nautilus has gotten pretty terrible. I quite like it, but one thing is still bugging me: the shadow of the preview of every image and video file (see below). I've been looking around in the /usr/share/themes/Ambiance/gtk-3.0/apps/nemo.css file but couldn't figure out how to get rid of that shadow. In Nautilus you get a border instead of a shadow, so surely something is different. I just can't figure out what. Any ideas?

    Read the article

  • In Rhythmbox, is there a way to sort by artist and search by title?

    - by duxk.gh
    In Rhythmbox I sort my music by artist. When I quickly want to look for a song I'd like to type in the title of the song. Not in the standard search box up top, but by starting to type when I've clicked anywhere in the list of songs. A small search box appears in the right bottom corner just like it does in Nautilus. The thing is, when I sort by artist that search looks up the artist as well. When I sort by title, it searches by title. I'd like to sort by artist, but search by title. Is there a way to do that?

    Read the article

  • How to create unit test for actualHeight in Silverlight 4?

    - by eflles
    How can I write a unit test to test the actualWidth property to a userControl in Silverligh 4? I hoped that this method would pass, but it fails. I am using the Silverlight ToolKit april 2010, and VS 2010. <TestMethod()> _ Public Sub TestAcrtualWidth() Me.MyUserControl.Width = 100 Me.MyUserControl.UpdateLayout() Assert.IsTrue(Me.MyUserControl.ActualWidth > 0) End Sub

    Read the article

  • Matlab help: I am given a second order differential equation.I need to use matlab to find unit step response and impulse response?

    - by Cady Smith
    I have the second order differential equation d^2(y(t))/dt^2+ B1*d(y(t))/dt+ c1*y(t)=A1*x(t) t is in seconds and is greater than 0. A1, B1, C1 are constants that equal: A1= 3.8469x10^6 B1= 325.6907 C1= 3.8469x10^6 This system is linear, time-invariant, and casual. The system is called H1. I want to use Matlab to compute and plot the impulse response function h1(t) and the unit step response function g1(t) of this system.

    Read the article

  • Why cant we use UIFont or UIcolor in the method which we unit test?

    - by PrithviRaj
    Hi all, I have an method in the tableview controller class. It consists few of the UIColor and UIFont class names. I am unit testing that metohd. But when i build that test target i am getting this error: "/Developer/Tools/RunPlatformUnitTests.include:451:0 Test rig '/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/Developer/usr/bin/otest' exited abnormally with code 133 (it may have crashed)." Any idea about this? Thanks in advance.

    Read the article

< Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >