Search Results

Search found 205 results on 9 pages for 'pieter breed'.

Page 2/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • Hot new GlassFish 3.1 bits released today

    - by pieter.humphrey
    Java EE 6 developers will wake up this morning and be able to experience a new, major release of the Oracle GlassFish Server and the companion GlassFish Server 3.1, Open Source Edition.  This release extends Java EE 6 Reference Implementation New Application Development Capabilities, Centralized Administration and High Availability Features.  IDE tool support will include NetBeans and Eclipse  (update center link is here), as well as the next release of Oracle Enterprise Pack for Eclipse will be updated to include the new GlassFish 3.1 Server Plug-in. Developers will be interested in the vastly improved OSGi support in GlassFish 3.1, as well as other developer friendly-features: - Enables hybrid application development Easily utilize OSGi services from Java EE Applications Easily utilize Java EE services from OSGi services - Updates the Apache Felix runtime to 3.0.6, including the Apache Gogo shell - OSGi Web Console integrated with GlassFish Admin Console (requires Update Center download, community supported) - Extends GlassFish Server 3.0 ActiveRedeploy feature to include Stateful EJBs. When applications are re-deployed, GlassFish maintains HTTP session and EJB state, enabling rapid iterative development - Application-scoped resources enable developers to limit the scope of resources to a deployed application - JDBC statement leak detection and reclaim automatically monitors, logs, and reclaims database cursors when applications fail to do so - Full EJB feature support in Embedded API Technorati Tags: OTN,Java EE6,Glassfish,Eclipse,Developer,OSGi,NetBeans,Oracle Enterprise Pack for Eclipse,clustering,high availablity,load balancing,failover,Oracle WebLogic Server del.icio.us Tags: OTN,Java EE6,Glassfish,Eclipse,Developer,OSGi,NetBeans,Oracle Enterprise Pack for Eclipse,clustering,high availablity,load balancing,failover,Oracle WebLogic Server

    Read the article

  • Ubuntu 12.04 VPN default route issue when using the UI

    - by Pieter Pabst
    When setting up a VPN connection using the UI (System settings = Network) the VPN connection is used as the default route after connecting to it. How can I avoid this? That is without assigning manual addresses. I want the connection to use DHCP. It should use the eth* interfaces for my default route, like they are used before making the connection. The VPN route should only be used when connecting to addresses in the ppp0 adapters range. If possible using the UI only, not that I'm not used to editing config files... But the point of using Ubuntu for me was the "it just works" concept (which is true for 99% of the time, keep up the good work). I tried setting the "Method" combobox in the "Configure..." dialogue to "Automatic (VPN) addresses only". That doesn't make a difference. (Another thing I noticed; the UI shows my connection as a "Wireless connection" in the list control on the left. Don't know why... it has the right icon, but that's probably something for the bug tracker)

    Read the article

  • Install Ubuntu on Laptop dual with windows 7

    - by Pieter Doubell
    I have installed Ubuntu 12.04/ 32-bit using Wubi on my laptop running dual with windows 7 desktop and it works very very well. I am now also trying to install Ubuntu on another laptop already running a linux operating system only but not successful in doing so. Would like to install Windows 7 dual with Ubuntu. At the moment it is complaining about partitions of the existing linux when trying to install Windows 7 which I suppose is fair. Please herewith assist in installing the Ubuntu and Windows 7 platforms. Very much appreciated.

    Read the article

  • How do I trust an off site application

    - by Pieter
    I need to implement something similar to a license server. This will have to be installed off site at the customers' location and needs to communicate with other applications at the customers' site (the applications that use the licenses) and an application running in our hosting center (for reporting and getting license information). My question is how to set this up in a way I can trust that: The license server is really our application and not something that just simulates it; and There is no "man in the middle" (i.e. a proxy or something that alters the traffic). The first thing I thought of was to use with client certificates and that would solve at least 2. However, what I'm worried about is that someone just decompiles (this is build in .NET) the license server, alters some logic and recompiles it. This would be hard to detect from both connecting applications. This doesn't have to be absolutely secure since we have a limited number of customers whom we have a trust relationship with. However, I do want to make it more difficult than a simple decompile/recompile of the license server. I primarily want to protect against an employee or nephew of the boss trying to be smart.

    Read the article

  • this.BoundingBox.Intersects(Wall[0].BoundingBox) not working properly

    - by Pieter
    I seem to be having this problem a lot, I'm still learning XNA / C# and well, trying to make a classic paddle and ball game. The problem I run into (and after debugging have no answer) is that everytime I run my game and press either of the movement keys, the Paddle won't move. Debugging shows that it never gets to the movement part, but I can't understand why not? Here's my code: // This is the If statement for checking Left movement. if (keyboardState.IsKeyDown(Keys.Left) || keyboardState.IsKeyDown(Keys.A)) { if (!CheckCollision(walls[0])) { Location.X -= Velocity; } } //This is the CheckCollision(Wall wall) boolean public bool CheckCollision(Wall wall) { if (this.BoundingBox.Intersects(wall.BoundingBox)) { return true; } return false; } As far as I can tell there should be absolutely no problem with this, I initialize the bounding box in the constructor whenever a new instance of Walls and Paddle is created. this.BoundingBox = new Rectangle(0, 0, Sprite.Width, Sprite.Height); Any idea as to why this isn't working? I have previously succeeded with using the whole Location.X < Wall.Location.X + Wall.Texture.Width code... But to me that seems like too much coding if a simple boolean check could be done.

    Read the article

  • How should I deploy my JVM-based web application on ubuntu?

    - by Pieter Breed
    I've developed a web application using clojure/compojure (JVM based) and while developing I tested it using embedded jetty that runs on 0.0.0.0:8080. I would now like to deploy it to run on port 80 on ubuntu. I do dynamic virtual hosting, so any request for any host that arrives on port 80 should be handled by my application. The issues that worries me are: I can still run it embedded but I'm worried about running my app as root (needed for binding to port 80). I'm not sure if I can 'give up root' when in the JVM. Do I need to be concerned by this? besides, serving web applications is a known problem and I should be using known solutions for this (jetty or tomcat) but especially tomcat seems very heavy weight. Besides, I only have one application that listens to /* and does routing internally. (with compojure/ring). What I'm trying to say with this is that tomcat by default assigns WARs to subfolders which I don't want. So basically what I need is some very safe way of binding to port 80 on ubuntu that can with minimal interference send all requests to my app. Any ideas?

    Read the article

  • having trouble setting up ganglia on three machines

    - by Pieter Breed
    I am running ubuntu 11.10 I have one machine with gmetad, gmond and ganglia-webinterface. When I browse the web interface this machine picks up the local gmond output. I then added another machine, running only gmond. I didn't really change anything in the config, only the name of the cluster. This machine's output showed up in the web view. The I tried to add a third machine, similarly to the second, but it's not showing up in the web view. I tried looking at syslog and running as a daemon, but I'm not seeing anything suspicious there. Any tips for trouble shooting this?

    Read the article

  • How can I organize my video collection and update meta data?

    - by Pieter Breed
    I have a large collection of downloaded video files containing different movies, tv shows and music videos. I have a FreeNAS box set up that uses Fuppes as a UPnP media server. My media player on Windows correctly detects this UPnP collection and can stream from it fine. However, All of my music videos, tv shows and movies are all sorted under the same 'Videos' group. I would like to seperate the different types of video files so that they can correctly go under 'Recorded TV' or whatever the case may be. Any ideas? I guess I am looking for something like an MP3Tagger but for video files?

    Read the article

  • netlogo programming question - catalyst implementation part 2

    - by user286190
    hi the catalyst speeds up the reaction but remains unchanged after the reaction has taken place i tried the following code breed [catalysts catalyst] breed [chemical-x chemical-x] ;then the forward reaction is sped up by the existence of catalysts to react-forward let num-catalysts count catalysts ;speed up by num-catalysts ;... end and it works fine but I want to make it so that the catalyst can be switched on and off with the 'switch' button ..so one can see the effects with and without the catalyst..i tried putting a switch in but catalyst has already been defined Also i want to make the catalyst visible so one can see it in the actual implementation (in the world) like making it a turtle is there are another way to implement this apart from using breeds i tried making the catalyst a turtle but it doesnt work ; Make catalyst visible in implementation clear-all crt catalysts 100 ask catalysts [ set color white ] show [breed] of one-of catalysts ; prints catalysts any help will be greatly appreciated thank you

    Read the article

  • C# Web gridview sortin

    - by tommypiaa
    Any examples how would I enable sorting for the gridview? private void loadlist() { cn.Open(); cmd.CommandText = "select Breed, Name, Image from Animals"; dr = cmd.ExecuteReader(); cn.Close(); } protected void TextBox1_TextChanged(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { AddData(); Addimage(); } protected void AddData() { if (TextBox1.Text != "" & TextBox2.Text != "") { cn.Open(); cmd.CommandText = "insert into Animals (Breed, Name) values ('" + TextBox1.Text + "', '" + TextBox2.Text + "')"; cmd.ExecuteNonQuery(); cmd.Clone(); cn.Close(); loadlist(); } } protected void DisplayData() { cn.Open(); cmd.CommandText = "select Breed, Name from Animals"; dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind(); cn.Close(); }

    Read the article

  • WebLogic Weekly for June 27th, 2011

    - by james.bayer
    Blogs WebLogic Server JMS WLST Script – Who is Connected To My Server by James Bayer Fast, Faster, JRockit by Rene Tweets Chad Thompson provides a great reminder about the WLS Zip distribution which is down to 318Mb.  On a related note, there is also a very handy YouTube video showing how to get started with the Zip Distribution by Jeff West. Events Pieter Humphrey gave a keynote a Jax 2011 last week in San Jose covering Java EE 6 and WebLogic Server. InfoWorld’s JavaWorld posted an article which covers many of the Java sessions at Oracle Open World 2011 including this one: On the Road to Java EE 6 with Oracle WebLogic and Eclipse (15276).  Oracle's Erik Bergenholtz and Pieter Humphrey will present "On the Road to Java EE 6 with Oracle WebLogic and Eclipse." Their abstract is shown here: The developer Web profile is a key improvement in Java EE 6 servers, and Eclipse developers will want to work with it. This session demonstrates some aspects of the progress of Oracle WebLogic server on its road to Java EE 6 compliance and gives Eclipse developers a sneak peek at using Java Persistence API Release 2.0 and JavaServer Faces Release 2.0 with Oracle WebLogic Server.

    Read the article

  • links for 2010-05-19

    - by Bob Rhubart
    Presentations from #otnarchday in Dallas now available on Slideshare Includes presentations on IT Optimization, Application Integration Architecture, Application Grid, and Infrastructure Consolidation. More to come. Anthony Shorten: JMX Based Monitoring - Part Four - Business App Server Monitoring Anthony Shorten discuss a new Oracle Utilities Application Framework V4 feature that allows JMX to be used for management and monitoring the Oracle Utilities business application server component. (tags: oracle otn java architect) New book: Oracle Coherence 3.5 An overview of the new book by authors Aleksandar Seovic, Mark Falco, Patrick Peralta. (tags: oracle otn grid architect) Douwe Pieter van den Bos: Next step in Virtualization: VirtualBox 3.2 "For businesses, VirtualBox just might be the answer they where looking for," says Douwe Pieter van den Bos. "A simple and widely supported virtual machine." (tags: oracle otn virtualization architect) Maurice Gamanho: Python and Ruby in Tuxedo Maurice Gamanho's quick overview of new features in Oracle's Service Architecture Leveraging Tuxedo (SALT) 11gR1. (tags: oracle otn soa architect) Live Webcast: Oracle and AmberPoint - May 20, 2010 - 10 a.m. PT/1 p.m. ET Ed Horst and Ashish Mohindroo discuss the advantages of the Oracle and AmberPoint combination. (tags: oracle otn architect soa governance)

    Read the article

  • Újabb házassági terv az adatbázis piacon: Sybase és SAP

    - by Fekete Zoltán
    Az Oracle az utóbbi évben technológiai és alkalmazás oldalon több mint 50 céget vásárolt meg, legutóbb a hardver-operációs rendszer, Java, IDM, virtualizáció és számos más téren is innovatív Sun céget. Ráadásul az Oracle best-of-breed azaz iparági vezeto cégekkel és mogoldásokkal erosíti a portfólióját. Az Oracle hosszú évek óta az adattárházak (data wrehouse) területén is a Gartner szerint a piacvezetok mágikus négyzetében van. Ennek a területnek vezeto megoldása az Oracle Database optimalizált hardveren futtatása az Exadata / Database Machine területen. Az Oracle Database mind tranzakciókezelésre mind adattárház feldolgozásra, mind ezen megoldások egy környezetben futtatására optimalizált megoldás. Az SAP korábban meglehetosen elítélte az Oracle best-of-breed felvásárlási stratégiáját, mondván az nem vezet semmire. :) Most a megmaradék önálló cégek közül a Sybase-t szemelte ki. A BBC híre. Kicsit soknak tunik az 5,8 milliárd dollár? Érdekes, hogy a cikk szerint a felvásárlási terv hírére az SAP részvény árfolyam 40 centtel esett.

    Read the article

  • Android SDK fails to install

    - by Paul Breed
    When I try to install the android SDK it fails to install. My OS is Windows XP I just downloaded and installed Java JDK 1.6 Java -version from the command line returns: http://stackoverflow.com/questions/ask java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04) Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing) My environment vars have: JAVA_HOME=c:\progra~1\java\jdk1.6.0_11 I downloaded android-sdk-r04-windows.zip I unziped it in V:\AndroidInstall\ When I go to the V:\androindinstall\android-sdk-windows and type "SDK Install.exe" nothing happens... If I go this from graph When I do this from a graphical file viewer I get a quick flash that looks like a command line window and nothing.... When I try to run android list targets from the tool directory I get: Error: Error parsing the sdk. Error: V:\androindinstall\android-sdk-windows\platforms is missing. Error: Unable to parse SDK content. So the basic install setup is not happening. Additional clues: I have a G1 and Android 1.0 was running on this machine. (Almost a year ago) I've updated my G1 to 1.6 so I thought I'd update my SDK before starting new development. When I tried to upgrade it tried and then died as the "directory was in use" So I cleaned out all the android directories, rebooted and redownloaded everythign from scratch. Now it won't run at all. I've clearly got something in an unhappy state, but I've cleaned up all the directories and no remanants seem to be running I've rebooted.... I've missed somethign I just can't figure out what. Paul

    Read the article

  • How to get maven gwt 2.0 build working

    - by Pieter Breed
    EDIT: Added some of the output of the mvn -X -e commands at the end My company is developing a GWT application. We've been using maven 2 and GWT 1.7 successfully for quite a while. We recently decided to upgrade to GWT 2.0. We've already updated the eclipse project and we are able to successfully run the application in dev-mode. We are struggling to get the application built using maven though. I'm hoping somebody can tell me what I'm doing wrong here since I'm running out of time on this. The exacty bit of the output that worries me is the 'GWT compilation skipped' message: [INFO] Copying 119 resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 704 source files to K:\iCura\assessor\target\classes [INFO] [gwt:compile {execution: default}] [INFO] using GWT jars for specified version 2.0.0 [INFO] establishing classpath list (scope = compile) [INFO] com.curasoftware.assessor.Assessor is up to date. GWT compilation skipped [INFO] [jspc:compile {execution: jspc}] [INFO] Built File: \index.jsp I'm pasting the gwt-maven-plugin section below. If you need anything else please ask. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>1.2</version> <configuration> <localWorkers>1</localWorkers> <warSourceDirectory>${basedir}/war</warSourceDirectory> <logLevel>ALL</logLevel> <module>${cura.assessor.module}</module> <!-- use style OBF for prod --> <style>OBFUSCATED</style> <extraJvmArgs>-Xmx2048m -Xss1024k</extraJvmArgs> <gwtVersion>${version.gwt}</gwtVersion> <disableCastChecking>true</disableCastChecking> <soyc>false</soyc> </configuration> <executions> <execution> <goals> <!-- plugin goals --> <goal>clean</goal> <goal>compile</goal> </goals> </execution> </executions> </plugin> I executed mvn clean install -X -e and this is some of the output that I get: [DEBUG] Configuring mojo 'org.codehaus.mojo:gwt-maven-plugin:1.2:compile' --> [DEBUG] (f) disableCastChecking = true [DEBUG] (f) disableClassMetadata = false [DEBUG] (f) draftCompile = false [DEBUG] (f) enableAssertions = false [DEBUG] (f) extra = K:\iCura\assessor\target\extra [DEBUG] (f) extraJvmArgs = -Xmx2048m -Xss1024k [DEBUG] (f) force = false [DEBUG] (f) gen = K:\iCura\assessor\target\.generated [DEBUG] (f) generateDirectory = K:\iCura\assessor\target\generated-sources\gwt [DEBUG] (f) gwtVersion = 2.0.0 [DEBUG] (f) inplace = false [DEBUG] (f) localRepository = Repository[local|file://K:/iCura/lib] [DEBUG] (f) localWorkers = 1 [DEBUG] (f) logLevel = ALL [DEBUG] (f) module = com.curasoftware.assessor.Assessor [DEBUG] (f) project = MavenProject: com.curasoftware.assessor:assessor:3.5.0.0 @ K:\iCura\assessor\pom.xml [DEBUG] (f) remoteRepositories = [Repository[gwt-maven|http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/], Repository[main-maven|http://www.ibiblio.org/maven2/], Repository[central|http://repo1.maven.org/maven2]] [DEBUG] (f) skip = false [DEBUG] (f) sourceDirectory = K:\iCura\assessor\src [DEBUG] (f) soyc = false [DEBUG] (f) style = OBFUSCATED [DEBUG] (f) treeLogger = false [DEBUG] (f) validateOnly = false [DEBUG] (f) warSourceDirectory = K:\iCura\assessor\war [DEBUG] (f) webappDirectory = K:\iCura\assessor\target\assessor [DEBUG] -- end configuration -- and then this: [DEBUG] SOYC has been disabled by user [DEBUG] GWT module com.curasoftware.assessor.Assessor found in K:\iCura\assessor\src [INFO] com.curasoftware.assessor.Assessor is up to date. GWT compilation skipped [DEBUG] com.curasoftware.assessor:assessor:war:3.5.0.0 (selected for null) [DEBUG] com.curasoftware.dto:dto-gen:jar:3.5.0.0:compile (selected for compile) ... It's finding the correct sourceDirectory. That folders has a 'com' folder within which ultimately is the source of the application organized in folders as per the package structure.

    Read the article

  • GXT LayoutContainer with scrollbar reports a client height value which includes the area below the s

    - by Pieter Breed
    I have this code which sets up a "main" container into which other modules of the application will go. LayoutContainer c = new LayoutContainer(); c.setScrollMode(Scroll.ALWAYS); parentContainer.add(c, <...>); Then later on, I have the following as an event handler pContainer = c; // pContainer is actually a parameter, but it has c's value pContainer.removeAll(); pContainer.setLayout(new FitLayout()); LayoutContainer wrapperContainer = new LayoutContainer(); wrapperContainer.setLayout(new BorderLayout()); wrapperContainer.setBorders(false); pContainer.add(wrapperContainer); LayoutContainer west = pWestContentContainer; BorderLayoutData westLayoutData = new BorderLayoutData(LayoutRegion.WEST); westLayoutData.setSize(pWidth); westLayoutData.setSplit(true); wrapperContainer.add(west, westLayoutData); LayoutContainer center = new LayoutContainer(); wrapperContainer.add(center, new BorderLayoutData(LayoutRegion.CENTER)); pCallback.withSplitContainer(center); pContainer.layout(); So in effect, the container called 'west' here will be where the module's UI gets displayed. That module UI then does a simple rowlayout with two children. The botton child has RowData(1, 1) so it fills up all the available space. My problem is that the c (parent) container reports a height and width value which includes the value underneath the scrollbars. What I would like is that the scrollbars show all the space excluding their own space. This is a screenshot showing what I mean:

    Read the article

  • Is it possible to remember the filename from a fileupload field and then later launch that file via

    - by Pieter Breed
    I have a HTML file upload field from which I'm reading the file name of the file that the user specifies. The actual contents of the file is never uploaded. At a later stage, is it possible to construct a link using this file name information so that if the user clicks on this link, the original file is launched into a new browser window? If not, what are the reason for disallowing this behaviour? The purpose of such a feature is to store links to documents that are available on a mapped local drive or a network share.

    Read the article

  • HTML/Javascript: Is it possible to remember the filename from a fileupload field ONLY and then later

    - by Pieter Breed
    I have a HTML file upload field from which I'm reading the file name of the file that the user specifies. The actual contents of the file is never uploaded. At a later stage, is it possible to construct a link using this file name information so that if the user clicks on this link, the original file is launched into a new browser window? If not, what are the reason for disallowing this behaviour? The purpose of such a feature is to store links to documents that are available on a mapped local drive or a network share.

    Read the article

  • Problems Allocating Objects of Derived Class Where Base Class has Abstract Virtual Functions

    - by user1743901
    I am trying to get this Zombie/Human agent based simulation running, but I am having problems with these derived classes (Human and Zombie) who have parent class "Creature". I have 3 virtual functions declared in "Creature" and all three of these are re-declared AND DEFINED in both "Human" and "Zombie". But for some reason when I have my program call "new" to allocate memory for objects of type Human or Zombie, it complains about the virtual functions being abstract. Here's the code: definitions.h #ifndef definitions_h #define definitions_h class Creature; class Item; class Coords; class Grid { public: Creature*** cboard; Item*** iboard; int WIDTH; int HEIGHT; Grid(int WIDTHVALUE, int HEIGHTVALUE); void FillGrid(); //initializes grid object with humans and zombies void Refresh(); //calls Creature::Die(),Move(),Attack(),Breed() on every square void UpdateBuffer(char** buffer); bool isEmpty(int startx, int starty, int dir); char CreatureType(int xcoord, int ycoord); char CreatureType(int startx, int starty, int dir); }; class Random { public: int* rptr; void Print(); Random(int MIN, int MAX, int LEN); ~Random(); private: bool alreadyused(int checkthis, int len, int* rptr); bool isClean(); int len; }; class Coords { public: int x; int y; int MaxX; int MaxY; Coords() {x=0; y=0; MaxX=0; MaxY=0;} Coords(int X, int Y, int WIDTH, int HEIGHT) {x=X; y=Y; MaxX=WIDTH; MaxY=HEIGHT; } void MoveRight(); void MoveLeft(); void MoveUp(); void MoveDown(); void MoveUpRight(); void MoveUpLeft(); void MoveDownRight(); void MoveDownLeft(); void MoveDir(int dir); void setx(int X) {x=X;} void sety(int Y) {y=Y;} }; class Creature { public: bool alive; Coords Location; char displayletter; Creature() {Location.x=0; Location.y=0;} Creature(int i, int j) {Location.setx(i); Location.sety(j);} virtual void Attack() =0; virtual void AttackCreature(Grid G, int attackdirection) =0; virtual void Breed() =0; void Die(); void Move(Grid G); int DecideSquare(Grid G); void MoveTo(Grid G, int dir); }; class Human : public Creature { public: bool armed; //if armed, chances of winning fight increased for next fight bool vaccinated; //if vaccinated, no chance of getting infected int bitecount; //if a human is bitten, bite count is set to a random number int breedcount; //if a human goes x steps without combat, will breed if next to a human int starvecount; //if a human does not eat in x steps, will die Human() {displayletter='H';} Human(int i, int j) {displayletter='H';} void Attack(Grid G); void AttackCreature(Grid G, int attackdirection); void Breed(Grid G); //will breed after x steps and next to human int DecideAttack(Grid G); }; class Zombie : public Creature { public: Zombie() {displayletter='Z';} Zombie(int i, int j) {displayletter='Z';} void Attack(Grid G); void AttackCreature(Grid G, int attackdirection); void Breed() {} //does nothing int DecideAttack(Grid G); void AttackCreature(Grid G, int attackdirection); }; class Item { }; #endif definitions.cpp #include <cstdlib> #include "definitions.h" Random::Random(int MIN, int MAX, int LEN) //constructor { len=LEN; rptr=new int[LEN]; //allocate array of given length for (int i=0; i<LEN; i++) { int random; do { random = rand() % (MAX-MIN+1) + MIN; } while (alreadyused(random,LEN,rptr)); rptr[i]=random; } } bool Random::alreadyused(int checkthis, int len, int* rptr) { for (int i=0; i<len; i++) { if (rptr[i]==checkthis) return 1; } return 0; } Random::~Random() { delete rptr; } Grid::Grid(int WIDTHVALUE, int HEIGHTVALUE) { WIDTH = WIDTHVALUE; HEIGHT = HEIGHTVALUE; //builds 2d array of creature pointers cboard = new Creature**[WIDTH]; for(int i=0; i<WIDTH; i++) { cboard[i] = new Creature*[HEIGHT]; } //builds 2d array of item pointers iboard = new Item**[WIDTH]; for (int i=0; i<WIDTH; i++) { iboard[i] = new Item*[HEIGHT]; } } void Grid::FillGrid() { /* For each creature pointer in grid, randomly selects whether to initalize as zombie, human, or empty square. This methodology can be changed to initialize different creature types with different probabilities */ int random; for (int i=0; i<WIDTH; i++) { for (int j=0; j<HEIGHT; j++) { Random X(1,100,1); //create a single random integer from [1,100] at X.rptr random=*(X.rptr); if (random < 20) cboard[i][j] = new Human(i,j); else if (random < 40) cboard[i][j] = new Zombie(i,j); else cboard[i][j] = NULL; } } //at this point every creature pointer should be pointing to either //a zombie, human, or NULL with varying probabilities } void Grid::UpdateBuffer(char** buffer) { for (int i=0; i<WIDTH; i++) { for (int j=0; j<HEIGHT; j++) { if (cboard[i][j]) buffer[i][j]=cboard[i][j]->displayletter; else buffer[i][j]=' '; } } } bool Grid::isEmpty(int startx, int starty, int dir) { Coords StartLocation(startx,starty,WIDTH,HEIGHT); switch(dir) { case 1: StartLocation.MoveUp(); if (cboard[StartLocation.x][StartLocation.y]) return 0; case 2: StartLocation.MoveUpRight(); if (cboard[StartLocation.x][StartLocation.y]) return 0; case 3: StartLocation.MoveRight(); if (cboard[StartLocation.x][StartLocation.y]) return 0; case 4: StartLocation.MoveDownRight(); if (cboard[StartLocation.x][StartLocation.y]) return 0; case 5: StartLocation.MoveDown(); if (cboard[StartLocation.x][StartLocation.y]) return 0; case 6: StartLocation.MoveDownLeft(); if (cboard[StartLocation.x][StartLocation.y]) return 0; case 7: StartLocation.MoveLeft(); if (cboard[StartLocation.x][StartLocation.y]) return 0; case 8: StartLocation.MoveUpLeft(); if (cboard[StartLocation.x][StartLocation.y]) return 0; } return 1; } char Grid::CreatureType(int xcoord, int ycoord) { if (cboard[xcoord][ycoord]) //if there is a creature at location xcoord,ycoord return (cboard[xcoord][ycoord]->displayletter); else //if pointer at location xcoord,ycoord is null, return null char return '\0'; } char Grid::CreatureType(int startx, int starty, int dir) { Coords StartLocation(startx,starty,WIDTH,HEIGHT); switch(dir) { case 1: StartLocation.MoveUp(); if (cboard[StartLocation.x][StartLocation.y]) return (cboard[StartLocation.x][StartLocation.y]->displayletter); case 2: StartLocation.MoveUpRight(); if (cboard[StartLocation.x][StartLocation.y]) return (cboard[StartLocation.x][StartLocation.y]->displayletter); case 3: StartLocation.MoveRight(); if (cboard[StartLocation.x][StartLocation.y]) return (cboard[StartLocation.x][StartLocation.y]->displayletter); case 4: StartLocation.MoveDownRight(); if (cboard[StartLocation.x][StartLocation.y]) return (cboard[StartLocation.x][StartLocation.y]->displayletter); case 5: StartLocation.MoveDown(); if (cboard[StartLocation.x][StartLocation.y]) return (cboard[StartLocation.x][StartLocation.y]->displayletter); case 6: StartLocation.MoveDownLeft(); if (cboard[StartLocation.x][StartLocation.y]) return (cboard[StartLocation.x][StartLocation.y]->displayletter); case 7: StartLocation.MoveLeft(); if (cboard[StartLocation.x][StartLocation.y]) return (cboard[StartLocation.x][StartLocation.y]->displayletter); case 8: StartLocation.MoveUpLeft(); if (cboard[StartLocation.x][StartLocation.y]) return (cboard[StartLocation.x][StartLocation.y]->displayletter); } //if function hasn't returned by now, square being looked at is pointer to null return '\0'; //return null char } void Coords::MoveRight() {(x==MaxX)? (x=0):(x++);} void Coords::MoveLeft() {(x==0)? (x=MaxX):(x--);} void Coords::MoveUp() {(y==0)? (y=MaxY):(y--);} void Coords::MoveDown() {(y==MaxY)? (y=0):(y++);} void Coords::MoveUpRight() {MoveUp(); MoveRight();} void Coords::MoveUpLeft() {MoveUp(); MoveLeft();} void Coords::MoveDownRight() {MoveDown(); MoveRight();} void Coords::MoveDownLeft() {MoveDown(); MoveLeft();} void Coords::MoveDir(int dir) { switch(dir) { case 1: MoveUp(); break; case 2: MoveUpRight(); break; case 3: MoveRight(); break; case 4: MoveDownRight(); break; case 5: MoveDown(); break; case 6: MoveDownLeft(); break; case 7: MoveLeft(); break; case 8: MoveUpLeft(); break; case 0: break; } } void Creature::Move(Grid G) { int movedir=DecideSquare(G); MoveTo(G,movedir); } int Creature::DecideSquare(Grid G) { Random X(1,8,8); //X.rptr now points to 8 unique random integers from [1,8] for (int i=0; i<8; i++) { int dir=X.rptr[i]; if (G.isEmpty(Location.x,Location.y,dir)) return dir; } return 0; } void Creature::MoveTo(Grid G, int dir) { Coords OldLocation=Location; Location.MoveDir(dir); G.cboard[Location.x][Location.y]=this; //point new location to this creature G.cboard[OldLocation.x][OldLocation.y]=NULL; //point old location to NULL } void Creature::Die() { if (!alive) { delete this; this=NULL; } } void Human::Breed(Grid G) { if (!breedcount) { Coords BreedLocation=Location; Random X(1,8,8); for (int i=0; i<8; i++) { BreedLocation.MoveDir(X.rptr[i]); if (!G.cboard[BreedLocation.x][BreedLocation.y]) { G.cboard[BreedLocation.x][BreedLocation.y])=new Human(BreedLocation.x,BreedLocation.y); return; } } } } int Human::DecideAttack(Grid G) { Coords AttackLocation=Location; Random X(1,8,8); int attackdir; for (int i=0; i<8; i++) { attackdir=X.rptr[i]; switch(G.CreatureType(Location.x,Location.y,attackdir)) { case 'H': break; case 'Z': return attackdir; case '\0': break; default: break; } } return 0; //no zombies! } int AttackRoll(int para1, int para2) { //outcome 1: Zombie wins, human dies //outcome 2: Human wins, zombie dies //outcome 3: Human wins, zombie dies, but human is bitten Random X(1,100,1); int roll= *(X.rptr); if (roll < para1) return 1; else if (roll < para2) return 2; else return 3; } void Human::AttackCreature(Grid G, int attackdirection) { Coords AttackLocation=Location; AttackLocation.MoveDir(attackdirection); int para1=33; int para2=33; if (vaccinated) para2=101; //makes attackroll > para 2 impossible, never gets infected if (armed) para1-=16; //reduces chance of zombie winning fight int roll=AttackRoll(para1,para2); //outcome 1: Zombie wins, human dies //outcome 2: Human wins, zombie dies //outcome 3: Human wins, zombie dies, but human is bitten switch(roll) { case 1: alive=0; //human (this) dies return; case 2: G.cboard[AttackLocation.x][AttackLocation.y]->alive=0; return; //zombie dies case 3: G.cboard[AttackLocation.x][AttackLocation.y]->alive=0; //zombie dies Random X(3,7,1); //human is bitten bitecount=*(X.rptr); return; } } int Zombie::DecideAttack(Grid G) { Coords AttackLocation=Location; Random X(1,8,8); int attackdir; for (int i=0; i<8; i++) { attackdir=X.rptr[i]; switch(G.CreatureType(Location.x,Location.y,attackdir)) { case 'H': return attackdir; case 'Z': break; case '\0': break; default: break; } } return 0; //no zombies! } void Zombie::AttackCreature(Grid G, int attackdirection) { int reversedirection; if (attackdirection < 9 && attackdirection>0) { (attackdirection<5)? (reversedirection=attackdirection+4):(reversedirection=attackdirection-4); } else reversedirection=0; //this should never happen //when a zombie attacks a human, the Human::AttackZombie() function is called //in the "reverse" direction, utilizing that function that has already been written Coords ZombieLocation=Location; Coords HumanLocation=Location; HumanLocation.MoveDir(attackdirection); if (G.cboard[HumanLocation.x][HumanLocation.y]) //if there is a human there, which there should be G.cboard[HumanLocation.x][HumanLocation.y]->AttackCreature(G,reversedirection); } void Zombie::Attack(Grid G) { int attackdirection=DecideAttack(G); AttackCreature(G,attackdirection); } main.cpp #include <cstdlib> #include <iostream> #include "definitions.h" using namespace std; int main(int argc, char *argv[]) { Grid G(500,500); system("PAUSE"); return EXIT_SUCCESS; }

    Read the article

  • Replacing an ATA-100 hard drive

    - by Pieter
    I was instructed to replace the hard drive in an old laptop, a Dell Latitude D505. I'm suspecting that there was a head crash when someone moved the laptop while it was turned on. In the specifications, I found this about the hard drive: 30GB ATA-100; (4200RPM); 40GB ATA-100 (5400RPM); 60GB ATA-100 (4200RPM) *Optional 40GB (5400) 2nd HDD Module for media bay I'm familiar with SATA and IDE, but ATA-100 doesn't ring a bell. What do I have to take into account when I go look for a replacement hard drive?

    Read the article

  • Terminal Server 2008 not issuing Volume device CAL's

    - by Pieter
    We've a lot of Volume Licences left, but the License Server apparantly doesn't use them. Instead it issues Temporary Per Device CAL's. Which is a bit odd off course... There are two licensing servers installed on terminal servers, not on a domain controller (these are pushed by SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\LicenseServers registry setting) EDIT: http://img180.imageshack.us/img180/8927/ss20090909135547.png

    Read the article

  • External hard drive FAT32 to NTFS conversion fails

    - by Pieter
    I'm trying to convert the FAT32 file system of an external hard drive to NTFS. Here's what happened: C:\Windows\system32>chkdsk G: The type of the file system is FAT32. Volume PIETEREXT created 3/19/2008 12:43 Volume Serial Number is 1806-2E30 Windows is verifying files and folders... File and folder verification is complete. Windows has scanned the file system and found no problems. No further action is required. 488,264,768 KB total disk space. 72,192 KB in 1,503 hidden files. 1,281,792 KB in 40,029 folders. 309,235,168 KB in 199,915 files. 177,675,584 KB are available. 32,768 bytes in each allocation unit. 15,258,274 total allocation units on disk. 5,552,362 allocation units available on disk. C:\Windows\system32>cd \ C:\>convert g: /fs:ntfs The type of the file system is FAT32. Enter current volume label for drive G: PIETEREXT Volume PIETEREXT created 3/19/2008 12:43 Volume Serial Number is 1806-2E30 Windows is verifying files and folders... File and folder verification is complete. Windows has scanned the file system and found no problems. No further action is required. 488,264,768 KB total disk space. 72,192 KB in 1,503 hidden files. 1,281,792 KB in 40,029 folders. 309,235,168 KB in 199,915 files. 177,675,584 KB are available. 32,768 bytes in each allocation unit. 15,258,274 total allocation units on disk. 5,552,362 allocation units available on disk. Determining disk space required for file system conversion... Total disk space: 488384001 KB Free space on volume: 177675584 KB Space required for conversion: 975155 KB Converting file system The conversion failed. G: was not converted to NTFS I looked at the TechNet page for my error, but after closing every app the conversion was still failing halfway through. Why does it keep failing? I kept an eye on Task Manager but it didn't look like my system resources were near depletion. I'm using Windows 8.

    Read the article

  • Google Chrome doesn't want to access Facebook

    - by Pieter van Niekerk
    I have been experiencing a bit of a problem with Chrome over the last couple of days where it doesn't want to access Facebook. When I open Chrome it works fine for a while and then if I were to refresh the page it would give me the Chrome 'This webpage is not available' message. This webpage is not available Google Chrome could not load the webpage because www.facebook.com took too long to respond. The website may be down, or you may be experiencing issues with your Internet connection. Here are some suggestions: Reload this webpage later. Check your Internet connection. Restart any router, modem, or other network devices you may be using. Add Google Chrome as a permitted program in your firewall's or antivirus software's settings. If it is already a permitted program, try deleting it from the list of permitted programs and adding it again. If you use a proxy server, check your proxy settings or contact your network administrator to make sure the proxy server is working. If you don't believe you should be using a proxy server, adjust your proxy settings: Go to the wrench menu Options Under the Hood Change proxy settings... LAN Settings and deselect the "Use a proxy server for your LAN" checkbox. This problem only persists when using the proxy and doesn't occur at all when not on the proxy. I have also tried different browsers (IE9 and Firefox 9.01) but it doesn't occur in any of them. This problem goes away for a while when I restart Chrome, only to happen again a couple of minutes later. I have tried deleting the cookies for Facebook without restarting Chrome, but to no avail. I am using Windows7 with Chrome 17

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >