There are a number of ways that a small business can obtain a privacy policy for their website. If you choose the “in-house method”, we offer 8 tips to get you started.
SQL Server 2005 has a ROW_NUMBER Function that can help with paging records for you database applications. ROW_NUMBER returns a sequential number, starting at 1, for each row returned in a resultset.
I've been searching the internet all day and I can't find the answer I'm looking for.
In my HUD I want to use orange dots to represent lives. The user starts off with 5 lives and every time they die, I want a dot to be removed. Pretty straight forward.
So far my idea is to make a movie clip that has the five dots in a line. There would be 5 frames on the timeline (because after the last life it goes to a game over screen right away).
I would have a variable set up to store the number of lives and a function to keep track of lives. So every hit of an obstacle would result in livesCounter--;. Then I would set up something like this:
switch(livesCounter){
case 5: livesDisplay.gotoAndPlay(1);
break;
case 4: livesDisplay.gotoAndPlay(2);
break;
case 3: livesDisplay.gotoAndPlay(3);
break;
case 2: livesDisplay.gotoAndPlay(4);
break;
case 1: livesDisplay.gotoAndPlay(5);
break;
}
I feel like there has to be an easier way to do this where I could just have a movie clip of a single orange dot that I could replicate across an x value based on the number of lives. Maybe the dots would be stored in an array? When the user loses a life, a dot on the right end of the line is removed.
So in the end the counter would look like this:
* * * * *
* * * *
* * *
* *
* (last life lost results in the end game screen)
EDIT: code based on suggestions by Zhafur and Arthur Wolf White
package {
import flash.display.MovieClip;
import flash.events.*;
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.display.Sprite;
import flash.text.*;
import flash.utils.getTimer;
public class CollisionMouse extends MovieClip{
public var mySprite:Sprite = new Sprite();
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
public var replacement:newSprite = new newSprite;
public var score:int = 0;
public var obstScore:int = -50;
public var targetScore:int = 200;
public var startTime:uint = 0;
public var gameTime:uint;
public var pauseScreen:PauseScreen = new PauseScreen();
public var hitTarget:Boolean = false;
public var hitObj:Boolean = false;
public var currLevel:Number = 1;
public var heroLives:int = 5;
public var life:Sprite;
public function CollisionMouse() {
mySprite.graphics.beginFill(0xff0000);
mySprite.graphics.drawRect(0,0,40,40);
addChild(mySprite);
mySprite.x = 200;
mySprite.y = 200;
pauseScreen.x = stage.width/2;
pauseScreen.y = stage.height/2;
life = new Sprite();
life.x = 210;
stage.addEventListener(MouseEvent.MOUSE_MOVE,followMouse);
/*mySprite.addEventListener(TouchEvent.TOUCH_END, onTouchEnd);*/
//checkLevel();
timeCheck();
trackLives();
}
public function timeCheck(){
addEventListener(Event.ENTER_FRAME, showTime);
}
public function showTime(e:Event) {
gameTime = getTimer()-startTime;
rm1_mc.timeDisplay.text = clockTime(gameTime);
rm1_mc.livesDisplay.text = String(heroLives);
}
public function clockTime(ms:int) {
var seconds:int = Math.floor(ms/1000);
var minutes:int = Math.floor(seconds/60);
seconds -= minutes*60;
var timeString:String = minutes+":"+String(seconds+100).substr(1,2);
return timeString;
}
public function trackLives(){
for(var i:int=0; i<heroLives; i++){
life.graphics.lineStyle(1, 0xff9900);
life.graphics.beginFill(0xff9900, 1);
life.graphics.drawCircle(i*15, 45, 6);
life.graphics.endFill();
addChild(life);
}
}
function followMouse(e:MouseEvent){
mySprite.x=mouseX;
mySprite.y=mouseY;
trackCollisions();
}
function trackCollisions(){
if(mySprite.hitTestObject(rm1_mc.obst1) || mySprite.hitTestObject(rm1_mc.obst2)){
hitObjects();
}
else if(mySprite.hitTestObject(rm1_mc.target_mc)){
hitTarg();
}
}
function hitObjects(){
addChild(replacement);
mySprite.x ^= replacement.x;
replacement.x ^= mySprite.x;
mySprite.x ^= replacement.x;
mySprite.y ^= replacement.y;
replacement.y ^= mySprite.y;
mySprite.y ^= replacement.y;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, followMouse);
removeChild(mySprite);
hitObj = true;
checkScore();
}
function hitTarg(){
addChild(replacement);
mySprite.x ^= replacement.x;
replacement.x ^= mySprite.x;
mySprite.x ^= replacement.x;
mySprite.y ^= replacement.y;
replacement.y ^= mySprite.y;
mySprite.y ^= replacement.y;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, followMouse);
removeEventListener(Event.ENTER_FRAME, showTime);
removeChild(mySprite);
hitTarget = true;
currLevel++;
checkScore();
}
function checkScore(){
if(hitObj){
score += obstScore;
heroLives--;
removeChild(life);
}
else if(hitTarget){
score += targetScore;
}
rm1_mc.scoreDisplay.text = String(score);
rm1_mc.livesDisplay.text = String(heroLives);
trackLives();
}
}
}
We're all aware that magic numbers (hard-coded values) can wreak havoc in your program, especially when it's time to modify a section of code that has no comments, but where do you draw the line?
For instance, if you have a function that calculates the number of seconds between two days, do you replace
seconds = num_days * 24 * 60 * 60
with
seconds = num_days * HOURS_PER_DAY * MINUTES_PER_HOUR * SECONDS_PER_MINUTE
At what point do you decide that it is completely obvious what the hard-coded value means and leave it alone?
Since the version 2.0, the ASP.NET documentation suggests that we should keep our connection strings in web.config. This raises a number of concerns. There is a better way...
One of the biggest asks from our customers over the years was to provide a way to prevent brute-force password attacks on the FTP service. On several of the FTP sites that I host, I used to see a large number of fraudulent logon requests from hackers that were trying to guess a username/password combination. My first step in trying to prevent these kinds of attacks, like most good administrators, was to implement strong password requirements and password lockout policies. This was a good first step...(read more)
Since the version 2.0, the ASP.NET documentation suggests that we should keep our connection strings in web.config. This raises a number of concerns. There is a better way......Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.
I have a project which uses a large number of LGPL, Artistic and other open-source licensed libraries. What's the canonical (i.e. the "standard") way of acknowledging multiple sources in a single project download?
Also, some of the sources I've used are from sites where using the code is okay, but publishing the source isn't. What's the usual manner of attribution in that case, and the usual manner of making the source available in an open-source project?
I want to place my items and enemies randomly (or as randomly as possible). At the moment I use XNA's Random class to generate a number between 800 for X and 600 for Y. It feels like enemies spawn more towards the top of the map than in the middle or bottom. I do not seed the generator, maybe that is something to consider.
Are there other techniques described that can improve random enemy placement on a 2d grid?
My desired result is change a file to root / from a N number of paths.
For example:
www.host.com/a/b/c/e/f/g/images/1.jpg, where A~G is not always given.
Result:
www.host.com/images/1.jpg
This is what I have so far:
www.host.com/a/images -- www.host.com/images
Using: RewriteRule ^a\/images/$ images/$1 [L]
What I need is a wildcard in front of /images/
Like this: RewriteRule ^*/images/$ images/$1 [L]
How can I do this correctly in .htaccess?
If you are just getting started with your online business one of the first and most important things you should be aware of is search engine optimization or "SEO" as it is commonly referred to on the Internet. Search engine optimization involves a number of steps that are necessary to ensure your business is found by your target audience and it will be the foundation upon which you build your online business.
Let's say I have a system. In this system I have a number of operations I can do but all of these operations have to happen as a batch at a certain time, while calls to activate and deactivate these operations can come in at any time. To implement this, I could use flags like doOperation1 and doOperation2 but this seems like it would become difficult to maintain. Is there a design pattern, or something similar, that addresses this situation?
In a talk about time management, a famous computer scientist said:
"One machine in your life is the right number."
He recommended a laptop with a docking station.
After trying this approach for about a month, I miss my more powerful desktop (i7 quad core hyperthread), but it is not in my technology road map (or budget) to upgrade from my old Intel Core 2 Duo (2006) notebook this year.
What strategies can help me use the desktop while at my desk and without much manual effort the notebook when I am on the go?
An Instant Site Creator is a piece of software that will allow you to create an unlimited number of websites with just a few mouse clicks. You can put up a new, professional looking site in minutes instead of hours or days, saving you both time and money. Here are five reasons you might want to use an instant site creator, or website builder software, instead of outsourcing the project or spending long hours doing it yourself
Consider the following client request “Please create a report for us to list expenses”. Which Oracle EBS tool would you choose? There are plenty of options available: Oracle Reports, or BI Publisher with PDF or Excel layout, or Discoverer, or BI Publisher Stand Alone, or PDF online generation, or Oracle WebADI, or Plain SQL*Plus as Concurrent Program, or Online review option … Assuming, you as development lead have to decide, you may decide by available skill set in your development team. However, is this a good decision? An important question to influence the decision is the “Why” question: why do you need this report, what process is behind, what exactly you like to achieve? We see often data created or printed, although it would be much better to get the data in Excel, and upload changes via WebADI directly. There are more points that should drive your decision: How many of such requirements you have got? Has this technique been used in the project already? Are there related reusable’s you may gain from? How difficult is it to maintain your solution? Can you merge this report with another one, to reduce test and maintenance work? In addition, also your own development standards should guide you a bit to come to a good decision. In one of my own projects, we discussed such topics in our weekly team meeting. By utilizing the team knowledge best, you may come to a better decision, and additionally, your team supports your decision. Unfortunately, I have rarely seen dedicated team trainings or planned knowledge transfer to support such processes. Often the pressure to deliver on time is too high to have discussion and decision time left. But exactly this can help keeping maintenance costs low by limiting the number of alternative solutions for similar requirements. Lastly, design decisions should be documented to allow another person taking this over easily. Decisions shall be reviewed and updated regularly, to reflect related procedures or Oracle products respective product versions. Summary: Oracle EBS offers plenty of alternatives to implement customizations. Create and maintain a decision tree to support the design process. Do not leave the decision just on developer side. Limit the number of alternative solutions as best as possible; choose one which is the most appropriate also from future maintenance perspective.
<b>Serverwatch:</b> "I have accounts on a number of Linux machines that I ssh into from my MacBook, using Terminal. On some -- but not all -- of them, I've found that if I run screen after connection, the backspace key is interpreted as a delete..."
Probably the worst nightmare internet marketers and even experienced SEO specialists encounter when they promote their websites on the web is the severe dropping of their websites rankings in Google. Now you may be in trouble if you are an SEO consultant, and you have a client, and he gets to know that his website has disappeared on the first page of Google when you've just told him a few days ago that his site landed on the number 1 spot of Google.
<b>Krebs on Security:</b> "A proposal to let Internet service providers conceal the contact information for their business customers is drawing fire from a number of experts in the security community, who say the change will make it harder to mitigate the threat from spam and malicious software."
Successful forms processing requires high accuracy for recognition rates. Using regular expressions permits the recognition engine to make assumptions on the number of expected characters to return, which improves recognition results. Read this paper to learn how to use them successfully.
The number of out of memory errors that have occurred within a rolling five minute window. If you just want to keep an eye out for any memory errors, you can watch the ring buffers for the Out of memory errors alert when it gets registered there.
Get alerts within 15 seconds of SQL Server issuesSQL Monitor checks performance data every 15 seconds, so you can fix issues before your users even notice them. Start monitoring with a free trial.
As many of you know, we've had the GlassFish party at JavaOne San Francisco for a number of years now. It's always a great opportunity to rub elbows with some key members of the GlassFish team, Java community leaders and Java EE/GlassFish enthusiasts. We are now extending that great tradition for the first time to JavaOne Latin America!
Come join us for free food, beer and caipirinhas at the Tribeca Pub in Sao Paulo on Tuesday, December 4 from 8:00 PM to 10:00 PM. Read the details and sign up here.
Anyone planning to be at Oracle OpenWorld? We're looking for Business Analysts who might be interested in participating in a Gamification Focus Group. If you are interested in participating, please contact Gozel Aamoth at [email protected]. We'd love to get folks interested in the topic to participate. There are also a number of other opportunities to give our Applications User Experience team some feedback on designs and concepts outside gamification.
In Test-Driven Development (TDD) , The writing of a unit test is done more to design and to document than to verifiy. By writing a unit test you close a number of feedback loops, and verifying the functionality of the code is just a minor one. everything you need to know about your class under test is embodied in a simple list of the names of the tests. Michael Sorens continues his introduction to TDD that is more of a journey in six parts, by discussing Tests as Documentation, False Positive Results and Component Isolation.
If you didn't already know Redgate have 2 full 1 day conferences planned Called " SQL in the City ", these being held @ the following 2 major cities London, UK on 15th July (Now Full with waiting list) Los Angeles, US on 28th Oct It is a full days’ worth of FREE SQL Server training sponsored by Redgate, you get the opportunity to attend a number of training sessions in the track of your choosing, along with the chance to network with your peers and interact with SQL MVP's, Redgate...(read more)