Search Results

Search found 851 results on 35 pages for 'rubin attack'.

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

  • C#: Delegate syntax?

    - by Rosarch
    I'm developing a game. I want to have game entities each have their own Damage() function. When called, they will calculate how much damage they want to do: public class CombatantGameModel : GameObjectModel { public int Health { get; set; } /// <summary> /// If the attack hits, how much damage does it do? /// </summary> /// <param name="randomSample">A random value from [0 .. 1]. Use to introduce randomness in the attack's damage.</param> /// <returns>The amount of damage the attack does</returns> public delegate int Damage(float randomSample); public CombatantGameModel(GameObjectController controller) : base(controller) {} } public class CombatantGameObject : GameObjectController { private new readonly CombatantGameModel model; public new virtual CombatantGameModel Model { get { return model; } } public CombatantGameObject() { model = new CombatantGameModel(this); } } However, when I try to call that method, I get a compiler error: /// <summary> /// Calculates the results of an attack, and directly updates the GameObjects involved. /// </summary> /// <param name="attacker">The aggressor GameObject</param> /// <param name="victim">The GameObject under assault</param> public void ComputeAttackUpdate(CombatantGameObject attacker, CombatantGameObject victim) { if (worldQuery.IsColliding(attacker, victim, false)) { victim.Model.Health -= attacker.Model.Damage((float) rand.NextDouble()); // error here Debug.WriteLine(String.Format("{0} hits {1} for {2} damage", attacker, victim, attackTraits.Damage)); } } The error is: 'Damage': cannot reference a type through an expression; try 'HWAlphaRelease.GameObject.CombatantGameModel.Damage' instead What am I doing wrong?

    Read the article

  • JXTreeTable and BorderHighlighter Drawing Border on All Rows

    - by Kevin Rubin
    I'm using a BorderHighlighter on my JXTreeTable to put a border above each of the table cells on non-leaf rows to give a more clear visual separator for users. The problem is that when I expand the hierarchical column, all cells in the hierarchical column, for all rows, include the Border from the Highlighter. The other columns are displaying just fine. My BorderHighlighter is defined like this: Highlighter topHighlighter = new BorderHighlighter(new HighlightPredicate() { @Override public boolean isHighlighted(Component component, ComponentAdapter adapter) { TreePath path = treeTable.getPathForRow(adapter.row); TreeTableModel model = treeTable.getTreeTableModel(); Boolean isParent = !model.isLeaf(path.getLastPathComponent()); return isParent; } }, BorderFactory.createMatteBorder(2, 0, 0, 0, Color.RED)); I'm using SwingX 1.6.5.

    Read the article

  • Does/Will autofac's ASP.NET integration support PreInit or Init events?

    - by David Rubin
    I see from poking around in the 1.4.4 source that Autofac's ASP.NET integration (via Autofac.Integration.Web) peforms injection of properties on the Page as part of the HttpContext.PreRequestHandlerExecute event handling, but that the page's child controls don't get their properties injected until Page.PreLoad. What this means, though is that the injected properties of child controls are unavailable for use in the OnInit event handler. For example, this works fine: HelloWorld.aspx: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HelloWorld.aspx.cs" Inherits="HelloWorld" %> <html> <body> <asp:Label runat="server" id="lblMsg" OnInit="HandleInit"/> </body> </html> HelloWorld.aspx.cs: ... protected void HandleInit() { lblMsg.Text = _msgProvider.GetMessage(); } public IMsgProvider _msgProvider { private get; set; } // <-- Injected But changing the HelloWorld Page to a UserControl (.acsx) and putting the UserControl in another page doesn't work because _msgProvider isn't injected early enough. Is there a way to make Autofac inject properties of child controls earlier? Or is this something that can be addressed in a future build? Thanks!

    Read the article

  • How do I map a one-to-one value type association in an joined-subclass?

    - by David Rubin
    I've got a class hierarchy mapped using table-per-subclass, and it's been working out great: class BasicReport { ... } class SpecificReport : BasicReport { ... } With mappings: <class name="BasicReport" table="reports"> <id name="Id" column="id">...</id> <!-- some common properties --> </class> <joined-subclass name="SpecificReport" table="specificReports" extends="BasicReport"> <key column="id"/> <!-- some special properties --> </joined-subclass> So far, so good. The problem I'm struggling with is how to add a property to one of my subclasses that's both a value type for which I have an IUserType implemented and also mapped via an association: class OtherReport : BasicReport { public SpecialValue V { get; set; } } class SpecialValueUserType : IUserType { ... } What I'd like to do is: <joined-subclass name="OtherReport" table="otherReports" extends="BasicReport"> <key column="id"/> <join table="rptValues" fetch="join"> <key column="rptId"/> <property name="V" column="value" type="SpecialValueUserType"/> </join> </joined-subclass> This accurately reflects the intent, and the pre-existing database schema I'm tied to: the SpecialValue instance is a property of the OtherReport, but is stored in a separate table ("rptValues"). Unfortunately, it seems as though I can't do this, because <join> elements can't be used in <joined-subclass> mappings. <one-to-one> would require creating a class mapping for SpecialValue, which doesn't make any sense given that SpecialValue is just a meaningful scalar. So what can I do? Do I have any options? Right now I'm playing a game with sets: class OtherReport : BasicReport { public SpecialValue V { get { return _values.Count() > 0 ? _values.First() : null; } set { _values.Clear(); _values.Add(value); } } private ICollection<SpecialValue> _values; } With mapping: <joined-subclass name="OtherReport" table="otherReports" extends="BasicReport"> <key column="id"/> <set name="_values" access="field" table="rptValues" cascade="all-delete-orphan"> <key column="rptId" /> <element column="value" type="SpecialValueUserType"/> </set> </joined-subclass> Thanks in advance for the help! I've been banging my head into my desk for several days now.

    Read the article

  • Looking for an appropriate design pattern

    - by user1066015
    I have a game that tracks user stats after every match, such as how far they travelled, how many times they attacked, how far they fell, etc, and my current implementations looks somewhat as follows (simplified version): Class Player{ int id; public Player(){ int id = Math.random()*100000; PlayerData.players.put(id,new PlayerData()); } public void jump(){ //Logic to make the user jump //... //call the playerManager PlayerManager.jump(this); } public void attack(Player target){ //logic to attack the player //... //call the player manager PlayerManager.attack(this,target); } } Class PlayerData{ public static HashMap<int, PlayerData> players = new HashMap<int,PlayerData>(); int id; int timesJumped; int timesAttacked; } public void incrementJumped(){ timesJumped++; } public void incrementAttacked(){ timesAttacked++; } } Class PlayerManager{ public static void jump(Player player){ players.get(player.getId()).incrementJumped(); } public void incrementAttacked(Player player, Player target){ players.get(player.getId()).incrementAttacked(); } } So I have a PlayerData class which holds all of the statistics, and brings it out of the player class because it isn't part of the player logic. Then I have PlayerManager, which would be on the server, and that controls the interactions between players (a lot of the logic that does that is excluded so I could keep this simple). I put the calls to the PlayerData class in the Manager class because sometimes you have to do certain checks between players, for instance if the attack actually hits, then you increment "attackHits". The main problem (in my opinion, correct me if I'm wrong) is that this is not very extensible. I will have to touch the PlayerData class if I want to keep track of a new stat, by adding methods and fields, and then I have to potentially add more methods to my PlayerManager, so it isn't very modulized. If there is an improvement to this that you would recommend, I would be very appreciative. Thanks.

    Read the article

  • Problem with inherited classes in C#

    - by Unniloct
    I have a class called "Entity," with two child classes: "Creature" and "Item." (I'm making a game.) Creature has two functions called "Attack," one for attacking Creatures, and one for attacking Items. So far, everything works well. Now I'm working on the shooting bit, so I have a function called SelectTarget(). It takes all of the Entities (both Creatures and Items) in the player's view that the player can shoot and lets the player choose one. So here lies the problem: SelectTarget() returns an Entity, but I need some code to figure out whether that Entity is a Creature or an Item, and process it appropriately. Since this question looks kind of empty without any code, and I'm not 100% sure my explanation is good enough, here's where I'm at: if (Input.Check(Key.Fire)) { Entity target = Game.State.SelectTarget.Run(); this.Draw(); if (target != null) { //Player.Attack(target); // This won't work, because I have: // Player.Attack((Creature)Target) // Player.Attack((Item)Target) // but nothing for Entity, the parent class to Creature and Item. return true; } } (If the way the game is laid out seems weird, it's a roguelike.)

    Read the article

  • Première sortie pour Android 3, le successeur d'Android 2.3 intégrera une version 3D des Google Maps

    Premières sortie pour Android 3 Le successeur d'Android 2.3 intégrera une version 3D des Google MapsLors de la conférence Dive Into Mobile qui se déroule actuellement, Andy Rubin, en charge du développement d'Android, a fait lors de sa keynote une démonstration de la future version d'Android (3.0, alias Honeycomb) sur une tablette Motorola.Le fait marquant de cette présentation (l'UI pour l'instant épurée n'ayant été qu'entraperçue) fut la démonstration de la future version de Google Maps qui sortira dans les jours avenir.De cette présentation il ressort qu'au menu de la prochaine mise à jour de Google Maps nous aurons : le chargement beaucoup plus rapide des cartes ; la gestion de l'affichage de...

    Read the article

  • Android : un demi-million d'appareils activés par jour avec une croissance de 4.4 % par semaine, son succès ne faiblit pas

    Android : un demi-million d'appareils activés par jour Avec une croissance de 4.4 % par semaine, son succès ne faiblit pas Mise à jour du 28/06/2011 par Idelways Contrairement à ce que pourraient faire croire certains indices, le succès d'Android ne faiblit pas, il est même plus fort que jamais puisqu'il vient de franchir la barre des 500 000 appareils activés par jour. Et contrairement aux milestones précédents, cette nouvelle n'a été annoncée jusque-là qu'à travers le compte Twitter du guru de l'OS chez Google et son vice-président de l'ingénierie Andy Rubin. Le nombre d'activations continue d'augmenter ...

    Read the article

  • Google: Numbers favor Android over iPhone

    <b>The Open Road:</b> "And according to Google VP Andy Rubin, the more the search giant blankets the industry with competing Android-droid based mobile handsets, the more likely Google is to hit its expected value of market dominance over Apple's iPhone."

    Read the article

  • Android 2.2 supportera Flash annonce le responsable de l'OS chez Google, qui répond également aux pr

    Mise à jour du 28/04/10 Android 2.2 supportera Flash C'est ce qu'annonce le responsable de l'OS chez Google, qui répond également à Steve Jobs et à ses propos sur Android L'ingénieur en charge du projet Android chez Google, Andy Rubin, vient d'accorder une interview au New York Times dans laquelle il annonce que Froyo (pour « Frozen Yourt » - nom de code de la prochaine version de l'OS mobile) assurera le « support total » ("full support") de Flash. Reste à savoir ce que ce « full support » recouvre : support d'une version Flash entière (différente de la version Lite généralement présente dans l'univers du développemen...

    Read the article

  • Is it worth the effort to block failed login attempts

    - by dunxd
    Is it worthwhile running fail2ban, sshdfilter or similar tools, which blacklist IP addresses which attempt and fail to login? I've seen it argued that this is security theatre on a "properly secured" server. However, I feel that it probably makes script kiddies move on to the next server in their list. Let's say that my server is "properly secured" and I am not worried that a brute force attack will actually succeed - are these tools simply keeping my logfiles clean, or am I getting any worthwhile benefit in blocking brute force attack attempts?

    Read the article

  • Using IP Tables to deny packet patterns?

    - by Chris
    I'm not experienced with IP tables but it's something I'll be looking into if this is plausible. I'm looking to set up a system to inspect packets and look for a pattern similar to korek's chop chop attack. Is there a way to set up the IP tables to defend against this attack? Thanks

    Read the article

  • linux vs windows and web server question

    - by student
    What are the differences from security point of view running a web server on linux and running a web server on windows. I heard that almost nobody going to attack linux machine. Is that true? or Linux is hard to attack and nobody want to waste his time?

    Read the article

  • Limiting database security

    - by Torbal
    A number of texts signify that the most important aspects offered by a DBMS are availability, integrity and secrecy. As part of a homework assignment I have been tasked with mentioning attacks which would affect each aspect. This is what I have come up with - are they any good? Availability - DDOS attack Integrity Secrecy - SQL Injection attack Integrity - Use of trojans to gain access to objects with higher security roles

    Read the article

  • Can I get an example please?

    - by Doug
    $starcraft = array( "drone" => array( "cost" => "6_0-", "gas" => "192", "minerals" => "33", "attack" => "123", ) "zealot" => array( "cost" => "5_0-", "gas" => "112", "minerals" => "21", "attack" => "321", ) ) I'm playing with oop and I want to display the information in this array using a class, but I don't know how to construct the class to display it. This is what I have so far, and I don't know where to go from here. Am I supposed to use setters and getters? class gamesInfo($game) { $unitname; $cost; $gas; $minerals; $attack; }

    Read the article

  • Preventing dictionary attacks on a web application

    - by Kevin Pang
    What's the best way to prevent a dictionary attack? I've thought up several implementations but they all seem to have some flaw in them: Lock out a user after X failed login attempts. Problem: easy to turn into a denial of service attack, locking out many users in a short amount of time. Incrementally increase response time per failed login attempt on a username. Problem: dictionary attacks might use the same password but different usernames. Incrementally increase response time per failed login attempt from an IP address. Problem: easy to get around by spoofing IP address. Incrementally increase response time per failed login attempt within a session. Problem: easy to get around by creating a dictionary attack that fires up a new session on each attempt.

    Read the article

  • Avoiding Hacker Trix

    - by Mike Benkovich
    Originally posted on: http://geekswithblogs.net/benko/archive/2014/08/20/avoiding-hacker-trix.aspxThis week we're doing a session called "Avoiding Hacker Trix" which goes thru some of the top web exploits that you should be aware of. In this webcast we will cover a variety of things including what we call the secure development process, cross site scripting attack, one click attack, SQL Injection and more. There are a bunch of links we cover, but rather than having you copy these down I'm providing them here... Links from the slide deck: Anti-XSS Library Download www.Fiddler2.com www.HelloSecureWorld.com Open Source Web Application Project - Top 10 Exploits Exploit: Cross Site Scripting - Paypal Exploit: SQL Injection - www.ri.gov Exploit: Cross Site Scripting - FTD Exploit: Insecure Direct Object Reference - Cahoots Exploit: Integer Overflow - Apple

    Read the article

  • Best way to handle realtime melee AI in authoritative network environment

    - by PrimeDerektive
    So i've been working on a multiplayer game for a bit; it's a co-op action RPG with real-time combat. If you've seen or played TERA, I'd say it's comparable to that, but not an MMO, heh. I'm currently handling the AI units authoritatively, the server calculates their pathing, movement, and pursue/attack logic, and syncs the movement to the clients 15x per second, and the state changes when they happen. When I emulate 200ms ping, though, the client can perceive being out of range to an AI's attack, but still take the hit, because on the server he hadn't moved that far yet. This also plays hell with my real-time blocking. I don't really want to allow the clients to be allowed to say "that was out of range" or "I blocked that", but I'm not really sure how else to handle it.

    Read the article

  • What's the recommended way of doing a HUD for an android game?

    - by joxnas
    Basically the question is in the title. I'm creating a RTS game and I will need buttons like attack move / attack ground, etc. I am not using any engine. When people do games in OpenGL for android (my case), do they ever use android components to control the game or do they create their components in the game? What are the general recommended approach, if there's any? How about more complex components like scrolling lists of items , etc? I would also appreciate you to pair your answer with a brief comment about how was your experience using the approach(es) you describe. Thanks :)

    Read the article

  • php file upload problem [closed]

    - by newcomer
    This code works properly in my localhost. I am using xampp 1.7.3. but when I put it in the live server it shows Possible file upload attack!. 'upload/' is the folder under 'public_html' folder on the server. I can upload files via other script in that directory. <?php $uploaddir = '/upload/';//I used C:/xampp/htdocs/upload/ in localhost. is it correct here? $uploadfile = $uploaddir . basename($_FILES['file_0']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['file_0']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\\n"; } else { echo "Possible file upload attack!\\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; ?>

    Read the article

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