Search Results

Search found 137 results on 6 pages for 'peg leg'.

Page 1/6 | 1 2 3 4 5 6  | Next Page >

  • Square Peg Web: Gets you the traffic to where it matters most: Your Website!

    - by demetriusalwyn
    Have you decided to start your business online or is your business not reaching the targeted audience? Come to Square Peg Web; where you will find what you want to make your business reach new heights. The team at Square Peg Web is professionals who understand what you want and make sure you get it right. Our confidence stems from the fact of thousands of satisfied clients who keep referring friends and business associates to us and we do not let our clients down. Many companies promise the sky but how far is does their work live up to the promises? We do not know about the others however, we are sure that we strive to put together all our ideas and thoughts to make your website rank among the top. Web hosting is something that needs to have a personal touch; Square Peg Web customizes everything to suit your requirements so that you do not have to look further. With Square Peg Web you have a host of features to make your Business go viral. Some of the product details that are offered with Square Peg Web are unlimited product options/ variants/ properties giving you an option on price modifiers. You get unlimited customized input fields for your products and you can also Customer-define the prices. Square Peg Web provides you an option of using multiple product images with zoom features and one can also list a particular product in several categories. There are other aspects which make Square Peg Web the best choice for your website needs; every sale of yours’ is important to you and to us. We make sure that each sale is tracked by the product and also the list of bestsellers that appeal to the audience. Other comprehensive statistics of Square Peg Web includes searchable order data, an interface for shipments and order fulfillments, export sales & customer data for usage in a spreadsheet and the ability to export orders to QuickBooks format. With Square Peg Web; Admin Panel is a lot simpler. Administrative access is completely password protected and any changes done are all in real-time. You can have absolute control on the cart from anywhere around the world using your web browser and the topping on the cake is the unlimited amount of admin accounts that can be created for you. Square Peg Web offers you a world of experience with the options of choosing from marketing websites to e-commerce and from customized applications to community oriented sites. Some of the projects which appear in the portfolio of Square Peg Web are Online Marketing Web Sites, E-Commerce Web Sites, customized web applications, Blog designing and programming, video sharing and the option of downloading web sites, online advertisements, flash animation, customer and product support web sites, web site re-designing and planning and complete information architecture.

    Read the article

  • Code Golf: Ghost Leg

    - by Anax
    The challenge The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the Ghost Leg method. Examples Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|" Output: 2 Input: 2, "| | |=| | |-| |-| | | |-| | |" Output: 1 Clarifications Do not bother with input. Consider the values as given somewhere else. Both input values are valid: the column number corresponds to an existing column and the pattern only contains the symbols |, -, = (and [space], [LF]). Also, two adjacent columns cannot both contain dashes (in the same line). The dimensions of the pattern are unknown (min 1x1). Clarifications #2 There are two invalid patterns: |-|-| and |=|=| which create ambiguity. The given input string will never contain those. The input variables are the same for all; a numeric value and a string representing the pattern. Entrants must produce a function. Test case Given pattern: "|-| |=|-|=|LF| |-| | |-|LF|=| |-| | |LF| | |-|=|-|" |-| |=|-|=| | |-| | |-| |=| |-| | | | | |-|=|-| Given value : Expected result 1 : 6 2 : 1 3 : 3 4 : 6 5 : 5 6 : 2

    Read the article

  • Leg animation not working

    - by Monacraft
    I am making a simple animation in XNA C# of a leg moving. This is the logic code for the thigh. It is meant to swing from 25' to 335'. However instead, it hits a point and then keeps on spinning in the other direction. Please help, here's the code: private void Thigh_method() { if (Legdata.Left == true) signvalue = -0.05f; else signvalue = 0.05f; if (Legdata.ToMid == true) Thighturn_ang += signvalue; if (Legdata.ToMid == false) Thighturn_ang -= signvalue; if (Thighturn_ang <= 25 || Thighturn_ang <= 335 && Thighturn_ang <= 180) Legdata.Left = true; if (Thighturn_ang >= 25 || Thighturn_ang >= 335 && Thighturn_ang >= 180) Legdata.Left = false; if (Thighturn_ang == 0) Legdata.ToMid = false; if (Math.Abs(Thighturn_ang) >= 25f) Legdata.ToMid = true; } Thanks in advance, Yours: Mona

    Read the article

  • Casting to derived type problem in C++

    - by GONeale
    Hey there everyone, I am quite new to C++, but have worked with C# for years, however it is not helping me here! :) My problem: I have an Actor class which Ball and Peg both derive from on an objective-c iphone game I am working on. As I am testing for collision, I wish to set an instance of Ball and Peg appropriately depending on the actual runtime type of actorA or actorB. My code that tests this as follows: // Actors that collided Actor *actorA = (Actor*) bodyA->GetUserData(); Actor *actorB = (Actor*) bodyB->GetUserData(); Ball* ball; Peg* peg; if (static_cast<Ball*> (actorA)) { // true ball = static_cast<Ball*> (actorA); } else if (static_cast<Ball*> (actorB)) { ball = static_cast<Ball*> (actorB); } if (static_cast<Peg*> (actorA)) { // also true?! peg = static_cast<Peg*> (actorA); } else if (static_cast<Peg*> (actorB)) { peg = static_cast<Peg*> (actorB); } if (peg != NULL) { [peg hitByBall]; } Once ball and peg are set, I then proceed to run the hitByBall method (objective c). Where my problem really lies is in the casting procedurel Ball casts fine from actorA; the first if (static_cast<>) statement steps in and sets the ball pointer appropriately. The second step is to assign the appropriate type to peg. I know peg should be a Peg type and I previously know it will be actorB, however at runtime, detecting the types, I was surprised to find actually the third if (static_cast<>) statement stepped in and set this, this if statement was to check if actorA was a Peg, which we already know actorA is a Ball! Why would it have stepped here and not in the fourth if statement? The only thing I can assume is how casting works differently from c# and that is it finds that actorA which is actually of type Ball derives from Actor and then it found when static_cast<Peg*> (actorA) is performed it found Peg derives from Actor too, so this is a valid test? This could all come down to how I have misunderstood the use of static_cast. How can I achieve what I need? :) I'm really uneasy about what feels to me like a long winded brute-casting attempt here with a ton of ridiculous if statements. I'm sure there is a more elegant way to achieve a simple cast to Peg and cast to Ball dependent on actual type held in actorA and actorB. Hope someone out there can help! :) Thanks a lot.

    Read the article

  • Second video card (PCI) under Windows 7

    - by dbkk101
    I'm trying to get an old PCI video card (Diamond Stealth 2500) along with a normal PCI-E video card. In BIOS, there is a setting to switch between PEG/PCI or PCI/PEG on startup (PEG is PCI-E Graphics). When I use PCI/PEG only the old PCI card works, when I use the other one, only the new PEG card works. In PEG/PCI mode, Windows 7 recognizes the card and shows it in Device Manager as Standard VGA adapter, but it shows a warning for the device ("This device cannot start. (Code 10)").

    Read the article

  • Maintain proper symbol order when applying an armature in flash

    - by Michael Taufen
    I am trying to animate a character's leg in flash CS 5.5 for a game I am working on. I decided to use the bone tool because it's awesome. The problem I am having, however, is that for my character to be animated properly, the symbols that make up his leg (upper leg, lower leg, and shoe) need to be on top of each other in a specific way (otherwise the shoe looks like its next to the leg, etc). Applying the bones results in the following problem: the first symbol I apply it to is placed in the rear on the armature layer, the next on top of it, and so on, until the final symbol is already on top. I need them to be in the opposite order, but arrange send to back does nothing on the armature layer. How can I fix this? tl;dr: The bone tool is not maintaining the stacking order of my objects, please help. Thanks for helping :).

    Read the article

  • Are there any Parsing Expression Grammar (PEG) libraries for Javascript or PHP?

    - by Peter J. Wasilko
    I find myself drawn to the Parsing Expression Grammar formalism for describing domain specific languages, but so far the implementation code I've found has been written in languages like Java and Haskell that aren't web server friendly in the shared hosting environment that my organization has to live with. Does anyone know of any PEG libraries or PackRat Parser Generators for Javascript or PHP? Of course code generators in any languages that can produce Javascript or PHP source code would do the trick.

    Read the article

  • Matplotlib pick event order for overlapping artists

    - by Ajean
    I'm hitting a very strange issue with matplotlib pick events. I have two artists that are both pickable and are non-overlapping to begin with ("holes" and "pegs"). When I pick one of them, during the event handling I move the other one to where I just clicked (moving a "peg" into the "hole"). Then, without doing anything else, a pick event from the moved artist (the peg) is generated even though it wasn't there when the first event was generated. My only explanation for it is that somehow the event manager is still moving through artist layers when the event is processed, and therefore hits the second artist after it is moved under the cursor. So then my question is - how do pick events (or any events for that matter) iterate through overlapping artists on the canvas, and is there a way to control it? I think I would get my desired behavior if it moved from the top down always (rather than bottom up or randomly). I haven't been able to find sufficient enough documentation, and a lengthy search on SO has not revealed this exact issue. Below is a working example that illustrates the problem, with PathCollections from scatter as pegs and holes: import matplotlib.pyplot as plt import sys class peg_tester(): def __init__(self): self.fig = plt.figure(figsize=(3,1)) self.ax = self.fig.add_axes([0,0,1,1]) self.ax.set_xlim([-0.5,2.5]) self.ax.set_ylim([-0.25,0.25]) self.ax.text(-0.4, 0.15, 'One click on the hole, and I get 2 events not 1', fontsize=8) self.holes = self.ax.scatter([1], [0], color='black', picker=0) self.pegs = self.ax.scatter([0], [0], s=100, facecolor='#dd8800', edgecolor='black', picker=0) self.fig.canvas.mpl_connect('pick_event', self.handler) plt.show() def handler(self, event): if event.artist is self.holes: # If I get a hole event, then move a peg (to that hole) ... # but then I get a peg event also with no extra clicks! offs = self.pegs.get_offsets() offs[0,:] = [1,0] # Moves left peg to the middle self.pegs.set_offsets(offs) self.fig.canvas.draw() print 'picked a hole, moving left peg to center' elif event.artist is self.pegs: print 'picked a peg' sys.stdout.flush() # Necessary when in ipython qtconsole if __name__ == "__main__": pt = peg_tester() I have tried setting the zorder to make the pegs always above the holes, but that doesn't change how the pick events are generated, and particularly this funny phantom event.

    Read the article

  • The Sound of Two Toilets Flushing: Constructive Criticism for Virgin Atlantic Complaints Department

    - by Geertjan
    I recently had the experience of flying from London to Johannesburg and back with Virgin Atlantic. The good news was that it was the cheapest flight available and that the take off and landing were absolutely perfect. Hence I really have no reason to complain. Instead, I'd like to offer some constructive criticism which hopefully Richard Branson will find sometime while googling his name. Or maybe someone from the Virgin Atlantic Complaints Department will find it, whatever, just want to put this information out there. Arrangement of restroom facilities. Maybe next time you design an airplane, consider not putting your toilets at a right angle right next to your rows of seats. Being able to reach, without even needing to stretch your arm, from your seat to close, yet again, a toilet door that someone, someone obviously sitting very far from the toilets, carelessly forgot to close is not an indicator of quality interior design. Have you noticed how all other airplanes have their toilets in a cubicle separated from the rows of seats? On those airplanes, people sitting in the seats near the toilets are not constantly being woken up throughout the night whenever someone enters/exits the toilet, whenever the light in the toilet is suddenly switched on, and whenever one of the toilets flushes. Bonus points for Virgin Atlantic passengers in the seats adjoining the toilets is when multiple toilets are flushed simultaneously and multiple passengers enter/exit them at the same time, a bit like an unasked for low budget musical of suddenly illuminated grumpy people in crumpled clothes. What joy that brings at 3 AM is hard to describe. Seats with extra leg room. You know how other airplanes have the seats with the extra leg room? You know what those seats tend to have? Extra leg room. It's really interesting how Virgin Atlantic's seats with extra leg room actually have no extra leg room at all. It should have been a give away, the fact that these special seats are found in the same rows as the standard seats, rather than on the cusp of real glory which is where most airlines put their extra leg room seats, with the only actual difference being that they have a slightly different color. Had you called them "seats with a different color" (i.e., almost not quite green, rather than something vaguely hinting at blue), at least I'd have known what I was getting. Picture the joy at 3 AM, rudely awakened from nightmarish slumber, partly grateful to have been released from a grayish dream of faceless zombies resembling one or two of those in a recent toilet line, by multiple adjoining toilets flushing simultaneously, while you're sitting in a seat with extra leg room that has exactly as much leg room as the seats in neighboring rows. You then have a choice of things to be sincerely annoyed about. Food from the '80's. In the '80's, airplane food came in soggy containers and even breakfast, the most important meal of the day, was a sad heap of vaguely gray colors. The culinary highlight tended to be a squashed tomato, which must have been mashed to a pulp with a brick prior to being regurgitated by a small furry animal, and there was also always a piece of immensely horrid pumpkin, as well as a slice of spongy something you'd never seen before. Sausages and mash at 6 AM on an airplane was always a heavy lump of horribleness. Thankfully, all airlines throughout the world changed from this puke inducing strategy around 1987 sometime. Not Virgin Atlantic, of course. The fatty sausages and mash are still there, bringing you flashbacks to Duran Duran, which is what you were listening to (on your walkman) the last time you saw it in an airplane. Even the golden oldie "squashed tomato attached by slime to three wet peas" is on the menu. How wonderful to have all this in a cramped seat with a long row of early morning bleariness lined up for the toilets, right at your side, bumping into your elbow, groggily, one by one, one after another, more and more, fumble-open-door-silence-flush-fumble-open-door, and on and on, while you tentatively push your fork through a soggy pile of colorless mush, fighting the urge to throw up on the stinky socks of whatever nightmarish zombie is bumping into your elbow at the time. But, then again, the plane landed without a hitch, in fact, extremely smoothly, so I'm certainly not blaming the pilots.

    Read the article

  • Is there a network "tee"-alike with one leg returning to /dev/null ?

    - by Steff Davies
    I've just built a new PostgreSQL server for my employers, which is happily replicating using WALs. I'm now left with the problem of verifying its performance. One nice way which came up in conversation is to break replication with the slave caught up and then direct all production traffic to both servers, discarding the responses from the new server and returning those from the current one to the clients. Once we're sure performance is OK, we re-sync the slave and can fail over with confidence. Bliss. This would require a TCP proxy capable of opening two outgoing connections for each incoming one, and discarding the data returned from one of them, which is a tricky thing to google for, it seems. Do the assembled brains know of such a thing, before I dive into libevent and write one?

    Read the article

  • A Knights Tale

    - by Phil Factor
    There are so many lessons to be learned from the story of Knight Capital losing nearly half a billion dollars as a result of a deployment gone wrong. The Knight Capital Group (KCG N) was an American global financial services firm engaging in market making, electronic execution, and institutional sales and trading. According to the recent order (File No.3.15570) against Knight Capital by U.S. Securities and Exchange Commission?, Knight had, for many years used some software which broke up incoming “parent” orders into smaller “child” orders that were then transmitted to various exchanges or trading venues for execution. A tracking ‘cumulative quantity’ function counted the number of ‘child’ orders and stopped the process once the total of child orders matched the ‘parent’ and so the parent order had been completed. Back in the mists of time, some code had been added to it  which was excuted if a particular flag was set. It was called ‘power peg’ and seems to have had a similar design and purpose, but, one guesses, would have shared the same tracking function. This code had been abandoned in 2003, but never deleted. In 2005, The tracking function was moved to an earlier point in the main process. It would seem from the account that, from that point, had that flag ever been set, the old ‘Power Peg’ would have been executed like Godzilla bursting from the ice, making child orders without limit without any tracking function. It wasn’t, presumably because the software that set the flag was removed. In 2012, nearly a decade after ‘Power Peg’ was abandoned, Knight prepared a new module to their software to cope with the imminent Retail Liquidity Program (RLP) for the New York Stock Exchange. By this time, the flag had remained unused and someone made the fateful decision to reuse it, and replace the old ‘power peg’ code with this new RLP code. Had the two actions been done together in a single automated deployment, and the new deployment tested, all would have been well. It wasn’t. To quote… “Beginning on July 27, 2012, Knight deployed the new RLP code in SMARS in stages by placing it on a limited number of servers in SMARS on successive days. During the deployment of the new code, however, one of Knight’s technicians did not copy the new code to one of the eight SMARS computer servers. Knight did not have a second technician review this deployment and no one at Knight realized that the Power Peg code had not been removed from the eighth server, nor the new RLP code added. Knight had no written procedures that required such a review.” (para 15) “On August 1, Knight received orders from broker-dealers whose customers were eligible to participate in the RLP. The seven servers that received the new code processed these orders correctly. However, orders sent with the repurposed flag to the eighth server triggered the defective Power Peg code still present on that server. As a result, this server began sending child orders to certain trading centers for execution. Because the cumulative quantity function had been moved, this server continuously sent child orders, in rapid sequence, for each incoming parent order without regard to the number of share executions Knight had already received from trading centers. Although one part of Knight’s order handling system recognized that the parent orders had been filled, this information was not communicated to SMARS.” (para 16) SMARS routed millions of orders into the market over a 45-minute period, and obtained over 4 million executions in 154 stocks for more than 397 million shares. By the time that Knight stopped sending the orders, Knight had assumed a net long position in 80 stocks of approximately $3.5 billion and a net short position in 74 stocks of approximately $3.15 billion. Knight’s shares dropped more than 20% after traders saw extreme volume spikes in a number of stocks, including preferred shares of Wells Fargo (JWF) and semiconductor company Spansion (CODE). Both stocks, which see roughly 100,000 trade per day, had changed hands more than 4 million times by late morning. Ultimately, Knight lost over $460 million from this wild 45 minutes of trading. Obviously, I’m interested in all this because, at one time, I used to write trading systems for the City of London. Obviously, the US SEC is in a far better position than any of us to work out the failings of Knight’s IT department, and the report makes for painful reading. I can’t help observing, though, that even with the breathtaking mistakes all along the way, that a robust automated deployment process that was ‘all-or-nothing’, and tested from soup to nuts would have prevented the disaster. The report reads like a Greek Tragedy. All the way along one wants to shout ‘No! not that way!’ and ‘Aargh! Don’t do it!’. As the tragedy unfolds, the audience weeps for the players, trapped by a cruel fate. All application development and deployment requires defense in depth. All IT goes wrong occasionally, but if there is a culture of defensive programming throughout, the consequences are usually containable. For financial systems, these defenses are required by statute, and ignored only by the foolish. Knight’s mistakes weren’t made by just one hapless sysadmin, but were progressive errors by an  IT culture spanning at least ten years.  One can spell these out, but I think they’re obvious. One can only hope that the industry studies what happened in detail, learns from the mistakes, and draws the right conclusions.

    Read the article

  • Is Fast Enumeration messing with my text output?

    - by Dan Ray
    Here I am iterating through an array of NSDictionary objects (inside the parsed JSON response of the EXCELLENT MapQuest directions API). I want to build up an HTML string to put into a UIWebView. My code says: for (NSDictionary *leg in legs ) { NSString *thisLeg = [NSString stringWithFormat:@"<br>%@ - %@", [leg valueForKey:@"narrative"], [leg valueForKey:@"distance"]]; NSLog(@"This leg's string is %@", thisLeg); [directionsOutput appendString:thisLeg]; } The content of directionsOutput (which is an NSMutableString) contains ALL the values for [leg valueForKey:@"narrative"], wrapped up in parens, followed by a hyphen, followed by all the parenthesized values for [leg valueForKey:@"distance"]. So I put in that NSLog call... and I get the same thing there! It appears that the for() is somehow batching up our output values as we iterate, and putting out the output only once. How do I make it not do this but instead do what I actually want, which is an iterative output as I iterate? Here's what NSLog gets. Yes, I know I need to figure out NSNumberFormatter. ;-) This leg's string is ( "Start out going NORTH on INFINITE LOOP.", "Turn LEFT to stay on INFINITE LOOP.", "Turn RIGHT onto N DE ANZA BLVD.", "Merge onto I-280 S toward SAN JOSE.", "Merge onto CA-87 S via EXIT 3A.", "Take the exit on the LEFT.", "Merge onto CA-85 S via EXIT 1A on the LEFT toward GILROY.", "Merge onto US-101 S via EXIT 1A on the LEFT toward LOS ANGELES.", "Take the CA-152 E/10TH ST exit, EXIT 356.", "Turn LEFT onto CA-152/E 10TH ST/PACHECO PASS HWY. Continue to follow CA-152/PACHECO PASS HWY.", "Turn SLIGHT RIGHT.", "Turn SLIGHT RIGHT onto PACHECO PASS HWY/CA-152 E. Continue to follow CA-152 E.", "Merge onto I-5 S toward LOS ANGELES.", "Take the CA-46 exit, EXIT 278, toward LOST HILLS/WASCO.", "Turn LEFT onto CA-46/PASO ROBLES HWY. Continue to follow CA-46.", "Merge onto CA-99 S toward BAKERSFIELD.", "Merge onto CA-58 E via EXIT 24 toward TEHACHAPI/MOJAVE.", "Merge onto I-15 N via the exit on the LEFT toward I-40/LAS VEGAS.", "Keep RIGHT to take I-40 E via EXIT 140A toward NEEDLES (Passing through ARIZONA, NEW MEXICO, TEXAS, OKLAHOMA, and ARKANSAS, then crossing into TENNESSEE).", "Merge onto I-40 E via EXIT 12C on the LEFT toward NASHVILLE (Crossing into NORTH CAROLINA).", "Merge onto I-40 BR E/US-421 S via EXIT 188 on the LEFT toward WINSTON-SALEM.", "Take the CLOVERDALE AVE exit, EXIT 4.", "Turn LEFT onto CLOVERDALE AVE SW.", "Turn SLIGHT LEFT onto N HAWTHORNE RD.", "Turn RIGHT onto W NORTHWEST BLVD.", "1047 W NORTHWEST BLVD is on the LEFT." ) - ( 0.0020000000949949026, 0.07800000160932541, 0.14000000059604645, 7.827000141143799, 5.0329999923706055, 0.15299999713897705, 5.050000190734863, 20.871000289916992, 0.3050000071525574, 2.802999973297119, 0.10199999809265137, 37.78000259399414, 124.50700378417969, 0.3970000147819519, 25.264001846313477, 20.475000381469727, 125.8580093383789, 4.538000106811523, 1693.0350341796875, 628.8970336914062, 3.7990000247955322, 0.19099999964237213, 0.4099999964237213, 0.257999986410141, 0.5170000195503235, 0 )

    Read the article

  • What Can We Learn About Software Security by Going to the Gym

    - by Nick Harrison
    There was a recent rash of car break-ins at the gym. Not an epidemic by any stretch, probably 4 or 5, but still... My gym used to allow you to hang your keys from a peg board at the front desk. This way you could come to the gym dressed to work out, lock your valuables in your car, and not have anything to worry about. Ignorance is bliss. The problem was that anyone who wanted to could go pick up your car keys, click the unlock button and find your car. Once there, they could rummage through your stuff and then walk back in and finish their workout as if nothing had happened. The people doing this were a little smatter then the average thief and would swipe some but not all of your cash leaving everything else in place. Most thieves would steal the whole car and be busted more quickly. The victims were unaware that anything had happened for several days. Fortunately, once the victims realized what had happened, the gym was still able to pull security tapes and find out who was misbehaving. All of the bad guys were busted, and everyone can now breathe a sigh of relieve. It is once again safe to go to the gym. Except there was still a fundamental problem. Putting your keys on a peg board by the front door is just asking for bad things to happen. One person got busted exploiting this security flaw. Others can still be exploiting it. In fact, others may well have been exploiting it and simply never got caught. How long would it take you to realize that $10 was missing from your wallet, if everything else was there? How would you even know when it went missing? Would you go to the front desk and even bother to ask them to review security tapes if you were only missing a small amount. Once highlighted, it is easy to see how commonly such vulnerability may have been exploited. So the gym did the very reasonable precaution of removing the peg board. To me the most shocking part of this story is the resulting uproar from gym members losing the convenient key peg. How dare they remove the trusted peg board? How can I work out now, I have to carry my keys from machine to machine? How can I enjoy my workout with this added inconvenience? This all happened a couple of weeks ago, and some people are still complaining. In light of the recent high profile hacking, there are a couple of parallels that can be drawn. Many web sites are riddled with vulnerabilities are crazy and easily exploitable as leaving your car keys by the front door while you work out. No one ever considered thanking the people who were swiping these keys for pointing out the vulnerability. Without a hesitation, they had their gym memberships revoked and are awaiting prosecution. The gym did recognize the vulnerability for what it is, and closed up that attack vector. What can we learn from this? Monitoring and logging will not prevent a crime but they will allow us to identify that a crime took place and may help track down who did it. Once we find a security weakness, we need to eliminate it. We may never identify and eliminate all security weaknesses, but we cannot allow well known vulnerabilities to persist in our system. In our case, we are not likely to meet resistance from end users. We are more likely to meet resistance from stake holders, product owners, keeper of schedules and budgets. We may meet resistance from integration partners, co workers, and third party vendors. Regardless of the source, we will see resistance, but the weakness needs to be dealt with. There is no need to glorify a cracker for bringing to light a security weakness. Regardless of their claimed motives, they are not heroes. There is also no point in wasting time defending weaknesses once they are identified. Deal with the weakness and move on. In may be embarrassing to find security weaknesses in our systems, but it is even more embarrassing to continue ignoring them. Even if it is unpopular, we need to seek out security weaknesses and eliminate them when we find them. http://www.sans.org has put together the Common Weakness Enumeration http://cwe.mitre.org/ which lists out common weaknesses. The site navigation takes a little getting used to, but there is a treasure trove here. Here is the detail page for SQL Injection. It clearly states how this can be exploited, in case anyone doubts that the weakness should be taken seriously, and more importantly how to mitigate the risk.

    Read the article

  • c++ recursion with arrays

    - by Sam
    I have this project that I'm working on for a class, and I'm not looking for the answer, but maybe just a few tips since I don't feel like I'm using true recursion. The problem involves solving the game of Hi Q or "peg solitaire" where you want the end result to be one peg remaining (it's played with a triangular board and one space is open at the start.) I've represented the board with a simple array, each index being a spot and having a value of 1 if it has a peg, and 0 if it doesn't and also the set of valid moves with a 2 dimensional array that is 36, 3 (each move set contains 3 numbers; the peg you're moving, the peg it hops over, and the destination index.) So my problem is that in my recursive function, I'm using a lot of iteration to determine things like which space is open (or has a value of 0) and which move to use based on which space is open by looping through the arrays. Secondly, I don't understand how you would then backtrack with recursion, in the event that an incorrect move was made and you wanted to take that move back in order to choose a different one. This is what I have so far; the "a" array represents the board, the "b" array represents the moves, and the "c" array was my idea of a reminder as to which moves I used already. The functions used are helper functions that basically just loop through the arrays to find an empty space and corresponding move. : void solveGame(int a[15], int b[36][3], int c[15][3]){ int empSpace; int moveIndex; int count = 0; if(pegCount(a) < 2){ return; } else{ empSpace = findEmpty(a); moveIndex = chooseMove( a, b, empSpace); a[b[moveIndex][0]] = 0; a[b[moveIndex][1]] = 0; a[b[moveIndex][2]] = 1; c[count][0] = b[moveIndex][0]; c[count][1] = b[moveIndex][1]; c[count][2] = b[moveIndex][2]; solveGame(a,b,c); } }

    Read the article

  • How can I solve the Log Pile wooden puzzle with a computer program?

    - by craig1410
    Can anyone suggest how to solve the Log Pile wooden puzzle using a computer program? See here to visualise the puzzle: http://www.puzzlethis.co.uk/products/madcow/the_log_pile.htm The picture only shows some of the pieces. The full set of 10 pieces are configured as follows with 1 representing a peg, -1 representing a hole and 0 representing neither a peg nor a hole. -1,1,0,-1,0 1,0,1,0,0 1,-1,1,0,0 -1,-1,0,0,-1 -1,1,0,1,0 0,1,0,0,1 1,0,-1,0,-1 0,-1,0,1,0 0,0,-1,1,-1 1,0,-1,0,0 The pieces can be interlocked in two layers of 5 pieces each with the top layer at 90 degrees to the bottom layer as shown in the above link. I have already created a solution to this problem myself using Java but I feel that it was a clumsy solution and I am interested to see some more sophisticated solutions. Feel free to either suggest a general approach or to provide a working program in the language of your choice. My approach was to use the numeric notation above to create an array of "Logs". I then used a combination/permutation generator to try all possible arrangements of the Logs until a solution was found where all the intersections equated to zero (ie. Peg to Hole, Hole to Peg or Blank to Blank). I used some speed-ups to detect the first failed intersection for a given permutation and move on to the next permutation. I hope you find this as interesting as I have. Thanks, Craig.

    Read the article

  • Make a basic running sprite effect

    - by PhaDaPhunk
    I'm building my very first game with XNA and i'm trying to get my sprite to run. Everything is working fine for the first sprite. E.g : if I go right(D) my sprite is looking right , if I go left(A) my sprite is looking left and if I don't touch anything my sprite is the default one. Now what I want to do is if the sprite goes Right, i want to alternatively change sprites (left leg, right leg, left leg etc..) xCurrent is the current sprite drawn xRunRight is the first running Sprite and xRunRight1 is the one that have to exchange with xRunRight while running right. This is what I have now : protected override void Update(GameTime gameTime) { float timer = 0f; float interval = 50f; bool frame1 = false ; bool frame2 = false; bool running = false; KeyboardState FaKeyboard = Keyboard.GetState(); // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); if ((FaKeyboard.IsKeyUp(Keys.A)) || (FaKeyboard.IsKeyUp(Keys.D))) { xCurrent = xDefault; } if (FaKeyboard.IsKeyDown(Keys.D)) { timer += (float)gameTime.ElapsedGameTime.TotalMilliseconds; if (timer > interval) { if (frame1) { xCurrent = xRunRight; frame1 = false; } else { xCurrent = xRunRight1; frame1 = true; } } xPosition += xDeplacement; } Any ideas...? I've been stuck on this for a while.. Thanks in advance and let me know if you need any other part from the code.

    Read the article

  • Ragdoll continuous movement

    - by Siddharth
    I have created a ragdoll for my game but the problem I found was that the ragdoll joints are not perfectly implemented so they are continuously moving. Ragdoll does not stand at fix place. I here paste my work for that and suggest some guidance about that so that it can stand on fix place. chest = new Chest(pX, pY, gameObject.getmChestTextureRegion(), gameObject); head = new Head(pX, pY - 16, gameObject.getmHeadTextureRegion(), gameObject); leftHand = new Hand(pX - 6, pY + 6, gameObject.getmHandTextureRegion() .clone(), gameObject); rightHand = new Hand(pX + 12, pY + 6, gameObject .getmHandTextureRegion().clone(), gameObject); rightHand.setFlippedHorizontal(true); leftLeg = new Leg(pX, pY + 18, gameObject.getmLegTextureRegion() .clone(), gameObject); rightLeg = new Leg(pX + 7, pY + 18, gameObject.getmLegTextureRegion() .clone(), gameObject); rightLeg.setFlippedHorizontal(true); gameObject.getmScene().registerTouchArea(chest); gameObject.getmScene().attachChild(chest); gameObject.getmScene().registerTouchArea(head); gameObject.getmScene().attachChild(head); gameObject.getmScene().registerTouchArea(leftHand); gameObject.getmScene().attachChild(leftHand); gameObject.getmScene().registerTouchArea(rightHand); gameObject.getmScene().attachChild(rightHand); gameObject.getmScene().registerTouchArea(leftLeg); gameObject.getmScene().attachChild(leftLeg); gameObject.getmScene().registerTouchArea(rightLeg); gameObject.getmScene().attachChild(rightLeg); // head revolute joint revoluteJointDef = new RevoluteJointDef(); revoluteJointDef.enableLimit = true; revoluteJointDef.initialize(head.getHeadBody(), chest.getChestBody(), chest.getChestBody().getWorldCenter()); revoluteJointDef.localAnchorA.set(0f, 0f); revoluteJointDef.localAnchorB.set(0f, -0.5f); revoluteJointDef.lowerAngle = (float) (0f / (180 / Math.PI)); revoluteJointDef.upperAngle = (float) (0f / (180 / Math.PI)); headRevoluteJoint = (RevoluteJoint) gameObject.getmPhysicsWorld() .createJoint(revoluteJointDef); // // left leg revolute joint revoluteJointDef.initialize(leftLeg.getLegBody(), chest.getChestBody(), chest.getChestBody().getWorldCenter()); revoluteJointDef.localAnchorA.set(0f, 0f); revoluteJointDef.localAnchorB.set(-0.15f, 0.75f); revoluteJointDef.lowerAngle = (float) (0f / (180 / Math.PI)); revoluteJointDef.upperAngle = (float) (0f / (180 / Math.PI)); leftLegRevoluteJoint = (RevoluteJoint) gameObject.getmPhysicsWorld() .createJoint(revoluteJointDef); // right leg revolute joint revoluteJointDef.initialize(rightLeg.getLegBody(), chest.getChestBody(), chest.getChestBody().getWorldCenter()); revoluteJointDef.localAnchorA.set(0f, 0f); revoluteJointDef.localAnchorB.set(0.15f, 0.75f); revoluteJointDef.lowerAngle = (float) (0f / (180 / Math.PI)); revoluteJointDef.upperAngle = (float) (0f / (180 / Math.PI)); rightLegRevoluteJoint = (RevoluteJoint) gameObject.getmPhysicsWorld() .createJoint(revoluteJointDef); // left hand revolute joint revoluteJointDef.initialize(leftHand.getHandBody(), chest.getChestBody(), chest.getChestBody().getWorldCenter()); revoluteJointDef.localAnchorA.set(0f, 0f); revoluteJointDef.localAnchorB.set(-0.25f, 0.1f); revoluteJointDef.lowerAngle = (float) (0f / (180 / Math.PI)); revoluteJointDef.upperAngle = (float) (0f / (180 / Math.PI)); leftHandRevoluteJoint = (RevoluteJoint) gameObject.getmPhysicsWorld() .createJoint(revoluteJointDef); // right hand revolute joint revoluteJointDef.initialize(rightHand.getHandBody(), chest.getChestBody(), chest.getChestBody().getWorldCenter()); revoluteJointDef.localAnchorA.set(0f, 0f); revoluteJointDef.localAnchorB.set(0.25f, 0.1f); revoluteJointDef.lowerAngle = (float) (0f / (180 / Math.PI)); revoluteJointDef.upperAngle = (float) (0f / (180 / Math.PI)); rightHandRevoluteJoint = (RevoluteJoint) gameObject.getmPhysicsWorld() .createJoint(revoluteJointDef);

    Read the article

  • How do we know the correct moves of Tower of Hanoi?

    - by Saqib
    We know that: In case of iterative solution: Alternating between the smallest and the next-smallest disks, follow the steps for the appropriate case: For an even number of disks: make the legal move between pegs A and B make the legal move between pegs A and C make the legal move between pegs B and C repeat until complete For an odd number of disks: make the legal move between pegs A and C make the legal move between pegs A and B make the legal move between pegs B and C repeat until complete In case of recursive solution: To move n discs from peg A to peg C: move n-1 discs from A to B. This leaves disc n alone on peg A move disc n from A to C move n-1 discs from B to C so they sit on disc n Now the questions are: How did we get this two solutions? Only by intuition? Or by logical/mathematical computation? If computation, how?

    Read the article

  • What the heck is the "Structure and Interpretation of Computer Programs" cover drawing about?

    - by Paul Reiners
    What the heck is the Structure and Interpretation of Computer Programs cover drawing about? I mean I know what "eval", "apply", and '?' all mean, but I'm having a hard time deciphering the rest of the picture. Who the heck is the maiden? Does she work for the wizard? Why the heck is she pointing at the table? Is she pointing at that little bowl-type thing? Or the books? Or the table in general? Is she trying to tell the wizard that he should apply some sort of Lisp wizardry to the table or the items on it? Or is she just telling him something prosaic, such as his food is getting cold? What the heck is the one leg on that table that looks like...a leg...with a foot at the end (as legs tend to have)? How does the table balance on one leg? (Or is that another leg in the shadows?) [Note: I'm waiting for a lengthy build to finish in case you were wondering.]

    Read the article

1 2 3 4 5 6  | Next Page >