Search Results

Search found 27607 results on 1105 pages for 'hello world'.

Page 26/1105 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Hello, T4MVC &ndash; Goodbye, ASP.NET MVC &ldquo;magic strings&rdquo;

    - by Brian Schroer
    I’m working on my first ASP.NET MVC project, and I really, really like MVC. I hate all of the “magic strings”, though: <div id="logindisplay"> <% Html.RenderPartial("LogOnUserControl"); %> </div> <div id="menucontainer"> <ul id="menu"> <li><%=Html.ActionLink("Find Dinner", "Index", "Dinners")%></li> <li><%=Html.ActionLink("Host Dinner", "Create", "Dinners")%></li> <li><%=Html.ActionLink("About", "About", "Home")%></li> </ul> </div> They’re prone to misspelling (causing errors that won’t be caught until runtime), there’s duplication, there’s no Intellisense, and they’re not friendly to refactoring tools.   I had started down the path of creating static classes with constants for the strings, e.g.: <li><%=Html.ActionLink("Find Dinner", DinnerControllerActions.Index, Controllers.Dinner)%></li> …but that was pretty tedious.   Then I discovered T4MVC (http://mvccontrib.codeplex.com/wikipage?title=T4MVC). Just add its T4MVC.tt and T4MVC.settings.t4 files to the root of your MVC application, and it magically (and this time, it’s good magic) generates code that allows you to replace the first code sample above with this: <div id="logindisplay"> <% Html.RenderPartial(MVC.Shared.Views.LogOnUserControl); %> </div> <div id="menucontainer"> <ul id="menu"> <li><%=Html.ActionLink("Find Dinner", MVC.Dinners.Index())%></li> <li><%=Html.ActionLink("Host Dinner", MVC.Dinners.Create())%></li> <li><%=Html.ActionLink("About", MVC.Home.About())%></li> </ul> </div> It gives you a strongly-typed alternative to magic strings for all of these scenarios: Html.Action Html.ActionLink Html.RenderAction Html.RenderPartial Html.BeginForm Url.Action Ajax.ActionLink view names inside controllers But wait, there’s more! It even gives you static helpers for image and script links, e.g.: <img src="<%= Links.Content.nerd_jpg %>" />   <script src="<%= Links.Scripts.Map_js %>" type="text/javascript"></script> …instead of: <img src="/Content/nerd.jpg" />   <script src="/Scripts/Map.js" type="text/javascript"></script>   Thanks to David Ebbo for creating this great tool. You can watch an eight and a half minute video about T4MVC on Channel 9 via this link: http://channel9.msdn.com/posts/jongalloway/Jon-Takes-Five-with-David-Ebbo-on-T4MVC/. You can download T4MVC from its CodePlex page: http://mvccontrib.codeplex.com/wikipage?title=T4MVC.

    Read the article

  • Hello, can you just send me all your data please?

    - by fatherjack
    LiveJournal Tags: Security,SQL Server Our house phone rang on Saturday night and Mrs Fatherjack answered. I was in the other room but I heard her trying to explain to the caller that they were in some way mistaken. Eventually, as she got more irate with the caller, I went out and started to catch up with the events so far. The caller was trying to convince my wife that our computer was infected with a virus. She was confident that it wasn't. Her patience expired after almost 10 minutes...(read more)

    Read the article

  • What is the usage of Spaly Trees in the real world?

    - by Meena
    I decided to learn about Balance search trees, so I picked 2-3-4 and splay trees. I'm wondering what are the examples of splay trees usage in the real world? In this Cornell: http://www.cs.cornell.edu/courses/cs3110/2009fa/recitations/rec-splay.html I read that splay trees are 'A good example is a network router'. But from rest of the explanation seams like network routers use hash tables and not splay trees since the lookup time is constant instead of O(log n). thanks!

    Read the article

  • How to do directional per fragment lighting in world space?

    - by user
    I am attempting to create a GLSL shader for simple, per-fragment directional light. So far, after following many tutorials, I have continually ran into the issue: my light is specified in world coordinates, however, the shader treats the light's position as being in eye space, thus, the light direction changes when I move the camera. My question is, how to I transform a directional light position such as (50, 50, 50, 0) into eye space, or, would doing things this way be the incorrect approach to the problem?

    Read the article

  • Why don't popular software programs like photoshop or world of warcraft support ubuntu?

    - by user784637
    The only thing stopping me from making ubuntu 12.04 my main os is that a lot of programs I use on windows 7 and mac aren't available for download on ubuntu. Why don't popular software programs like photoshop or world of warcraft support linux? Also - Would a company have to create the program (ex photoshop) for every possible distro(gentoo, arch linux, ubuntu, etc...), or would they just have to make one binary and it would work across all distros?

    Read the article

  • New Oracle EM Book: "Oracle Enterprise Manager Grid Control Advanced OEM Techniques for the Real World" - First to include EM11g

    - by cristobal.soto(at)oracle.com
    The first book written about Enterprise Manager that covers the new Enterprise Manager Grid Control 11g which was released in April 2010 can be ordered now at a significant discount from http://www.rampant-books.com/book_1001_advanced_techniques_oem_grid_control.htmAbout the Author: Porus HavewalaPorus is a Senior Manager (Database Management) in the Enterprise Technology Program Office of Oracle Corporation based in Singapore. He has published numerous articles on Grid Control and RMAN on OTN, and created the world's first blog dedicated to Grid Control. Porus frequently speaks about Enterprise Manager at industry conferences and has created and executed an innovative program of seminars and workshops.

    Read the article

  • Do I need "cube subclasses" to represent the blocks in a Minecraft-like world?

    - by stighy
    I would like to try to develop a very simple game like Minecraft for my own education. My main problem at the moment is figuring out how to model classes that represent the world, which will be made of blocks of various types (such as dirt, stone and sand). I am thinking of creating the following class structure: Cube (with proprerties like color, strength, flammable, gravity) with subclasses: Dirt Stone Sand et cetera My question is, do I need the Cube subclasses or a single class Cube sufficient?

    Read the article

  • World of warcraft wont install because of error concerning "agent.exe"?

    - by Stanton.Sculpture
    I've been trying to install World of Warcraft with no luck. I looked in the forums and this guy has been having the same problem: http://us.battle.net/wow/en/forum/topic/7005434029#new-post I can't get past the checking for updates screen until I get this error message: https://us.battle.net/support/en/article/BLZPTS00007 Tried installing it through Playonlinux too and its the same problem for the most part. Looking for any help. Thank you!

    Read the article

  • Goodbye, Estonian Kroon. Hello, euro!

    - by Theresa Hickman
    Happy New Year! As of the stroke of midnight on 1/1/11, Estonia became a member of the Euro zone. Keeping consistent with the #1 theme, they're the first former Soviet bloc country to do so. With a population of only 1.34M (wouldn't it have been ironic if their population was 1.11M?), Estonia is one of the least-populated countries in Europe to join the European Union. Its currency, the Estonian Kroon was converted at its fixed rate of 15.6466 Kroons to the Euro. Some of its neighbors, such as Lithuania and Latvia, also hope to join the Euro zone soon, but who knows now that there is so much turmoil.

    Read the article

  • Farseer circle hangs where it's spawned

    - by necrosmash
    I'm currently trying to simply spawn a circle in Farseer. However, it's stuck wherever I spawn it! The game is updating fine, as I can see the circle spinning in place when I spawn it because of how I currently have gravity set up (following code from Game1.cs): // Initialise the screen center for use with // the Level class screenCenter = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2f, graphics.GraphicsDevice.Viewport.Height / 2f); world = new World(new Vector2(20, 20)); currentLevel = new Level1(screenCenter, circleSprite, groundSprite, ref world); Level1 constructor: public Level1(Vector2 screenCenter, Texture2D circleSprite, Texture2D groundSprite, ref World world) { player = new Player(ref world, screenCenter, circleSprite); ground = new Ground(ref world, screenCenter, groundSprite); listLevelItems = new List<LevelItem>(); listLevelItems.Add(player); listLevelItems.Add(ground); } Player constructor: public Player(ref World world, Vector2 screenCenter, Texture2D sprite) { setSprite(sprite); setPosition((screenCenter / MeterInPixels) + new Vector2(0f, 0f)); playerBody = BodyFactory.CreateCircle(world, 96f / (2f * MeterInPixels), 1f, playerPosition); getBody().BodyType = BodyType.Dynamic; // Ball bounce and friction getBody().Restitution = 0.3f; getBody().Friction = 0.5f; } If I use a breakpoint and change the playerBody position while the game is halted, the ball does move, but stays fixed in its new location. Any help would be greatly appreciated.

    Read the article

  • What is occurring in the world of server-side technologies in regards to the mobile app boom?

    - by Akromyk
    With mobile technologies becoming increasingly popular what is happening on the server-side with most of these apps when they need to communicate with a back end? I'm used to the world of technology from 10 years ago when most resources were accessed by requesting a dynamic web page that behind the seen used a server-side language to get the information it needed from a relational database. Is this still the case, and if not, what are the big changes?

    Read the article

  • IndexOutOfRangeException on World.Step after enabling/disabling a Farseer physics body?

    - by WilHall
    Earlier, I posted a question asking how to swap fixtures on the fly in a 2D side-scroller using Farseer Physics Engine. The ultimate goal being that the player's physical body changes when the player is in different states (I.e. standing, walking, jumping, etc). After reading this answer, I changed my approach to the following: Create a physical body for each state when the player is loaded Save those bodies and their corresponding states in parallel lists Swap those physical bodies out when the player state changes (which causes an exception, see below) The following is my function to change states and swap physical bodies: new protected void SetState(object nState) { //If mBody == null, the player is being loaded for the first time if (mBody == null) { mBody = mBodies[mStates.IndexOf(nState)]; mBody.Enabled = true; } else { //Get the body for the given state Body nBody = mBodies[mStates.IndexOf(nState)]; //Enable the new body nBody.Enabled = true; //Disable the current body mBody.Enabled = false; //Copy the current body's attributes to the new one nBody.SetTransform(mBody.Position, mBody.Rotation); nBody.LinearVelocity = mBody.LinearVelocity; nBody.AngularVelocity = mBody.AngularVelocity; mBody = nBody; } base.SetState(nState); } Using the above method causes an IndexOutOfRangeException when calling World.Step: mWorld.Step(Math.Min((float)nGameTime.ElapsedGameTime.TotalSeconds, (1f / 30f))); I found that the problem is related to changing the .Enabled setting on a body. I tried the above function without setting .Enabled, and there was no error thrown. Turning on the debug views, I saw that the bodies were updating positions/rotations/etc properly when the state was changes, but since they were all enabled, they were just colliding wildly with each other. Does Enabling/Disabling a body remove it from the world's body list, which then causes the error because the list is shorter than expected? Update: For such a straightforward issue, I feel this question has not received enough attention. Has anyone else experienced this? Would anyone try a quick test case? I know this issue can be sidestepped - I.e. by not disabling a body during the simulation - but it seems strange that this issue would exist in the first place, especially when I see no mention of it in the documentation for farseer or box2d. I can't find any cases of the issue online where things are more or less kosher, like in my case. Any leads on this would be helpful.

    Read the article

  • Which class should store the lookup table?

    - by max
    The world contains agents at different locations, with only a single agent at any location. Each agent knows where he's at, but I also need to quickly check if there's an agent at a given location. Hence, I also maintain a map from locations to agents. I have a problem deciding where this map belongs to: class World, class Agent (as a class attribute) or elsewhere. In the following I put the lookup table, agent_locations, in class World. But now agents have to call world.update_agent_location every time they move. This is very annoying; what if I decide later to track other things about the agents, apart from their locations - would I need to add calls back to the world object all across the Agent code? class World: def __init__(self, n_agents): # ... self.agents = {} self.agent_locations = {} for id in range(n_agents): x, y = self.find_location() agent = Agent(self,x,y) self.agents.append(agent) self.agent_locations[x,y] = agent def update_agent_location(self, agent, x, y): del self.agent_locations[agent.x, agent.y] self.agent_locations[x, y] = agent def update(self): # next step in the simulation for agent in self.agents: agent.update() # next step for this agent # ... class Agent: def __init__(self, world, x, y): self.world = world self.x, self.y = x, y def move(self, x1, y1): self.world.update_agent_location(self, x1, y1) self.x, self.y = x1, y1 def update(): # find a good location that is not occupied and move there for x, y in self.valid_locations(): if not self.location_is_good(x, y): continue if self.world.agent_locations[x, y]: # location occupied continue self.move(x, y) I can instead put agent_locations in class Agent as a class attribute. But that only works when I have a single World object. If I later decide to instantiate multiple World objects, the lookup tables would need to be world-specific. I am sure there's a better solution... EDIT: I added a few lines to the code to show how agent_locations is used. Note that it's only used from inside Agent objects, but I don't know if that would remain the case forever.

    Read the article

  • What do you need to know to be a world-class master software developer? [closed]

    - by glitch
    I wanted to bring up this question to you folks and see what you think, hopefully advise me on the matter: let's say you had 30 years of learning and practicing software development in front of you, how would you dedicate your time so that you'd get the biggest bang for your buck. What would you both learn and work on to be a world-class software developer that would make a large impact on the industry and leave behind a legacy? I think that most great developers end up being both broad generalists and specialists in one-two areas of interest. I'm thinking Bill Joy, John Carmack, Linus Torvalds, K&R and so on. I'm thinking that perhaps one approach would be to break things down by categories and establish a base minimum of "software development" greatness. I'm thinking: Operating Systems: completely internalize the core concepts of OS, perhaps gain a lot of familiarity with an OSS one such as Linux. Anything from memory management to device drivers has to be complete second nature. Programming Languages: this is one of those topics that imho has to be fully grokked even if it might take many years. I don't think there's quite anything like going through the process of developing your own compiler, understanding language design trade-offs and so on. Programming Language Pragmatics is one of my favorite books actually, I think you want to have that internalized back to back, and that's just the start. You could go significantly deeper, but I think it's time well spent, because it's such a crucial building block. As a subset of that, you want to really understand the different programming paradigms out there. Imperative, declarative, logic, functional and so on. Anything from assembly to LISP should be at the very least comfortable to write in. Contexts: I believe one should have experience working in different contexts to truly be able to appreciate the trade-offs that are being made every day. Embedded, web development, mobile development, UX development, distributed, cloud computing and so on. Hardware: I'm somewhat conflicted about this one. I think you want some understanding of computer architecture at a low level, but I feel like the concepts that will truly matter will be slightly higher level, such as CPU caching / memory hierarchy, ILP, and so on. Networking: we live in a completely network-dependent era. Having a good understanding of the OSI model, knowing how the Web works, how HTTP works and so on is pretty much a pre-requisite these days. Distributed systems: once again, everything's distributed these days, it's getting progressively harder to ignore this reality. Slightly related, perhaps add solid understanding of how browsers work to that, since the world seems to be moving so much to interfacing with everything through a browser. Tools: Have a really broad toolset that you're familiar with, one that continuously expands throughout the years. Communication: I think being a great writer, effective communicator and a phenomenal team player is pretty much a prerequisite for a lot of a software developer's greatness. It can't be overstated. Software engineering: understanding the process of building software, team dynamics, the requirements of the business-side, all the pitfalls. You want to deeply understand where what you're writing fits from the market perspective. The better you understand all of this, the more of your work will actually see the daylight. This is really just a starting list, I'm confident that there's a ton of other material that you need to master. As I mentioned, you most likely end up specializing in a bunch of these areas as you go along, but I was trying to come up with a baseline. Any thoughts, suggestions and words of wisdom from the grizzled veterans out there who would like to share their thoughts and experiences with this? I'd really love to know what you think!

    Read the article

  • Classes / instances in Ontology

    - by SODA
    Hi, I'm trying to comprehend ontology basics. Here's an example: car (class) 2009 VW CC (sub-class or instance?) My neighbor's 2009 VW CC (instance) My issue is understanding what is "2009 VW CC" (as a car model). If you're making product model a sub-class in the ontology - all of a sudden your ontology becomes bloated with thousands of subclasses of a "car". That's redundant. At the same time we can't say "2009 VW CC" is an instance, at least it's not material instance of a class. Does it make sense to distinguish between regular instances and material (distinct physical objects)? At the other hand, if both are instances (of different nature so to say), then how can instance inherit properties / relations of a non-class?

    Read the article

  • App.Config or XAML

    - by Florian Doyon
    Hi ladies(?) and gents, I am currently evaluating my options for a rewrite of the projects I'm working on and I am a bit miffed by the stringly-typed nature of our app.config files. I'd like to move to a more structured approach, so I have two options: Use custom SectionHandlers in the app.config Scrap app.config and use XAML instead. I'd like to get your opinions and horror stories on this, what are the pros and cons of using XAML for this? Cheers, Florian

    Read the article

  • Black hole generator [closed]

    - by Timmy O' Tool
    I have a requirement for developing a black hole generator. They say that this may allow time travel and getting rich... whatever...what do you think it's the best approach for black hole generator a) Infinite loop while (1==1) blackHole++; b) Division by 0 try { 6/0 } catch { //blackHoleGenerated }

    Read the article

  • How do i parse the new wow RSS feed? (LINQ to XML)

    - by Sunzaru Sven
    The link i want to parse is here. I'm looking to parse it in "real time" so that as things happen i can send myself messages/tweets and what not. I plan on having each element of the XML from the feed as an item of a class/struct. I'm really looking for LINQ to XML examples, and a good book. I've seen other LINQ to XML articles out there, but i'm just not grasping how they work. Old SQL minds are hard to break perhaps... /shrug.

    Read the article

  • Is there a 'hello world' website for django? OR (I've installed django, now what) ?

    - by morpheous
    I'm learning Python and decided to start familiarizing myself with the (defacto?) Python web framework - django. I have successfully installed the latest release of django. I want a simple 'hello world' website that will get me up and running quickly. I am already familiar with web frameworks (albeit for different languages) - so I just need a simple 'hello world' example website to help me get going. Ideally, I don't want to mess up with my Apache server settings (as I am still experimenting), so I want to use the lightweight web server that django bundles. I cant seem to find how to do this on the django website though - no doubt someone will post a link and shame me ... So, does anyone know of a link that shows how to get a simple 'hello world' django website up and running with minimal fuss?

    Read the article

  • Scorpion Tears Through World Level 1-1 from the Original Super Mario Bros. [Video]

    - by Asian Angel
    What could be more fun than playing some classic Super Mario Brothers? Playing Super Mario Brothers with Scorpion as your character! This fun video shows Scorpion tearing his way through World Level 1-1 in style from beginning to end. Super Mario Kombat (Super Mario Bros. / Mortal Kombat) [via NicksplosionFX] How to Own Your Own Website (Even If You Can’t Build One) Pt 1 What’s the Difference Between Sleep and Hibernate in Windows? Screenshot Tour: XBMC 11 Eden Rocks Improved iOS Support, AirPlay, and Even a Custom XBMC OS

    Read the article

  • Are there real world applications where the use of prefix versus postfix operators matters?

    - by Kenneth
    In college it is taught how you can do math problems which use the ++ or -- operators on some variable referenced in the equation such that the result of the equation would yield different results if you switched the operator from postfix to prefix or vice versa. Are there any real world applications of using postfix or prefix operator where it makes a difference as to which you use? It doesn't seem to me (maybe I just don't have enough experience yet in programming) that there really is much use to having the different operators if it only applies in math equations. EDIT: Suggestions so far include: function calls //f(++x) != f(x++) loop comparison //while (++i < MAX) != while (i++ < MAX)

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >