Search Results

Search found 984 results on 40 pages for 'assets'.

Page 9/40 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Java File and ByteArray or InputStream - please quick help

    - by Peter Perhác
    I want to use jFuge to play some MIDI music in an applet. There's a class for the MIDI pattern - Pattern - and the only method to load the pattern is from a File. Now, I don't know how applets load files and what not, but I am using a framework (PulpCore) that makes loading assets a simple task. If I need to grab an asset from a ZIP catalogue, I can use the Assets class which provides get() and getAsStream() methods. get() returns the given asset as a ByteArray, the other as an InputStream. I need jFuge to load the pattern from either ByteArray or InputStream. In pseudo-code, I would like to do this: Pattern.load(new File(Assets.get("mymidifile.midi"))); however there is no File constructor that would take a ByteArray. Suggestions, please?

    Read the article

  • Anyone using a CMS with a DAM back-end for Asset Management?

    - by Valien
    Anyone here have any experience with using a CMS system for content and populating the site with images/assets from a DAM system? Working with a large number of assets (photos, logos, files, etc) that will be stored on a DAM system for management, revisions, etc. Would like to build a front-end system to help serve up the assets for the users as well as keep the general site updated with non-asset information (like what's new, faq's, etc.) Any ideas/thoughts on this from anyone who has been down this path? Thanks! ~Allen

    Read the article

  • Concise SSE and MMX instruction reference with latencies and throughput

    - by Joe
    I am trying to optimize some arithmetic by using the MMX and SSE instruction sets with inline assembly. However, I have been unable to find good references for the timings and usages of these enhanced instruction sets. Could you please help me find references that contain information about the throughput, latency, operands, and perhaps short descriptions of the instructions? So far, I have found: Intel Instruction References http://www.intel.com/Assets/PDF/manual/253666.pdf http://www.intel.com/Assets/PDF/manual/253667.pdf Intel Optimization Guide http://www.intel.com/Assets/PDF/manual/248966.pdf Timings of Integer Operations http://gmplib.org/~tege/x86-timing.pdf

    Read the article

  • Asset tracking in "real-time" - how best to display in browser?

    - by mawg
    I am developing an asset tracking system, standard LAMP, and now am wondering how best to present the data to the user in the browser. I expect to track and most a few thousand items, and to refresh them every second or so. I want to draw a floorplan or map of the area and represent the assets the assets symbolically on that (with different symbols for different classes of assets). Additionally, the user should be able to click on an asset to interact with it, and search for a particular asset and centre the screen on it, draw a circle round it, etc http://graphite.wikidot.com/ Looks good - is there any alternative? At its simplest, I suppose I could just generate a JPEG and display it, using CSS to let me know if/where a user clicks ... but what's the "best" way to do it?

    Read the article

  • How to optimize frame rate in Flash/Actionscript?

    - by LillyWolf
    I'm building an application in Actionscript using Flash assets, and my frame rate becomes very low (~7 fps) when I attempt to render 20+ assets on the screen, even though most of those assets are stopped movie clips. I've tried setting .cacheAsBitmap to true, which helps a bit, but not enough. What else can I do to get the frame rate up? I've noticed that some movie clips seem to impact it more than others, but I'm not sure how to alter them to make them easier to render. Thanks!

    Read the article

  • Downloading game assests to SD card on Android

    - by hgpc
    I'm developing an Android game that has to download some assets to the SD card to keep the size of the app as small as possible. I was thinking of using an uncompressed zip file to bundle all the assets. A requirement from the client is to protect these assets as much as possible. Being part of the apk is considered enough protection, but if I do this the apk size will be enormous. If I just put a zip bundle in the SD card, then anyone can unzip it and explore its contents. Is there a simple way to do this without retorting to horrid DRM? Obviously if someone really wants to check the resources of an Android game, they can. I'm just looking for a simple solution to avoid making this very easy.

    Read the article

  • How To: Use Monitoring Rules and Policies

    - by Owen Allen
    One of Ops Center's most useful features is its asset monitoring capability. When you discover an asset - an operating system, say, or a server - a default monitoring policy is applied to it, based on the asset type. This policy contains rules that specify what properties are monitored and what thresholds are considered significant. Ops Center will send a notification if a monitored asset passes one of the specified thresholds. But sometimes you want different assets to be monitored in different ways. For example, you might have a group of mission-critical systems, for which you want to be notified immediately if their file system usage rises above a specific threshold. You can do so by creating a new monitoring policy and applying it to the group. You can also apply monitoring policies to individual assets, and edit them to meet the requirements of your environment. The Tuning Monitoring Rules and Policies How-To walks you through all of these procedures.

    Read the article

  • Is there any existing (old) game that released graphic as free or open source?

    - by Alexey Petrushin
    I'd like to (re)create an online version (html5/JS) of some old game, for example something like HoM&M 2. Maybe, some of old games were released as free or open source (I'm interested in the graphical assets only)? I heard something about Red Alert been released as free, but I'm not sure if it's permitted to reuse graphical assets in such manner. Do You know such games? Another question - can You please share Your thoughts, rough estimate - how much it will cost to pay an artist to create graphics similar to HoM&M 2?

    Read the article

  • What do you use to bundle / encrypt data?

    - by David McGraw
    More and more games are going the data driven route which means that there needs to be a layer of security around easy manipulation. I've seen it where games completely bundle up their assets (audio, art, data) and I'm wondering how they are managing that? Are there applications / libraries that will bundle and assist you with managing the assets within? If not is there any good resources that you would point to for packing / unpacking / encryption? This specific question revolves around C++, but I would be open to hear how this is managed in C#/XNA as well. Just to be clear -- I'm not out to engineer a solution to prevent hacking. At the fundamental level we're all manipulating 0's and 1's. But, we do want to keep the 99% of people that play the game from simply modifying XML files that are used to build the game world. I've seen plenty of games bundle all of their resources together. I'm simply curious about the methods they're using.

    Read the article

  • Does 3d modeling software *choice used during asset creation affect performance at runtime

    - by user134143
    Does software used to create 3d assets (for game development specifically) have an impact on the efficiency of the program. In other words. Is it possible to reduce the operating footprint of an application merely by utilizing alternative development software during production of 3d assets. If you use two different applications to create a 3 dimensional image of a box, can one of them result in better performance if aspects of the image are identical? Sorry if this question seems vague, I am attempting to get the information I need without causing unnecessary debate over specific software choice. Thank you.

    Read the article

  • How to implement a game launch counter in LibGDX

    - by Vishal Kumar
    I'm writing a game using LibGDX in which I want to save the number of launches of a game in a text file. So, In the create() of my starter class, I have the following code ..but it's not working public class MainStarter extends Game { private int count; @Override public void create() { // Set up the application AppSettings.setUp(); if(SettingsManager.isFirstLaunch()){ SettingsManager.createTextFileInLocalStorage("gamedata"); SettingsManager.writeLine("gamedata", "Launched:"+count ,FileType.LOCAL_FILE ); } else{ SettingsManager.writeLine("gamedata", "Not First launch :"+count++ ,FileType.LOCAL_FILE ); } // // Load assets before setting the screen // ##################################### Assets.loadAll(); // Set the tests screen setScreen(new MainMenuScreen(this, "Main Menu")); } } What is the proper way to do this?

    Read the article

  • WebCenter Customer Spotlight: Guizhou Power Grid Company

    - by me
    Author: Peter Reiser - Social Business Evangelist, Oracle WebCenter  Solution SummaryGuizhou Power Grid Company is responsible for power grid planning, construction, management, and power distribution in Guizhou Province, serving 39 million people. Giuzhou has 49,823 employees and an annual revenue of over $5 Billion. The business objectives were to consolidate information contained in disparate systems into a single knowledge repository and provide a safe and efficient way for staff and managers to access, query, share, manage, and store business information. Guizhou Power Grid Company saved more than US$693,000 in storage costs, reduced  average search times from 180 seconds to 5 seconds and solved 80% to 90% of technology and maintenance issues by searching the Oracle WebCenter Content management system. Company OverviewA wholly owned subsidiary of China Southern Power Grid Company Limited, Guizhou Power Grid Company is responsible for power grid planning, construction, management, and power distribution in Guizhou Province, serving 39 million people. Giuzhou has 49,823 employees and an annual revenue of over $5 Billion. Business ChallengesThe business objectives were to consolidate information contained in disparate systems, such as the customer relationship management and power grid management systems, into a single knowledge repository and provide a safe and efficient way for staff and managers to access, query, share, manage, and store business information. Solution DeployedGuizhou Power Grid Company  implemented Oracle WebCenter Content to build a content management system that enabled the secure, integrated management and storage of information, such as documents, records, images, Web content, and digital assets. The content management solution was integrated with the power grid, customer service, maintenance, and other business systems, as well as the corporate Web site. Business Results Saved more than US$693,000 in storage costs and shortened the material distribution time by integrating the knowledge management solution with the power grid, customer service, maintenance, and other business systems, as well as the corporate Web site Enabled staff to search 31,650 documents using catalogs, multidimensional attributes, and knowledge maps, reducing average search times from 180 seconds to 5 seconds and saving approximately 1,539 hours in annual search time Gained comprehensive document management, format transformation, security, and auditing capabilities Enabled users to upload new documents and supervisors to check the accuracy of these documents online, resulting in improved information quality control Solved 80% to 90% of technology and maintenance issues by searching the Oracle content management system for information, ensuring IT staff can respond quickly to users’ technical problems Improved security by using role-based access controls to restrict access to confidential documents and information Supported the efficient classification of corporate knowledge by using Oracle’s metadata functions to collect, tag, and archive documents, images, Web content, and digital assets “We chose Oracle WebCenter Content, as it is an outstanding integrated content management platform. It has allowed us to establish a system to access, query, share, manage, and store our corporate assets. This has laid a solid foundation for Guizhou Power Grid Company to improve management practices.” Luo Sixi, Senior Information Consultant, Guizhou Power Grid Company Additional Information Guizhou Power Grid Company Customer Snapshot Oracle WebCenter Content

    Read the article

  • Better way to load level content in XNA?

    - by user2002495
    Currently I loaded all my assets in XNA in the main Game class. What I want to achieve later is that I only load specific assets for specific levels (the game will consist of many levels). Here is how I load my main assets into the main class: protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); plane = new Player(Content.Load<Texture2D>(@"Player/playerSprite"), 6, 8); plane.animation = "down"; plane.pos = new Vector2(400, 500); plane.fps = 15; Global.currentPos = plane.pos; lvl1 = new Level1(Content.Load<Texture2D>(@"Levels/bgLvl1"), Content.Load<Texture2D>(@"Levels/bgLvl1-other"), new Vector2(0, 0), new Vector2(0, -600)); CommonBullet.LoadContent(Content); CommonEnemyBullet.LoadContent(Content); } protected override void UnloadContent() { } protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); plane.Update(gameTime); lvl1.Update(gameTime); foreach (CommonEnemy ce in cel) { if (ce.CollidesWith(plane)) { ce.hasSpawn = false; } foreach (CommonBullet b in plane.commonBulletList) { if (b.CollidesWith(ce)) { ce.hasSpawn = false; } } ce.Update(gameTime); } LoadCommonEnemy(); base.Update(gameTime); } private void LoadCommonEnemy() { int randY = rand.Next(-600, -10); int randX = rand.Next(0, 750); if (cel.Count < 3) { cel.Add(new CommonEnemy(Content.Load<Texture2D>(@"Enemy/Common/commonEnemySprite"), 7, 2, "left", randX, randY)); } for (int i = 0; i < cel.Count; i++) { if (!cel[i].hasSpawn) { cel.RemoveAt(i); i--; } } } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(); lvl1.Draw(spriteBatch); plane.Draw(spriteBatch); foreach (CommonEnemy ce in cel) { ce.Draw(spriteBatch); } spriteBatch.End(); base.Draw(gameTime); } I wish to load my players, enemies, all in Level1 class. However, when I move my player & enemy code into the Level1 class, the gameTime returns null. Here is my Level1 class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Input; using SpaceShooter_Beta.Animation.PlayerCollection; using SpaceShooter_Beta.Animation.EnemyCollection.Common; namespace SpaceShooter_Beta.Levels { public class Level1 { public Texture2D bgTexture1, bgTexture2; public Vector2 bgPos1, bgPos2; public float speed = 5f; Player plane; public Level1(Texture2D texture1, Texture2D texture2, Vector2 pos1, Vector2 pos2) { this.bgTexture1 = texture1; this.bgTexture2 = texture2; this.bgPos1 = pos1; this.bgPos2 = pos2; } public void LoadContent(ContentManager cm) { plane = new Player(cm.Load<Texture2D>(@"Player/playerSprite"), 6, 8); plane.animation = "down"; plane.pos = new Vector2(400, 500); plane.fps = 15; Global.currentPos = plane.pos; } public void Draw(SpriteBatch sb) { sb.Draw(bgTexture1, bgPos1, Color.White); sb.Draw(bgTexture2, bgPos2, Color.White); plane.Draw(sb); } public void Update(GameTime gt) { bgPos1.Y += speed; bgPos2.Y += speed; if (bgPos1.Y >= 600) { bgPos1.Y = -600; } if (bgPos2.Y >= 600) { bgPos2.Y = -600; } plane.Update(gt); } } } Of course when I did this, I delete all my player's code in the main Game class. All of that works fine (no errors) except that the game cannot start. The debugger says that plane.Update(gt); in Level 1 class has null GameTime, same thing with the Draw method in the Level class. Please help, I appreciate for the time. [EDIT] I know that using switch in the main class can be a solution. But I prefer a cleaner solution than that, since using switch still means I need to load all the assets through the main class, the code will be A LOT later on for each levels

    Read the article

  • How to I teach my artist to do arts for games?

    - by Holm76
    So my girlfriend is an artist and I'm a programmer and we often talk about joining talents and doing some small games or other fun stuff for the different popular platforms currently out. But because I haven't really done any serious games development yet I have a hard time explaining to her how she should create or package the assets she'd make so we always end up not doing nothing about it. What I'm mostly thinking about here is when doing frame by frame animation. I know sprite sheets are used for this kind of thing but then comes questions like frames per second and stuff like like that. Not program wise but art wise. Is there a reference site or sites out there that teach someone with the skills of art how to manage and arrange the assets in sprite sheets and other stuff in words that artists understand?

    Read the article

  • Animating isometric sprites

    - by Mike
    I'm having trouble coming up with a way to animate these 2D isometric sprites. The sprites are stored like this: < Game Folder Root /Assets/Sprites/< Sprite Name /< Sprite Animation /< Sprite Direction /< Frame Number .png So for example, /Assets/Sprites/Worker/Stand/North-East/01.png Sprite sheets aren't really viable for this type of animation. The example stand animation is 61 frames. 61 frames for all 8 directions alone is huge, but there's more then just a standing animation for each sprite. Creating an sf::Texture for every image and every frame seems like it will take up a lot of memory and be hard to keep track of that many images. Unloading the image and loading the next one every single frame seems like it will do a lot of unnecessary work. What's the best way to handle this?

    Read the article

  • WebCenter Customer Spotlight: Sberbank of Russia

    - by me
    Author: Peter Reiser - Social Business Evangelist, Oracle WebCenter  Solution SummarySberbank of Russia is the largest credit institution in Russia and the Commonwealth of Independent States (CIS), accounting for 27% of Russian banking assets and 26% of Russian banking capital.Sberbank of Russia needed to increase business efficiency and employee productivity due to the growth in its corporate clientele from 1.2 million to an estimated 1.6 million.Sberbank of Russia deployed Oracle’s Siebel Customer Relationship Management (CRM) applications to create a single client view, optimize client communication, improve efficiency, and automate distressed asset processing. Based on Oracle WebCenter Content, they implemented an enterprise content management system for documents, unstructured content storage and search, which became an indispensable service across the organization and in the board room business results. Sberbank of Russia consolidated borrower information across the entire organization into a single repository to obtain, for the first time, a single view on the bank’s borrowers. With the implemented solution they reducing the amount of bad debt significantly. Company OverviewSberbank of Russia is the largest credit institution in Russia and the Commonwealth of Independent States (CIS), accounting for 27% of Russian banking assets and 26% of Russian banking capital. In 2010, it ranked 43rd in the world for Tier 1 capital. Business ChallengesSberbank of Russia needed to increase business efficiency and employee productivity due to the growth in its corporate clientele from 1.2 million to an estimated 1.6 million. It also wanted to automate distressed asset management to reduce the number of corporate clients’ bad debts. As part of their business strategy they wanted to drive high-quality, competitive customer services by simplifying client communication processes and enabling personnel to quickly access client information Solution deployedSberbank of Russia deployed Oracle’s Siebel Customer Relationship Management (CRM) applications to create a single client view, optimize client communication, improve efficiency, and automate distressed asset processing. Based on Oracle WebCenter Content, they implemented an enterprise content management system for documents, unstructured content storage and search which became an indispensable service across the organization and in the board room business results. Business ResultsSberbank of Russia consolidated borrower information across the entire organization into a single repository to obtain, for the first time, a single view on the bank’s borrowers. They monitored 103,000 client transactions and 32,000 bank cards with credit collection issues (100% of Sberbank’s bad borrowers) reducing the amount of bad debt significantly. “Innovation and client service are the foundation of our business strategy. Oracle’s Siebel CRM applications helped advance our objectives by enabling us to deliver faster, more personalized service while managing and tracking distressed assets.” A.B. Sokolov, Head of Center of Business Administration and Customer Relationship Management, Sberbank of Russia Additional Information Sberbank of Russia Customer Snapshot Oracle WebCenter Content Siebel Customer Relationship Management 8.1 Oracle Business Intelligence, Enterprise Edition 11g

    Read the article

  • Animations not accepted in animator

    - by Lautaro
    In the official Unity Animator State Machine tutorial video animation clips are dragged out from the assets folder into the animator and dropped. I have a 3D model that i bought online to experiment with that comes with animations. I added a custom made animation as well. These all work well in my demo project. But when i add a animator to the assets and try to drag and drop animations onto it it doesnt work. I get a forbidden-sign as a mouse pointer. I try to add animations through the inspector but that does not work either. The tutorials makes it seem so easy and does not talk anything about what animations can be used. What am i doing wrong?

    Read the article

  • Getting Started Quickly

    - by Owen Allen
    If you're interested in using Ops Center, you'll want to get up and running as quickly and effectively as possible. One way to do this would be to work your way through the documentation library - use the Linux or Oracle Solaris install guides, then go through the Feature Guide and Admin Guide to start using the software. They're thorough, but they're a lot of reading. But if you're looking to install a simple deployment quickly, and you don't want to do all of the configuration work right off the bat, you can use the Quick Start Guide. It's a streamlined procedure that runs you through installing a single Enterprise Controller and co-located Proxy Controller, and then shows you how to discover assets quickly. Once you've discovered these assets, it describes how to use the analytics feature to view their performance, and use monitoring to keep track of their statuses and health. You'll have to do some additional configuration to use features like OS provisioning, OS updates, and virtualization, but the Quick Start guide gives you an overview of how to install and start using features quickly.

    Read the article

  • (Phaser) Preload Future States in Create?

    - by Brian
    I'm a first time user of Phaser, been trying to make a simple point and click type game. I'm trying to keep things very modular, so I'm defining a list of levels (states) in a JSON, and then every level has its own JSON containing the objects within that level. However, I'm encountering an issue in that, when changing states, I get a black flash while the assets for the next state load (this happens whether I iterate through the JSON list or define everything manually). From what I've read, all sprites should be loaded in the preload stage, however, by doing this I'm causing that tiny but noticeable black pause. I know one way would be to simply load every asset at the start of the game, but that seems incredibly inefficient (wouldn't that fill up the memory immensely?). I would rather load a state's assets from the "parent" state. However, in my quick test (which maybe I did wrong) it seems that game.load doesn't work properly if done within the create stage? What is the best approach to doing this?

    Read the article

  • How to find if a Item in a ListBox has the focus?

    - by eitan barazani
    I have a List box defined like this: <ListBox x:Name="EmailList" ItemsSource="{Binding MailBoxManager.Inbox.EmailList}" SelectedItem="{Binding SelectedMessage, Mode=TwoWay}" Grid.Row="1"> <ListBox.ItemTemplate> <DataTemplate> <usrctrls:MessageSummary /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> The UserControl is defined like this: <UserControl x:Class="UserControls.MessageSummary" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="600"> <UserControl.Resources> </UserControl.Resources> <Grid HorizontalAlignment="Left"> <Grid.ColumnDefinitions> <ColumnDefinition Width="50" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <CheckBox Grid.Column="0" VerticalAlignment="Center" /> <Grid Grid.Column="1" Margin="0,0,12,0"> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Grid Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch"> <Grid.ColumnDefinitions> <ColumnDefinition Width="30" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="80" /> <ColumnDefinition Width="80" /> </Grid.ColumnDefinitions> <Image x:Name="FlaggedImage" Grid.Column="0" Width="20" Height="10" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center" Source="/Assets/ico_flagged_white.png" /> <TextBlock x:Name="Sender" Grid.Column="1" Text="{Binding EmailProperties.DisplayFrom}" Style="{StaticResource TextBlock_SenderRowTitle}" HorizontalAlignment="Left" VerticalAlignment="Center" /> <Grid x:Name="ImagesContainer" Grid.Column="2" VerticalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Image x:Name="ImgImportant" Grid.Column="0" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Source="ms-appx:///Assets/ico_important_red.png" /> <Image x:Name="ImgFolders" Grid.Column="1" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Source="ms-appx:///Assets/ico_ico_addtofolder.png" /> <Image x:Name="ImgAttachment" Grid.Column="2" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Source="ms-appx:///Assets/ico_attachment_lightgray.png" /> <Image x:Name="ImgFlag" Grid.Column="3" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Source="ms-appx:///Assets/ico_flag.png" /> </Grid> <TextBlock x:Name="Time" Grid.Column="3" Text="{Binding EmailProperties.DateReceived, Converter={StaticResource EmailHeaderTimeConverter}}" TextAlignment="Center" FontSize="16" VerticalAlignment="Center" Margin="0" /> </Grid> <TextBlock Grid.Row="1" Text="{Binding EmailProperties.Subject}" TextTrimming="WordEllipsis" Margin="0,10" /> <TextBlock Grid.Row="2" Text="{Binding EmailProperties.Preview}" TextTrimming="WordEllipsis" /> </Grid> </Grid> The MessageSummary is a UserControl. I would like to bind the foreground color of the Items of the ListBox to whether the item is the one selected in the list box, i.e. I would like the Item's foreground color to be Black if not selected and White if the item is selected. How can it be done? Thanks,

    Read the article

  • Help getting frame rate (fps) up in Python + Pygame

    - by Jordan Magnuson
    I am working on a little card-swapping world-travel game that I sort of envision as a cross between Bejeweled and the 10 Days geography board games. So far the coding has been going okay, but the frame rate is pretty bad... currently I'm getting low 20's on my Core 2 Duo. This is a problem since I'm creating the game for Intel's March developer competition, which is squarely aimed at netbooks packing underpowered Atom processors. Here's a screen from the game: ![www.necessarygames.com/my_games/betraveled/betraveled-fps.png][1] I am very new to Python and Pygame (this is the first thing I've used them for), and am sadly lacking in formal CS training... which is to say that I think there are probably A LOT of bad practices going on in my code, and A LOT that could be optimized. If some of you older Python hands wouldn't mind taking a look at my code and seeing if you can't find any obvious areas for optimization, I would be extremely grateful. You can download the full source code here: http://www.necessarygames.com/my_games/betraveled/betraveled_src0328.zip Compiled exe here: www.necessarygames.com/my_games/betraveled/betraveled_src0328.zip One thing I am concerned about is my event manager, which I feel may have some performance wholes in it, and another thing is my rendering... I'm pretty much just blitting everything to the screen all the time (see the render routines in my game_components.py below); I recently found out that you should only update the areas of the screen that have changed, but I'm still foggy on how that accomplished exactly... could this be a huge performance issue? Any thoughts are much appreciated! As usual, I'm happy to "tip" you for your time and energy via PayPal. Jordan Here are some bits of the source: Main.py #Remote imports import pygame from pygame.locals import * #Local imports import config import rooms from event_manager import * from events import * class RoomController(object): """Controls which room is currently active (eg Title Screen)""" def __init__(self, screen, ev_manager): self.room = None self.screen = screen self.ev_manager = ev_manager self.ev_manager.register_listener(self) self.room = self.set_room(config.room) def set_room(self, room_const): #Unregister old room from ev_manager if self.room: self.room.ev_manager.unregister_listener(self.room) self.room = None #Set new room based on const if room_const == config.TITLE_SCREEN: return rooms.TitleScreen(self.screen, self.ev_manager) elif room_const == config.GAME_MODE_ROOM: return rooms.GameModeRoom(self.screen, self.ev_manager) elif room_const == config.GAME_ROOM: return rooms.GameRoom(self.screen, self.ev_manager) elif room_const == config.HIGH_SCORES_ROOM: return rooms.HighScoresRoom(self.screen, self.ev_manager) def notify(self, event): if isinstance(event, ChangeRoomRequest): if event.game_mode: config.game_mode = event.game_mode self.room = self.set_room(event.new_room) def render(self, surface): self.room.render(surface) #Run game def main(): pygame.init() screen = pygame.display.set_mode(config.screen_size) ev_manager = EventManager() spinner = CPUSpinnerController(ev_manager) room_controller = RoomController(screen, ev_manager) pygame_event_controller = PyGameEventController(ev_manager) spinner.run() # this runs the main function if this script is called to run. # If it is imported as a module, we don't run the main function. if __name__ == "__main__": main() event_manager.py #Remote imports import pygame from pygame.locals import * #Local imports import config from events import * def debug( msg ): print "Debug Message: " + str(msg) class EventManager: #This object is responsible for coordinating most communication #between the Model, View, and Controller. def __init__(self): from weakref import WeakKeyDictionary self.listeners = WeakKeyDictionary() self.eventQueue= [] self.gui_app = None #---------------------------------------------------------------------- def register_listener(self, listener): self.listeners[listener] = 1 #---------------------------------------------------------------------- def unregister_listener(self, listener): if listener in self.listeners: del self.listeners[listener] #---------------------------------------------------------------------- def post(self, event): if isinstance(event, MouseButtonLeftEvent): debug(event.name) #NOTE: copying the list like this before iterating over it, EVERY tick, is highly inefficient, #but currently has to be done because of how new listeners are added to the queue while it is running #(eg when popping cards from a deck). Should be changed. See: http://dr0id.homepage.bluewin.ch/pygame_tutorial08.html #and search for "Watch the iteration" for listener in list(self.listeners): #NOTE: If the weakref has died, it will be #automatically removed, so we don't have #to worry about it. listener.notify(event) #------------------------------------------------------------------------------ class PyGameEventController: """...""" def __init__(self, ev_manager): self.ev_manager = ev_manager self.ev_manager.register_listener(self) self.input_freeze = False #---------------------------------------------------------------------- def notify(self, incoming_event): if isinstance(incoming_event, UserInputFreeze): self.input_freeze = True elif isinstance(incoming_event, UserInputUnFreeze): self.input_freeze = False elif isinstance(incoming_event, TickEvent): #Share some time with other processes, so we don't hog the cpu pygame.time.wait(5) #Handle Pygame Events for event in pygame.event.get(): #If this event manager has an associated PGU GUI app, notify it of the event if self.ev_manager.gui_app: self.ev_manager.gui_app.event(event) #Standard event handling for everything else ev = None if event.type == QUIT: ev = QuitEvent() elif event.type == pygame.MOUSEBUTTONDOWN and not self.input_freeze: if event.button == 1: #Button 1 pos = pygame.mouse.get_pos() ev = MouseButtonLeftEvent(pos) elif event.type == pygame.MOUSEMOTION: pos = pygame.mouse.get_pos() ev = MouseMoveEvent(pos) #Post event to event manager if ev: self.ev_manager.post(ev) #------------------------------------------------------------------------------ class CPUSpinnerController: def __init__(self, ev_manager): self.ev_manager = ev_manager self.ev_manager.register_listener(self) self.clock = pygame.time.Clock() self.cumu_time = 0 self.keep_going = True #---------------------------------------------------------------------- def run(self): if not self.keep_going: raise Exception('dead spinner') while self.keep_going: time_passed = self.clock.tick() fps = self.clock.get_fps() self.cumu_time += time_passed self.ev_manager.post(TickEvent(time_passed, fps)) if self.cumu_time >= 1000: self.cumu_time = 0 self.ev_manager.post(SecondEvent()) pygame.quit() #---------------------------------------------------------------------- def notify(self, event): if isinstance(event, QuitEvent): #this will stop the while loop from running self.keep_going = False rooms.py #Remote imports import pygame #Local imports import config import continents from game_components import * from my_gui import * from pgu import high class Room(object): def __init__(self, screen, ev_manager): self.screen = screen self.ev_manager = ev_manager self.ev_manager.register_listener(self) def notify(self, event): if isinstance(event, TickEvent): pygame.display.set_caption('FPS: ' + str(int(event.fps))) self.render(self.screen) pygame.display.update() def get_highs_table(self): fname = 'high_scores.txt' highs_table = None config.all_highs = high.Highs(fname) if config.game_mode == config.TIME_CHALLENGE: if config.difficulty == config.EASY: highs_table = config.all_highs['time_challenge_easy'] if config.difficulty == config.MED_DIF: highs_table = config.all_highs['time_challenge_med'] if config.difficulty == config.HARD: highs_table = config.all_highs['time_challenge_hard'] if config.difficulty == config.SUPER: highs_table = config.all_highs['time_challenge_super'] elif config.game_mode == config.PLAN_AHEAD: pass return highs_table class TitleScreen(Room): def __init__(self, screen, ev_manager): Room.__init__(self, screen, ev_manager) self.background = pygame.image.load('assets/images/interface/background.jpg').convert() #Initialize #--------------------------------------- self.gui_form = gui.Form() self.gui_app = gui.App(config.gui_theme) self.ev_manager.gui_app = self.gui_app c = gui.Container(align=0,valign=0) #Quit Button #--------------------------------------- b = StartGameButton(ev_manager=self.ev_manager) c.add(b, 0, 0) self.gui_app.init(c) def render(self, surface): surface.blit(self.background, (0, 0)) #GUI self.gui_app.paint(surface) class GameModeRoom(Room): def __init__(self, screen, ev_manager): Room.__init__(self, screen, ev_manager) self.background = pygame.image.load('assets/images/interface/background.jpg').convert() self.create_gui() #Create pgu gui elements def create_gui(self): #Setup #--------------------------------------- self.gui_form = gui.Form() self.gui_app = gui.App(config.gui_theme) self.ev_manager.gui_app = self.gui_app c = gui.Container(align=0,valign=-1) #Mode Relaxed Button #--------------------------------------- b = GameModeRelaxedButton(ev_manager=self.ev_manager) self.b = b print b.rect c.add(b, 0, 200) #Mode Time Challenge Button #--------------------------------------- b = TimeChallengeButton(ev_manager=self.ev_manager) self.b = b print b.rect c.add(b, 0, 250) #Mode Think Ahead Button #--------------------------------------- # b = PlanAheadButton(ev_manager=self.ev_manager) # self.b = b # print b.rect # c.add(b, 0, 300) #Initialize #--------------------------------------- self.gui_app.init(c) def render(self, surface): surface.blit(self.background, (0, 0)) #GUI self.gui_app.paint(surface) class GameRoom(Room): def __init__(self, screen, ev_manager): Room.__init__(self, screen, ev_manager) #Game mode #--------------------------------------- self.new_board_timer = None self.game_mode = config.game_mode config.current_highs = self.get_highs_table() self.highs_dialog = None self.game_over = False #Images #--------------------------------------- self.background = pygame.image.load('assets/images/interface/game screen2-1.jpg').convert() self.logo = pygame.image.load('assets/images/interface/logo_small.png').convert_alpha() self.game_over_text = pygame.image.load('assets/images/interface/text_game_over.png').convert_alpha() self.trip_complete_text = pygame.image.load('assets/images/interface/text_trip_complete.png').convert_alpha() self.zoom_game_over = None self.zoom_trip_complete = None self.fade_out = None #Text #--------------------------------------- self.font = pygame.font.Font(config.font_sans, config.interface_font_size) #Create game components #--------------------------------------- self.continent = self.set_continent(config.continent) self.board = Board(config.board_size, self.ev_manager) self.deck = Deck(self.ev_manager, self.continent) self.map = Map(self.continent) self.longest_trip = 0 #Set pos of game components #--------------------------------------- board_pos = (SCREEN_MARGIN[0], 109) self.board.set_pos(board_pos) map_pos = (config.screen_size[0] - self.map.size[0] - SCREEN_MARGIN[0], 57); self.map.set_pos(map_pos) #Trackers #--------------------------------------- self.game_clock = Chrono(self.ev_manager) self.swap_counter = 0 self.level = 0 #Create gui #--------------------------------------- self.create_gui() #Create initial board #--------------------------------------- self.new_board = self.deck.deal_new_board(self.board) self.ev_manager.post(NewBoardComplete(self.new_board)) def set_continent(self, continent_const): #Set continent based on const if continent_const == config.EUROPE: return continents.Europe() if continent_const == config.AFRICA: return continents.Africa() else: raise Exception('Continent constant not recognized') #Create pgu gui elements def create_gui(self): #Setup #--------------------------------------- self.gui_form = gui.Form() self.gui_app = gui.App(config.gui_theme) self.ev_manager.gui_app = self.gui_app c = gui.Container(align=-1,valign=-1) #Timer Progress bar #--------------------------------------- self.timer_bar = None self.time_increase = None self.minutes_left = None self.seconds_left = None self.timer_text = None if self.game_mode == config.TIME_CHALLENGE: self.time_increase = config.time_challenge_start_time self.timer_bar = gui.ProgressBar(config.time_challenge_start_time,0,config.max_time_bank,width=306) c.add(self.timer_bar, 172, 57) #Connections Progress bar #--------------------------------------- self.connections_bar = None self.connections_bar = gui.ProgressBar(0,0,config.longest_trip_needed,width=306) c.add(self.connections_bar, 172, 83) #Quit Button #--------------------------------------- b = QuitButton(ev_manager=self.ev_manager) c.add(b, 950, 20) #Generate Board Button #--------------------------------------- b = GenerateBoardButton(ev_manager=self.ev_manager, room=self) c.add(b, 500, 20) #Board Size? #--------------------------------------- bs = SetBoardSizeContainer(config.BOARD_LARGE, ev_manager=self.ev_manager, board=self.board) c.add(bs, 640, 20) #Fill Board? #--------------------------------------- t = FillBoardCheckbox(config.fill_board, ev_manager=self.ev_manager) c.add(t, 740, 20) #Darkness? #--------------------------------------- t = UseDarknessCheckbox(config.use_darkness, ev_manager=self.ev_manager) c.add(t, 840, 20) #Initialize #--------------------------------------- self.gui_app.init(c) def advance_level(self): self.level += 1 print 'Advancing to next level' print 'New level: ' + str(self.level) if self.timer_bar: print 'Time increase: ' + str(self.time_increase) self.timer_bar.value += self.time_increase self.time_increase = max(config.min_advance_time, int(self.time_increase * 0.9)) self.board = self.new_board self.new_board = None self.zoom_trip_complete = None self.game_clock.unpause() def notify(self, event): #Tick event if isinstance(event, TickEvent): pygame.display.set_caption('FPS: ' + str(int(event.fps))) self.render(self.screen) pygame.display.update() #Wait to deal new board when advancing levels if self.zoom_trip_complete and self.zoom_trip_complete.finished: self.zoom_trip_complete = None self.ev_manager.post(UnfreezeCards()) self.new_board = self.deck.deal_new_board(self.board) self.ev_manager.post(NewBoardComplete(self.new_board)) #New high score? if self.zoom_game_over and self.zoom_game_over.finished and not self.highs_dialog: if config.current_highs.check(self.level) != None: self.zoom_game_over.visible = False data = 'time:' + str(self.game_clock.time) + ',swaps:' + str(self.swap_counter) self.highs_dialog = HighScoreDialog(score=self.level, data=data, ev_manager=self.ev_manager) self.highs_dialog.open() elif not self.fade_out: self.fade_out = FadeOut(self.ev_manager, config.TITLE_SCREEN) #Second event elif isinstance(event, SecondEvent): if self.timer_bar: if not self.game_clock.paused: self.timer_bar.value -= 1 if self.timer_bar.value <= 0 and not self.game_over: self.ev_manager.post(GameOver()) self.minutes_left = self.timer_bar.value / 60 self.seconds_left = self.timer_bar.value % 60 if self.seconds_left < 10: leading_zero = '0' else: leading_zero = '' self.timer_text = ''.join(['Time Left: ', str(self.minutes_left), ':', leading_zero, str(self.seconds_left)]) #Game over elif isinstance(event, GameOver): self.game_over = True self.zoom_game_over = ZoomImage(self.ev_manager, self.game_over_text) #Trip complete event elif isinstance(event, TripComplete): print 'You did it!' self.game_clock.pause() self.zoom_trip_complete = ZoomImage(self.ev_manager, self.trip_complete_text) self.new_board_timer = Timer(self.ev_manager, 2) self.ev_manager.post(FreezeCards()) print 'Room posted newboardcomplete' #Board Refresh Complete elif isinstance(event, BoardRefreshComplete): if event.board == self.board: print 'Longest trip needed: ' + str(config.longest_trip_needed) print 'Your longest trip: ' + str(self.board.longest_trip) if self.board.longest_trip >= config.longest_trip_needed: self.ev_manager.post(TripComplete()) elif event.board == self.new_board: self.advance_level() self.connections_bar.value = self.board.longest_trip self.connection_text = ' '.join(['Connections:', str(self.board.longest_trip), '/', str(config.longest_trip_needed)]) #CardSwapComplete elif isinstance(event, CardSwapComplete): self.swap_counter += 1 elif isinstance(event, ConfigChangeBoardSize): config.board_size = event.new_size elif isinstance(event, ConfigChangeCardSize): config.card_size = event.new_size elif isinstance(event, ConfigChangeFillBoard): config.fill_board = event.new_value elif isinstance(event, ConfigChangeDarkness): config.use_darkness = event.new_value def render(self, surface): #Background surface.blit(self.background, (0, 0)) #Map self.map.render(surface) #Board self.board.render(surface) #Logo surface.blit(self.logo, (10,10)) #Text connection_text = self.font.render(self.connection_text, True, BLACK) surface.blit(connection_text, (25, 84)) if self.timer_text: timer_text = self.font.render(self.timer_text, True, BLACK) surface.blit(timer_text, (25, 64)) #GUI self.gui_app.paint(surface) if self.zoom_trip_complete: self.zoom_trip_complete.render(surface) if self.zoom_game_over: self.zoom_game_over.render(surface) if self.fade_out: self.fade_out.render(surface) class HighScoresRoom(Room): def __init__(self, screen, ev_manager): Room.__init__(self, screen, ev_manager) self.background = pygame.image.load('assets/images/interface/background.jpg').convert() #Initialize #--------------------------------------- self.gui_app = gui.App(config.gui_theme) self.ev_manager.gui_app = self.gui_app c = gui.Container(align=0,valign=0) #High Scores Table #--------------------------------------- hst = HighScoresTable() c.add(hst, 0, 0) self.gui_app.init(c) def render(self, surface): surface.blit(self.background, (0, 0)) #GUI self.gui_app.paint(surface) game_components.py #Remote imports import pygame from pygame.locals import * import random import operator from copy import copy from math import sqrt, floor #Local imports import config from events import * from matrix import Matrix from textrect import render_textrect, TextRectException from hyphen import hyphenator from textwrap2 import TextWrapper ############################## #CONSTANTS ############################## SCREEN_MARGIN = (10, 10) #Colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) YELLOW = (255, 200, 0) #Directions LEFT = -1 RIGHT = 1 UP = 2 DOWN = -2 #Cards CARD_MARGIN = (10, 10) CARD_PADDING = (2, 2) #Card types BLANK = 0 COUNTRY = 1 TRANSPORT = 2 #Transport types PLANE = 0 TRAIN = 1 CAR = 2 SHIP = 3 class Timer(object): def __init__(self, ev_manager, time_left): self.ev_manager = ev_manager self.ev_manager.register_listener(self) self.time_left = time_left self.paused = False def __repr__(self): return str(self.time_left) def pause(self): self.paused = True def unpause(self): self.paused = False def notify(self, event): #Pause Event if isinstance(event, Pause): self.pause() #Unpause Event elif isinstance(event, Unpause): self.unpause() #Second Event elif isinstance(event, SecondEvent): if not self.paused: self.time_left -= 1 class Chrono(object): def __init__(self, ev_manager, start_time=0): self.ev_manager = ev_manager self.ev_manager.register_listener(self) self.time = start_time self.paused = False def __repr__(self): return str(self.time_left) def pause(self): self.paused = True def unpause(self): self.paused = False def notify(self, event): #Pause Event if isinstance(event, Pause): self.pause() #Unpause Event elif isinstance(event, Unpause): self.unpause() #Second Event elif isinstance(event, SecondEvent): if not self.paused: self.time += 1 class Map(object): def __init__(self, continent): self.map_image = pygame.image.load(continent.map).convert_alpha() self.map_text = pygame.image.load(continent.map_text).convert_alpha() self.pos = (0, 0) self.set_color() self.map_image = pygame.transform.smoothscale(self.map_image, config.map_size) self.size = self.map_image.get_size() def set_pos(self, pos): self.pos = pos def set_color(self): image_pixel_array = pygame.PixelArray(self.map_image) image_pixel_array.replace(config.GRAY1, config.COLOR1) image_pixel_array.replace(config.GRAY2, config.COLOR2) image_pixel_array.replace(config.GRAY3, config.COLOR3) image_pixel_array.replace(config.GRAY4, config.COLOR4) image_pixel_array.replace(config.GRAY5, config.COLOR5)

    Read the article

  • compass-rails 1.03 - TypeError: can't convert nil into String

    - by Romiko
    I am running: ruby 1.9.3p392 (2013-02-22) [i386-mingw32] compass-rails 1.0.3 I used the Windows RailsInstaller to install Ruby on Rails Gemfile group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' gem 'compass-rails','~> 1.0.2' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', :platforms => :ruby gem 'uglifier', '>= 1.0.3' end I am currently experiencing issues importing sprites. My sprites are in: assets/images/source in my _shared.scss file I have: //Sprites @import "./source/*.png"; $source-sprite-dimensions: true; In my application.scss I have: /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it's generally better to create a new file per style scope. * *= require_self */ @import "_shared.scss"; @import "baseline.scss"; @import "global.scss"; @import "normalize.scss"; @import "print.scss"; @import "desktop.scss"; @import "tablet.scss"; @import "home.css.scss"; I am also using rails server and not compass watcher. However when I browse to the page at localhost:3000/assets/application.css, I get the following error: body:before { font-weight: bold; content: "\000a TypeError: can't convert nil into String\000a (in c:\002f RangerRomOnRails\002f RangerRom\002f app\002f assets\002f stylesheets\002f desktop.scss)"; } body:after { content: "\000a C:\002f RailsInstaller\002f Ruby1.9.3\002f lib\002f ruby\002f gems\002f 1.9.1\002f gems\002f compass-0.12.2\002f lib\002f compass\002f sass_extensions\002f functions\002f image_size.rb:17:in `extname'"; } Here is the full stack trace: compass (0 .12.2) lib/compass/sass_extensions/functions/image_size.rb:17:in `extname' compass (0.12.2) lib/compass/sass_extensions/functions/image_size.rb:17:in `initialize' compass (0.12.2) lib/compass/sass_extensions/functions/image_size.rb:50:in `new' compass (0.12.2) lib/compass/sass_extensions/functions/image_size.rb:50:in `image_dimensions' compass (0.12.2) lib/compass/sass_extensions/functions/image_size.rb:4:in `image_width' sass (3.2.9) lib/sass/script/funcall.rb:112:in `_perform' sass (3.2.9) lib/sass/script/node.rb:40:in `perform' sass (3.2.9) lib/sass/tree/visitors/perform.rb:298:in `visit_prop' sass (3.2.9) lib/sass/tree/visitors/base.rb:37:in `visit' sass (3.2.9) lib/sass/tree/visitors/perform.rb:100:in `visit' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `block in visit_children' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `map' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `visit_children' sass (3.2.9) lib/sass/tree/visitors/perform.rb:109:in `block in visit_children' sass (3.2.9) lib/sass/tree/visitors/perform.rb:121:in `with_environment' sass (3.2.9) lib/sass/tree/visitors/perform.rb:108:in `visit_children' sass (3.2.9) lib/sass/tree/visitors/base.rb:37:in `block in visit' sass (3.2.9) lib/sass/tree/visitors/perform.rb:320:in `visit_rule' sass (3.2.9) lib/sass/tree/visitors/base.rb:37:in `visit' sass (3.2.9) lib/sass/tree/visitors/perform.rb:100:in `visit' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `block in visit_children' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `map' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `visit_children' sass (3.2.9) lib/sass/tree/visitors/perform.rb:109:in `block in visit_children' sass (3.2.9) lib/sass/tree/visitors/perform.rb:121:in `with_environment' sass (3.2.9) lib/sass/tree/visitors/perform.rb:108:in `visit_children' sass (3.2.9) lib/sass/tree/visitors/base.rb:37:in `block in visit' sass (3.2.9) lib/sass/tree/visitors/perform.rb:320:in `visit_rule' sass (3.2.9) lib/sass/tree/visitors/base.rb:37:in `visit' sass (3.2.9) lib/sass/tree/visitors/perform.rb:100:in `visit' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `block in visit_children' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `map' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `visit_children' sass (3.2.9) lib/sass/tree/visitors/perform.rb:109:in `block in visit_children' sass (3.2.9) lib/sass/tree/visitors/perform.rb:121:in `with_environment' sass (3.2.9) lib/sass/tree/visitors/perform.rb:108:in `visit_children' sass (3.2.9) lib/sass/tree/visitors/base.rb:37:in `block in visit' sass (3.2.9) lib/sass/tree/visitors/perform.rb:362:in `visit_media' sass (3.2.9) lib/sass/tree/visitors/base.rb:37:in `visit' sass (3.2.9) lib/sass/tree/visitors/perform.rb:100:in `visit' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `block in visit_children' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `map' sass (3.2.9) lib/sass/tree/visitors/base.rb:53:in `visit_children' sass (3.2.9) lib/sass/tree/visitors/perform.rb:109:in `block in visit_children' sass (3.2.9) lib/sass/tree/visitors/perform.rb:121:in `with_environment' sass (3.2.9) lib/sass/tree/visitors/perform.rb:108:in `visit_children' sass (3.2.9) lib/sass/tree/visitors/base.rb:37:in `block in visit' sass (3.2.9) lib/sass/tree/visitors/perform.rb:128:in `visit_root' sass (3.2.9) lib/sass/tree/visitors/base.rb:37:in `visit' sass (3.2.9) lib/sass/tree/visitors/perform.rb:100:in `visit' sass (3.2.9) lib/sass/tree/visitors/perform.rb:7:in `visit' sass (3.2.9) lib/sass/tree/root_node.rb:20:in `render' sass (3.2.9) lib/sass/engine.rb:315:in `_render' sass (3.2.9) lib/sass/engine.rb:262:in `render' sass-rails (3.2.6) lib/sass/rails/template_handlers.rb:106:in `evaluate' tilt (1.4.1) lib/tilt/template.rb:103:in `render' sprockets (2.2.2) lib/sprockets/context.rb:193:in `block in evaluate' sprockets (2.2.2) lib/sprockets/context.rb:190:in `each' sprockets (2.2.2) lib/sprockets/context.rb:190:in `evaluate' sprockets (2.2.2) lib/sprockets/processed_asset.rb:12:in `initialize' sprockets (2.2.2) lib/sprockets/base.rb:249:in `new' sprockets (2.2.2) lib/sprockets/base.rb:249:in `block in build_asset' sprockets (2.2.2) lib/sprockets/base.rb:270:in `circular_call_protection' sprockets (2.2.2) lib/sprockets/base.rb:248:in `build_asset' sprockets (2.2.2) lib/sprockets/index.rb:93:in `block in build_asset' sprockets (2.2.2) lib/sprockets/caching.rb:19:in `cache_asset' sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset' sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset' sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset' sprockets (2.2.2) lib/sprockets/processed_asset.rb:111:in `block in resolve_dependencies' sprockets (2.2.2) lib/sprockets/processed_asset.rb:105:in `each' sprockets (2.2.2) lib/sprockets/processed_asset.rb:105:in `resolve_dependencies' sprockets (2.2.2) lib/sprockets/processed_asset.rb:97:in `build_required_assets' sprockets (2.2.2) lib/sprockets/processed_asset.rb:16:in `initialize' sprockets (2.2.2) lib/sprockets/base.rb:249:in `new' sprockets (2.2.2) lib/sprockets/base.rb:249:in `block in build_asset' sprockets (2.2.2) lib/sprockets/base.rb:270:in `circular_call_protection' sprockets (2.2.2) lib/sprockets/base.rb:248:in `build_asset' sprockets (2.2.2) lib/sprockets/index.rb:93:in `block in build_asset' sprockets (2.2.2) lib/sprockets/caching.rb:19:in `cache_asset' sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset' sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset' sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset' sprockets (2.2.2) lib/sprockets/bundled_asset.rb:38:in `init_with' sprockets (2.2.2) lib/sprockets/asset.rb:24:in `from_hash' sprockets (2.2.2) lib/sprockets/caching.rb:15:in `cache_asset' sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset' sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset' sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset' sprockets (2.2.2) lib/sprockets/environment.rb:78:in `find_asset' sprockets (2.2.2) lib/sprockets/base.rb:177:in `[]' actionpack (3.2.13) lib/sprockets/helpers/rails_helper.rb:126:in `asset_for' actionpack (3.2.13) lib/sprockets/helpers/rails_helper.rb:44:in `block in stylesheet_link_tag' actionpack (3.2.13) lib/sprockets/helpers/rails_helper.rb:43:in `collect' actionpack (3.2.13) lib/sprockets/helpers/rails_helper.rb:43:in `stylesheet_link_tag' app/views/layouts/application.html.erb:16:in `_app_views_layouts_application_html_erb___824639613_33845076' actionpack (3.2.13) lib/action_view/template.rb:145:in `block in render' activesupport (3.2.13) lib/active_support/notifications.rb:125:in `instrument' actionpack (3.2.13) lib/action_view/template.rb:143:in `render' actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:59:in `render_with_layout' actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:45:in `render_template' actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:18:in `render' actionpack (3.2.13) lib/action_view/renderer/renderer.rb:36:in `render_template' actionpack (3.2.13) lib/action_view/renderer/renderer.rb:17:in `render' actionpack (3.2.13) lib/abstract_controller/rendering.rb:110:in `_render_template' actionpack (3.2.13) lib/action_controller/metal/streaming.rb:225:in `_render_template' actionpack (3.2.13) lib/abstract_controller/rendering.rb:103:in `render_to_body' actionpack (3.2.13) lib/action_controller/metal/renderers.rb:28:in `render_to_body' actionpack (3.2.13) lib/action_controller/metal/compatibility.rb:50:in `render_to_body' actionpack (3.2.13) lib/abstract_controller/rendering.rb:88:in `render' actionpack (3.2.13) lib/action_controller/metal/rendering.rb:16:in `render' actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render' activesupport (3.2.13) lib/active_support/core_ext/benchmark.rb:5:in `block in ms' C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' activesupport (3.2.13) lib/active_support/core_ext/benchmark.rb:5:in `ms' actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:40:in `block in render' actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime' activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime' actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:39:in `render' actionpack (3.2.13) lib/action_controller/metal/implicit_render.rb:10:in `default_render' actionpack (3.2.13) lib/action_controller/metal/implicit_render.rb:5:in `send_action' actionpack (3.2.13) lib/abstract_controller/base.rb:167:in `process_action' actionpack (3.2.13) lib/action_controller/metal/rendering.rb:10:in `process_action' actionpack (3.2.13) lib/abstract_controller/callbacks.rb:18:in `block in process_action' activesupport (3.2.13) lib/active_support/callbacks.rb:414:in `_run__956028316__process_action__416811168__callbacks' activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback' activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks' activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks' actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in `process_action' actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in `process_action' actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action' activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument' activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument' activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument' actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in `process_action' actionpack (3.2.13) lib/action_controller/metal/params_wrapper.rb:207:in `process_action' activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action' actionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process' actionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process' actionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch' actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch' actionpack (3.2.13) lib/action_controller/metal.rb:246:in `block in action' actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `call' actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `dispatch' actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:36:in `call' journey (1.0.4) lib/journey/router.rb:68:in `block in call' journey (1.0.4) lib/journey/router.rb:56:in `each' journey (1.0.4) lib/journey/router.rb:56:in `call' actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call' rack (1.4.5) lib/rack/etag.rb:23:in `call' rack (1.4.5) lib/rack/conditionalget.rb:25:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242:in `call' rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context' rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call' activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call' activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call' activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__360878605__call__248365880__callbacks' activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback' activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks' activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks' actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app' railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call' activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged' railties (3.2.13) lib/rails/rack/logger.rb:16:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call' rack (1.4.5) lib/rack/methodoverride.rb:21:in `call' rack (1.4.5) lib/rack/runtime.rb:17:in `call' activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call' rack (1.4.5) lib/rack/lock.rb:15:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call' railties (3.2.13) lib/rails/engine.rb:479:in `call' railties (3.2.13) lib/rails/application.rb:223:in `call' rack (1.4.5) lib/rack/content_length.rb:14:in `call' railties (3.2.13) lib/rails/rack/log_tailer.rb:17:in `call' rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service' C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

    Read the article

  • nginx- Rewrite URL with Trailing Slash

    - by Bryan
    I have a specialized set of rewrite rules to accommodate a mutli site cms setup. I am trying to have nginx force a trailing slash on the request URL. I would like it to redirect requests for domain.com/some-random-article to domain.com/some-random-article/ I know there are semantic considerations with this, but I would like to do it for SEO purposes. Here is my current server config. server { listen 80; server_name domain.com mirror.domain.com; root /rails_apps/master/public; passenger_enabled on; # Redirect from www to non-www if ($host = 'domain.com' ) { rewrite ^/(.*)$ http://www.domain.com/$1 permanent; } location /assets/ { expires 1y; rewrite ^/assets/(.*)$ /assets/$http_host/$1 break; } # / -> index.html if (-f $document_root/cache/$host$uri/index.html) { rewrite (.*) /cache/$host$1/index.html break; } # /about -> /about.html if (-f $document_root/cache/$host$uri.html) { rewrite (.*) /cache/$host$1.html break; } # other files if (-f $document_root/cache/$host$uri) { rewrite (.*) /cache/$host$1 break; } } How would I modify this to add the trailing slash? I would assume there has to be a check for the slash so that you don't end up with domain.com/some-random-article//

    Read the article

  • How Do I Stop NFS Clients from Using All of the NFS Server's Resources?

    - by Ken S.
    I have a v4 NFS server running on Ubuntu 12.04LTS. It is the main repository for the web assets that four external nginx webservers mount to serve up to site visitors. These client servers connect to it via a read-only mount. Each of these RO servers has this displayed when I check the mounts: 10.0.0.90:/assets on /var/www/assets type nfs4 (ro,addr=10.0.0.90,clientaddr=0.0.0.0) The NFS master's /etc/exports file contains entries like this for each server: /mnt/lvm-ext4 10.0.0.40(ro,fsid=0,insecure,no_subtree_check,async) The problem that I'm seeing is that these clients are eventually utilizing all the RAM on the NFS server and causing it to crash. If I do a watch free -m I can watch the used memory creep up until it's used and then see the free buffers/cache entry creep down to near zero before the server eventually locks up requiring a reboot. There is some sort of memory leak somewhere that is causing this, and the optimal solution would be to find it and fix it, but in the meantime I need to find a way to have the NFS server protect itself from connected clients using all it's RAM. There must be some sort of setting that limits the resources the clients can use, but I can't seem to find it. I've tried adjusting the values for rsize and wsize but they don't seem to help or be related. Thanks for any tips.

    Read the article

  • nginx- Rewrite URL with Trailing Slash

    - by Bryan
    I have a specialized set of rewrite rules to accommodate a mutli site cms setup. I am trying to have nginx force a trailing slash on the request URL. I would like it to redirect requests for domain.com/some-random-article to domain.com/some-random-article/ I know there are semantic considerations with this, but I would like to do it for SEO purposes. Here is my current server config. server { listen 80; server_name domain.com mirror.domain.com; root /rails_apps/master/public; passenger_enabled on; # Redirect from www to non-www if ($host = 'domain.com' ) { rewrite ^/(.*)$ http://www.domain.com/$1 permanent; } location /assets/ { expires 1y; rewrite ^/assets/(.*)$ /assets/$http_host/$1 break; } # / -> index.html if (-f $document_root/cache/$host$uri/index.html) { rewrite (.*) /cache/$host$1/index.html break; } # /about -> /about.html if (-f $document_root/cache/$host$uri.html) { rewrite (.*) /cache/$host$1.html break; } # other files if (-f $document_root/cache/$host$uri) { rewrite (.*) /cache/$host$1 break; } } How would I modify this to add the trailing slash? I would assume there has to be a check for the slash so that you don't end up with domain.com/some-random-article//

    Read the article

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