Click on any of the images below the see the description of that project. Links to the deployed project and the Github repository are in the description.
Education
Fullstack Academy | Flex Immersive Program | Jun. 2018 – Dec. 2018
University at Albany, SUNY | Computer Science, B.S. | Sept. 2009 – Dec. 2013
Contact Me
Escape ARoom
Escape ARoom is an augmented reality mobile game in which players solve a series of puzzles using clues presented as computer-generated objects in place of real-world markers.
Players can turn any room into an Escape Room. All they have to do is print out the markers, and set them up around the room. Once the markers are set up, the players point their camera at the markers, and an augmented reality image will appear on the screen.
Players work to explore the clues, and solve the puzzle as fast as possible. At the end of the game, the final time is displayed, so teams can compete to see who can escape the room the fastest.
ReactJack
Blackjack is a card game that pits player versus dealer. It is played with one or more decks of cards. Cards are counted as their respective numbers, face cards as ten, and ace as either eleven or one (in our game it will show on the counter as an 11 unless you are over 21). The object of Blackjack is the beat the dealer. This can be accomplished by getting Blackjack (first two cards equal 21) without dealer Blackjack, having your final card count be higher than the dealers without exceeding 21, or by not exceeding 21 and dealer busting by exceeding their card count of 21.
In Blackjack, or 21, the player must decide what to bet before the hand. Click the chips to add them to your bet. Click the chip again to remove it back to your pile of money. Once you click "deal" your bet is set, and two cards are dealt to the player face up and two cards are dealt to the dealer, one face up and one face down. You must then decide if you will "hit" (take another card from the deck), "stay" (keep the hand you are dealt), or "double" (you double your bet and are given only one more card). If the dealer has an Ace showing, you can click the "Insurance" button (this means you will place a bet worth half your hand bet, which will be paid out if the dealer has Blackjack but will be taken if the dealer does not).
Once the Blackjack hand is played out, three outcomes can occur. First you can win (as previously described), secondly you can lose (bust hand or have less than dealer hand), or you can push (have same hand - number count or Blackjack - as dealer). If you win, you get your bet money back PLUS that same amount from the dealer, YAY! If you win with Blackjack, you get your original bet back PLUS you win 1.5 times your bet from the dealer, WOOHOO! If you lose, the dealer takes your bet money. If you push, you keep your bet money but do not win anything additional.
JavaScript Breaker
JavaScript Breaker is based off the classic game Brick Breaker in which the player uses the paddle to keep the ball from touching the ground while destroying the bricks to make it to the next level. In addition, there are many different entities and power-ups that put a new spin on the classic game.
The game runs on the HTML canvas with the logic programmed in JavaScript. Each entity has its own physics and behavior that dictates the flow of the game. The game introduces brand new power-ups that differentiate it from the original game. Try to beat your high score in this simple, yet highly addictive, game.
Controller
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia neque assumenda ipsam nihil, molestias magnam, recusandae quos quis inventore quisquam velit asperiores, vitae? Reprehenderit soluta, eos quod consequuntur itaque. Nam.
Locked Safe
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia neque assumenda ipsam nihil, molestias magnam, recusandae quos quis inventore quisquam velit asperiores, vitae? Reprehenderit soluta, eos quod consequuntur itaque. Nam.
Submarine
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia neque assumenda ipsam nihil, molestias magnam, recusandae quos quis inventore quisquam velit asperiores, vitae? Reprehenderit soluta, eos quod consequuntur itaque. Nam.


--- layout: page title: "Resumable Uploads for HTTP" description: "HTTP clients often encounter interrupted data transfers as a result of canceled requests or dropped connections. Prior to interruption, part of a representation may have been exchanged. To complete the data transfer of the entire representation, it is often desirable to issue subsequent requests that transfer only the remainder of the representation. HTTP range requests support this concept of resumable downloads from server to client. This document describes a mechanism that supports resumable uploads from client to server using HTTP." ---
| Document Name: | Internet Draft draft-ietf-httpbis-resumable-upload |
|---|---|
| Document URI: |
urn:ietf:id:draft-ietf-httpbis-resumable-upload
|
| Online Version: |
https://datatracker.ietf.org/doc/html/draft-draft-ietf-httpbis-resumable-upload
|
| Organization: | Internet Engineering Task Force (IETF) |
| Series: | Internet Draft (I-D) |
| Abstract: | HTTP clients often encounter interrupted data transfers as a result of canceled requests or dropped connections. Prior to interruption, part of a representation may have been exchanged. To complete the data transfer of the entire representation, it is often desirable to issue subsequent requests that transfer only the remainder of the representation. HTTP range requests support this concept of resumable downloads from server to client. This document describes a mechanism that supports resumable uploads from client to server using HTTP. |
Upload-Incomplete
,
Upload-Offset
Return to ( Series | Organization | all Specifications )


| 018:031 Khan | : |
These! For them will be 'Adn (Eden) Paradise (everlasting Gardens); wherein rivers flow underneath them, therein they will be adorned with bracelets of gold, and they will wear green garments of fine and thick silk. They will recline therein on raised thrones. How good is the reward, and what an excellent Murtafaqa (dwelling, resting place, etc.)! |
| 018:031 Maulana | : |
These it is for whom are Gardens of perpetuity wherein flow rivers; they are adorned therein with bracelets of gold, and they wear green robes of fine silk and thick brocade, reclining therein on raised couches. Excellent the recompense! And goodly the resting-place! |
| 018:031 Pickthal | : |
As for such, theirs will be Gardens of Eden, wherein rivers flow beneath them; therein they will be given armlets of gold and will wear green robes of finest silk and gold embroidery, reclining upon throne therein. Blest the reward, and fair the resting-place! |
| 018:031 Rashad | : |
They have deserved gardens of Eden wherein rivers flow. They will be adorned therein with bracelets of gold, and will wear clothes of green silk and velvet, and will rest on comfortable furnishings. What a wonderful reward; what a wonderful abode! |
| 018:031 Sarwar | : |
They will be admitted to the gardens of Eden wherein streams flow. They will rest on soft couches, decked with bracelets of gold and clothed in green silk garments and shining brocade. How blissful is such a reward and resting place! |
| 018:031 Shakir | : |
These it is for whom are gardens of perpetuity beneath which rivers flow, ornaments shall be given to them therein of bracelets of gold, and they shall wear green robes of fine silk and thick silk brocade interwoven with gold, reclining therein on raised couches; excellent the recompense and goodly the resting place. |
| 018:031 Sherali | : |
It is these who will have Gardens of Eternity underneath which streams shall flow. They will be adorned therein with bracelets of gold and will wear green garments of fine silk and heavy brocade, reclining therein upon raised couches. How good the reward and how excellent the place of rest ! |
| 018:031 Yusufali | : |
For them will be Gardens of Eternity; beneath them rivers will flow; they will be adorned therein with bracelets of gold, and they will wear green garments of fine silk and heavy brocade: They will recline therein on raised thrones. How good the recompense! How beautiful a couch to recline on! |
Concepts/Themes Covered: الإيمان > الإيمان بالله > حقيقة الإيمان Faith> Belief In Allah> The Reality of Faith الإيمان > الغيب > الجنة > أسماءالجنة > جنات عدن Faith> The Unseen World> The Paradise> Paradise Names> Adn Paradise الإيمان > الغيب > الجنة > أصحاب الجنة Faith> The Unseen World> The Paradise> The Companions of the Garden الإيمان > الغيب > الجنة > صفات الجنة Faith> The Unseen World> The Paradise> Characteristics of Paradise الإيمان > المؤمنون > ما أعده الله لهم Faith> The Believers> What has Allah Prepared for them الإيمان > المؤمنون > وعده إياهم Faith> The Believers> His Promise to them
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


--- layout: post title: Conditional SwitchTower Configuration post_id: 204 categories: - tips & tricks date: 2005-08-27 12:59:00.000000000 -06:00 author: Jamis permalink: 2005/8/27/conditional-switchtower-configuration.html ---
The SwitchTower configuration language does not, by itself, support multiple configurations in the same recipe file. That is to say, SwitchTower does not provide a way to say “in this circumstance, this machine is an app server, and in this other circumstance, this other machine is an app server.”
However, because the recipe files are simply Ruby scripts, you can take advantage of Ruby’s control structures to differentiate between multiple configurations based on (for instance) an environment variable:
1 2 3 4 5 6 7 |
if ENV["STAGE"] == "production" set :deploy_to, "/var/www/prod" role :app, "prod.example.com" else set :deploy_to, "/var/www/dev" role :app, "dev.example.com" end |
Then, you could just do:
1 |
STAGE=production switchtower -r config/deploy -a deploy |
Coming soon, SwitchTower will support setting variables directly from the command line, so you could set the variable via some -s
switch, and then query the variable in the recipe file.


The Loxberry has no Real Time Clock onboard. The current time is not known after a Power loss or reboot. That's why we need to update the system time after a reboot. For some functions it's very important that the Loxberry and Miniserver Time is synchronized (e. g. for Statistics or Troubleshooting).
Luckily the time must not be set by hand every time :-) The Loxberry provides two possibilities to obtain the exact Time: Either using a direct adjustment with your Miniserver (recommended!) or using an Internet-Time Server (NTP Server).
We recommend the direct adjustment with your Miniserver because this ensures the identical time on both devices. Furthermore no Internet connection is needed. As the Miniserver itself synchronizes the time using an Internet-Time Server we can assume that the time on the Miniservers (and therefore the Loxberry Time, too) are exact.


Doge Social Network
Home
Profile
Friends
Friends of Doge
Such Friends
best friends
Many Friends
unknown
Wow
yeah, right


| ${columnNames.map(name => F`${{key:`col${name}`}} | ${name} | `)}
|---|---|
| ${rowName} | ${schedule(columnNames, async colName => { const key = `${colName}${rowName}`; /** DON'T do this /* setting state within a render will cause /* unnecessary re-renders as well as race-condition errors if ( ! cell[key] ) { cell[key] = {key, formula: '', value: ''}; } **/ return await F`${{key}}`}, {batchSize: 5})} |
You can use syntax like = a1 * b2
. All regular JavaScript syntax and Math
functions work.


Mindfulness Coach is a mobile phone application for Veterans and Service Members to learn and practice mindfulness skills. It is intended to help build this important skill for those who would like to build their resilience and manage their lives and emotions better.
This application provides:
It can be used on its own by those who would like mindfulness tools, or to augment face-to-face care with a healthcare professional. It is not intended to replace therapy for those who need it.


Download Latest Bootcamp Drivers Apple Community
How To Use Apple Software Update For Windows Apple Support
Download And Install Windows Support Software On Your Mac Apple Support
Bootcamp Does Not Work Apple Community
Windows 10 Bootcamp Error Apple Community
Bootcamp Windows Support Software Save E Apple Community
Apple Software Update Will Not Let Me Upd Apple Community
Bootcamp Assistant Can T Install The Sof Apple Community
Boot Camp Official Apple Support
Download Boot Camp Support Software 5 1 5769
Apple Adds Windows 10 Support To Boot Camp For All Macs From 2012 Present Ars Technica
Bootcamp No Iso Option Ask Different
Apple S New Arm Based Macs Won T Support Windows Through Boot Camp The Verge
Bootcamp Failed To Install Windows 10 Pro Apple Community
Can T Install Windows Support Software While Updating Boot Camp Drivers Super User
How To Install Windows On A Mac Boot Camp Vs Vms For Running Windows Macworld Uk
Install Windows 10 On Mac Using An External Ssd Video 9to5mac
Boot Camp Software Wikipedia
Boot Camp Mac Download
Guide Manually Save Windows Support Software After Bootcamp Errors Please Read Macrumors Forums
How To Download Boot Camp Windows Support Software For Windows To Go
Https Encrypted Tbn0 Gstatic Com Images Q Tbn And9gcq5ovt1k3t2iiygoyzejkzizmz3nldqegq5fr1tqic Usqp Cau
Trackpad Driver For Mac Bootcamp Fasrgeta
Bootcamp 6 1 9 Bootcamp Egpu Setup
Apple Silicon Macs Will Not Support Windows 10 Via Boot Camp Here Is Why It Is Not A Big Deal Technology News
Macbook Laptops With M1 Processor Support Crossover 20 To Run Windows Apps Technology News
Download Boot Camp For Windows Towerfasr
How To Run Windows On A Mac Pcmag
How To Install Windows 10 On Your Mac Using Boot Camp Assistant Video 9to5mac
Installing Windows 7 On Your Mac Using Boot Camp


{% extends "base.html" %}
{% from 'products/includes/product_macros.html' import product_cards with context %}
{% set title = _('Products') %}
{% set crumbs = [(None, title)] %}
{% set styles = ('products',) %}
{% block content %}
{{ title }}
{{ product_cards(products) }}
{% endblock %}


All Pass Library
a =
Add
a = 2 + 2j
a = 2 - 2j
a = 1 + 2j
a = 2 + 1j
New Pole
New Zero
clear zeros
clear poles
clear All
add Conjugates
with all Pass filters


{{SUBJECT Article request}}
Dear {{name}},
A {{profession}} is interested in reading your article, {{title}}, but is unable to access it. {{fullname}} told us that "{{story}}".
By sharing your article you'll help {{fullname}}, but it could also increase the impact of your research. Articles that are openly available benefit from greater citations, more readers, and a host of other benefits. Many researchers are unsure if they can legally share a copy of their articles. We have good news! All major publishers permit either archiving the submitted or accepted version to a repository. You can check your journal policies in SHERPA/RoMEO.
You can make your article publicly available by uploading it, or providing a URL if it is already available. You can do both here.
If you have any questions just reply to this email. We'd love to hear from you.
Kind Regards,
Natalia
Open Access Button Request Manager
Learn more about the Open Access Button, a tool connecting people to the research articles they need. You're receiving this email because an Open Access Button user requested access to research you are an author of. If you'd like to stop receiving emails from Open Access Button, you can let us know.


Reports loops that cannot be completed without an index overflow or loops that don't loop at all.
It usually happens because of a mistake in the update operation.
Example:
void foo(int s) {
for (int i = s; i > 12; i++) { // i-- should be here
System.out.println(i);
}
}


BlitzBasic is a tool that was originally created for the Amiga a long long time ago in a galaxy...well, it was this galaxy, but anyway. The idea was to create a really powerful game engine that had a simple programming interface. This concept is now being moved from the Amiga to the PC, and it's sweet!
Currently, BlitzBasic supports 2D graphics only, but a 3D version is being built and is due out in the next few months. The engine works with DirectX 7.0 or higher and sports the following features:
I've been messing with this language for roughly 2 days now and I gotta say that this is one of the coolest toys I've played with. It's simple to use, but it still requires that YOU program your game. Basically, you still have to handle the AI, physics, game-play mechanics, balancing issues, level controls, hit points, modifiers, etc...the only thing you no longer have to worry about is working with DirectX.
In order to follow along, you'll need to download the latest version of BlitzBasic and you'll need to have DirectX 7.0 or higher. You can get BlitzBasic by going to the BlitzBasic Website.
Quick note, I'll likely use "BB" in place of writing "BlitzBasic" everywhere...so now you'll know what that means ;)
Okay, I'm going to show you how simple this really is. This little piece of source will setup the graphics mode, display a .bmp image and allow you to move that image all over the screen with your mouse.
Save the following image to the folder you have created for saving your BlitzPlus projects before trying the following code.
; Setup our constants Const g_ScreenWidth=800, g_ScreenHeight=600 ; Call the BB "Graphics" routine to initialize DirectX Graphics g_ScreenWidth, g_ScreenHeight ; Set up BB to support page-flipping SetBuffer BackBuffer() ; Create a global var for the Player's Image Global g_PlayerImage ; Create globals to keep track of the mouse positions Global g_OldMouseX=1, g_OldMouseY=1 ; Create a Type (which is just like a C/C++ Struct) Type MainShip Field x#,y# End Type ; Create an object of MainShip, called Ship Ship.MainShip=New MainShip ; Set the x,y for the Ship Ship\x#=1 Ship\y#=1 ; Call BB's LoadImage function to load the .BMP ; Make sure you put the proper path to the .BMP! g_PlayerImage=LoadImage( "player.bmp" ) ; Our main game loop is here. ; While the ESC key is not pressed While Not KeyHit(1) ; If mouse position isn't the same as last loop ; update the x,y coords for the ship If g_OldMouseX<>MouseX() Or g_OldMouseY<>MouseY() ; update the x coord for the ship placement Ship\x#=MouseX() ; update the y coord for the ship placement Ship\y#=MouseY() EndIf ; Save the current mouse x,y g_OldMouseY=MouseX() g_OldMouseY=MouseY() ; Call BB's DrawImage function to put the ship ; up in the proper spot DrawImage g_PlayerImage, Ship\x#, Ship\y# ; Call BB's Flip function to flip the pages Flip ; Clear the back buffer Cls ; end of our main loop Wend ; free the Ship Oject Delete Ship ; End of the program End
Now I'm sure there are a few things that may look a bit odd, so let me explain.
First off, you use a ";" as a comment indicator. It will consider anything after that character a comment for the rest of that line.
Secondly, you'll notice that in the Type section there is a Field command. This command basically instructs the Type that this is a piece of it's element. You can put different vars and such in here.
Third, what's with that # next to x and y? Well, that little jobbie basically tells BB to use floating point. Thus, we can put x#=1.99834, which we couldn't do without the #. You won't get an error if you try, but everything after the decimal is dropped.
Finally, where C uses -> for struct references, BB uses a \. So when you see Ship\x=1, think Ship->x=1. For those of you who don't know C, think of the \ as pointing at the x. So, Ship\x=1 is basically saying, "make the value x, that sits inside the Type Ship, equal 1". I guess another way to look at is as Type Ship is a directory and x is a sub-directory within it. In order access that directory in DOS, you would have to type in the old CD ship\x...that might help you DOS-types (and Unix types, just flip the / in your world to \ ;)).
The first time you sit down and look at someone else's code it looks like Greek. Now, if you happen to read Greek, well, then pick a language you don't know and replace Greek with that. :)
The intent of this article is to help you understand the fundamentals of the BB language and it's syntax.
One of the things that a lot of people do (assuming they're conscious that others will be looking at their code) is comment that code. This is an extrememly important thing to work into your daily programming life because you or someone else will eventually have to study your code.
I can't stress the importance of commenting enough, but most people only learn to do it after they've had to go back and fix something 6 months after they thought it was complete. When you're looking at the code on a daily basis, it makes perfect sense to you. But take a week away and you'll be kicking yourself for not commenting appropriately.
"Okay, Captain Spanky, so how do I comment?" Simple! All you need to do is use a semi-colon. Anything after a semi-colon (to the end of the line) will be considered a comment by BB and will NOT be compiled into your code. So, it's for your reference only. Comments will not increase the size of your finished application and they will not slow your application down in the least.
Here's a few examples of comments:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Commenting code demo! ;; Developed by: Krylar ;; Last Revision: 10/09/2000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Let's create our constants here Const kSpacebar = 57 ; Holds the scan-code of the keyboard's spacebar ; Let's create out global variables here Global iShields = 200 ; Holds the current shield power Global iArmor = 100 ; Holds the current armor power
Note that at the top I put a little information on the program. This isn't 100% necessary, but it's sometimes nice to keep track of things like this. Usually that section is useful for explaining what the program is made to do. Also, you may notice that I got a little creative with the semi-colons...making a little box-like thing around that program info. That's just a habit of mine ;)
Second thing is that I seperate each major section with a space and a comment. I do this just to keep things organized. That's why the "global" variables section sits apart from the "constant" values section.
Finally, I put a comment to the right of each constant/variable created so I can define exactly what each one is for.
Now this example shows some pretty detailed commenting, but that's only so I could demonstrate the various comment options. If your variable names are done smartly, a lot of this commenting will be unnecessary. For example, it's pretty obvious what the iShields and iArmor are all about, no?
Whenever you program, you'll need to use a set of "commands" that the language supports. Each command has it's own "syntax", or rules for use, that you must follow in order to make the command do it's job properly. Generally, but not always, this syntax includes the use of "arguments".
An argument is simply a value that you send along with the command. For example, let's say that we are using the Graphics command in BB. For this command to work properly, we'll need to tell that command what resolution we want our graphics mode to be. Games can support many resolutions, everything from 320x200 up to 1280x1024. Most games nowadays support 640x480, 800x600, and 1024x768.
So, since we need to tell the Graphics command which one we want to use, we'll need to "pass it arguments". Here is how it would look for us to set up an 800x600 resolution.
Graphics 800,600
That's it! Super simple ;) Now, you *can* also request that command to set up the "color depth", which how many colors to make that resolution support. I personally wouldn't recommend this though since BlitzBasic will grab what it feels is the best color depth for you.
There are tons of BB commands and I'm not going to cover them all here, but I am going to cover a few that are key to developing a simple application. The commands I'll cover are:
Graphics: This command is the heart and soul of BB. Without this command, it's almost pointless to press "Run". You can do some stuff without it, like writing to files and such, but it'll be necessary if you want to create anything that outputs to the screen.
Use Graphics to set up the video mode (resolution) that you want to use with the game. Examples would be 640x480, 800x600, 1024x768.
While...Wend: This is a combination command. This combination allows you repeatedly run all the commands sitting between the While and the Wend until the condition set in the While section is met. This is also known as a "Loop". Here's an example...this will not work if you enter it AS IS in BlitzBasic. Later though I'll be using this combination command in a program to show you how it's used. For now, just study this piece:
iCounter = 1 ; create a local variable called iCounter ; If iCounter is less than 10 While iCounter<10 Print "Hello!" ; print out Hello iCounter = iCounter + 1 ; Add one to the current value of iCounter Wend
So, what this will do is continue running through that While...Wend Loop until iCounter, which is being added to each time, is greater than or equal to 10. So, it will print "Hello!" ten times on the screen...unfortunately it will print it over top of itself, so it's quite anti-climatic.
If...Then...Else...Endif:
This is probably one of the most utilized command sets when coding. It basically allows you to check a condition and do something if that condition is valid. So, let's say you only wanted to print a score if it's greater than 0 points. You would go:
If iScore>0 Then Text 200,200, "Score = "+iScore EndIf
As you can see, if iScore is less than or equal to zero nothing will be printed!
Now, let's say that you wanted to print the score if it's greater than zero, but you still want to print something if it's not. You would do this:
If iScore>0 Then Text 200,200, "Score = "+iScore Else Text 200,200, "No Score Yet!" EndIf
This basically says that if our score is greater than 0, print out the score. Else (or, otherwise) print out "No Score Yet!".
There is one other thing I want to touch on with this command set, and that's nesting. Nesting basically means "having Ifs within Ifs". Here's an example:
If iScore>0 Then Text 200,200, "Score = "+iScore Else If iScore<0 Then Text 200,200, "You're in the Negatives!" Else Text 200,200, "No Score Yet!" EndIf EndIf
This one does *almost* the same thing as the last one. The primary difference is that when the score is NOT greater than 0, we check to see if it's LESS than 0. If so, we print "You're in the Negatives!"...Else we print "No Score Yet!". So, here's the table for that:
iScore > 0, so print "Score = " and then the score
iScore < 0, so print "You're in the Negatives!"
iScore = 0 (since it's neither greater than, nor less than, 0), so print
"No Score Yet!"
Text:
This command has been used throught my little code snippets above. What this does is tells BB that you want to print out text at a certain location on the screen. The arguments passed are:
You can also set this command up to control whether or not to center the line on the X, Y axis or not. To do so, you would use the optional arguments "centerX" and "centerY". Here's what a centered version would look like:
Text 200,200,"Hello, World!",1,1
One other thing to note is that you can add a variables value to the text by using a "+" sign and the variable. Here's an example:
iAge = 32 Text 200,200,"Hello, World! I'm "+iAge+" years old!", 1, 1
This will print out, "Hello, World! I'm 32 years old!".
Cls:
This command requires no arguments. It simply clears the screen. Yep, that's it!
Now, you can use it's sister function, ClsColor to clear the screen with a specific color. In order to do that, you would have to provide the Red, Green and Blue color arguments (all numbers between 0 and 255). The default is 0, 0, 0. Here is some code:
Cls ; standard clear screen...clears it to black ClsColor 255, 255, 255 ; since red=255, green=255 and blue=255...it will clear to white
You can use almost any paint program to find out the various RGB (Red, Green, Blue) values.
End:
This is not a completely necessary command to use, but if you don't use it you'll end up getting a windows dialog box that explains the program has ended. Plus, I don't know what it will do if you have a compiled version of your code. So, just to be safe I include it at the end of the main While...Wend loop.
All this command does is instructs BB to shut everything down and return control to Windows.
Okay, now to tie all this together, here is a simple program that moves "Hello, World!" across the screen over and over until you hit the ESC key. Something to note is that this WILL flicker as it flies across the screen. This is because we're not using a good animation technique (which I'll get into in a future article)...this is to demonstrate our commands only.
Pay CLOSE attention to the comments here!
; Call the BB "Graphics" routine to initialize our graphics mode Graphics 800, 600 ; declare a global variable to keep track of the x ; position of our text Global iX=-120 ; declare a global variable for our y position Global iY=0 ; keep doing this piece until the ; user hits the ESC key While Not KeyHit(1) ; clear the screen Cls ; print the text at our current iX, iY location Text iX,iY,"Hello, World!" iX = iX + 1 ; add 1 to the current value of iX ; check to see if the value in iX is greater than 800 ; (which is our screen resolution) If iX > 800 iX = -120 ; it is greater, so reset the value EndIf Flip Delay 3 ; tell BB to delay for 3 milliseconds Wend End ; Give control back to Windows
Enter the above program into BlitzBasic and run it...it ain't fancy but it's a start! Also, play around with the iX values and the value after the Delay command to see what kind of wackyness you can create! ;)
This article deals with the little containers known as "variables".  If not, try this definition out:
A variable can be thought of as a container, much like Tupperware. Inside the container sits almost anything you want; counting numbers, characters, decimal (or floating-point) numbers, image data, etc. You give the container a name, preferably something that's understandable and clearly identifies the variables purpose, and then you put values in it.
When you first see a variable, it can look a little confusing. It's actually very simple though. All you do is create a name that makes sense, tell BB what kind of variable it is, and assign a value to it.
For example, here's what a numeric variable looks like in code:
iNumber = 200
Now the variable iNumber holds the value 200. So instead of entering 200 throughout your program, you can simply use iNumber. This is important because you may need to change the value held in iNumber dynamically...something you'll have a really tough time doing without using a variable. We'll get into examples in a bit...for now, let me explain the different variable types used by BlitzBasic.
To best describe each, I'll show the source for them and then pick them apart.
iNumber
iNumber% = 200
fNumber# = 200.125
sText$ = "Hello!"
The first two, iNumber and iNumber%, do effectively the same thing. It's just that the default variable is considered an integer (or real number) so the % isn't necessary. Also, notice that there is no value assigned to the first iNumber. You don't have to assign a value when you declare the variable...it's usually best if you do, but it's not necessary.
The third line, fNumber# = 200.125, uses the # to tell BB that we want this variable to be of type floating point.
Finally, sText$ uses the $ to tell BB to treat this variable as a string. A string, sometimes called a "scalar", is simply a collection of characters.
Now you may be wondering at my choice of variable names. Since I like to be able to look at a variable and immediately know what it's for and what type of variable it is, I use a little naming convention. I put a lower-case "i" for integers, "f" for floating point(I'll also use a "d" for this sometimes because in C I use doubles, which is similar to floating point), and "s" for string (or character) variables. From there I add a descriptive name to the variable. Also, if the variable is more than one word, I capitalize each word. Here are some examples:
iNumberOfHitPoints = 125 iShieldValue = 100 iArmorValue = 50 fShipVelocity# = .500 fShipBrakingSpeed# = .250 sShipName$ = "Kliaziaan Warhawk" sPlayerName$ = "Krylar"
There are two types of variables in BB, global and local. A global variable is one that is available to the entire program. This means that any function within the program can not only read the contents of that variable, but can also change that value.
As you may have guessed, a local variable is one that is only available to the function in which it is defined.
Here's an example of a global variable called iSpacebarHits. This program simply increases a value each time the spacebar is pressed, and displays the new value to the user. Note that until you hit the spacebar, the screen will remain blank. Here's the code:
; Call the BB "Graphics" routine to initialize the graphics mode Graphics 800, 600 ; Set up our GLOBAL value Global iSpacebarHits = 0 ; keep doing this piece until the user hits the ESC key While Not KeyHit(1) ; if the user hits the Spacebar If KeyHit(57) Then ; clear the screen Cls ; call the function that adds to the iSpacebarHits variable AddToSpacebarHits() ; print out the value of iSpacebarHits Text 400,300,"iSpacebarHits = "+iSpacebarHits,1,1 Flip EndIf Wend End ; this is a function for increasing the iSpacebarHits variable by one Function AddToSpacebarHits() iSpacebarHits = iSpacebarHits + 1 End Function
This program only works because we declared the iSpacebarHits variable as global, if you change that declaration to local you won't see your output go past 0.
You may be wondering why you'd want to use local variables at all. The reason is that you will often want to do calculations within a function but don't want to have all that function's data known to the rest of the program.
For example, let's say that each time the spacebar is pressed we wanted to find a random number between 1 and 5 to add to the iSpacebarHits value. It wouldn't hurt to have this value as a global, but it wouldn't help either (unless you're using it for more than one function). So, if you are just going to use a variable in the function and it doesn't need to be available to the rest of the program, just make it local.
Another reason is that having too many global variables can make your code quite confusing to others who are working with it. Also, it can be very confusing to you in the future if you have to revisit it for some reason.
So, here's that source code again, but using that Random number idea with a local variable (again, you'll get a blank screen until you hit the spacebar):
; Call the BB "Graphics" routine to initialize the graphics mode Graphics 800, 600 ; Set up our GLOBAL value Global iSpacebarHits = 0 ; keep doing this piece until the user hits the ESC key While Not KeyHit(1) ; if the user hits the Spacebar If KeyHit(57) Then ; clear the screen Cls ; call the function that adds to the iSpacebarHits variable AddToSpacebarHits() ; print out the value of iSpacebarHits Text 400,300,"iSpacebarHits = "+iSpacebarHits,1,1 Flip EndIf Wend End ; this is a function for increasing the iSpacebarHits variable by a random number Function AddToSpacebarHits() ; define our local variable Local iRandomNumber=0 ; call BB's Random number function, asking for a number between 1 and 5, ; and put that value into iRandomNumber iRandomNumber = Rand(1,5) ; Add iRandomNumber to the current value contained in iSpacebarHits iSpacebarHits = iSpacebarHits + iRandomNumber End Function
Two things that most every game will have are Arrays and Types. You can use them for lots of stuff...keeping track of the player's screen coordinates, hit points, shield reserves, bullets fired (and keeping track of those bullets), sprite images, etc.
There's a lot of conflict over which method is the better to use for things, but most folks are coming around to using Types more often than Arrays. This is not to say that Arrays don't have their place, they do! But for speed, ease of use, and freedom from limitations (aside from memory, of course), Types will likely be the choice of most folks.
This article will show the fundamentals of both Arrays and Types in order to get you started with them.
It's recommended that you download the source code so you can see all this in action.
Using Arrays is quite easy in BB (as most things are). You simply determine a type of value that you wish to store, dimension (set limits) an array type and load up the values. Here is some source to demonstrate the basics of setting up an array:
; Tell BB that we want an array called "DataX" to hold 3 integers Dim DataX(3) ; go through a loop and fill the array "DataX" with the values ; of the loop. For x = 0 To 3 DataX(x) = x Next
To access the elements of an array is just as simple as loading it. You can either run through a loop and gather all the elements (or ones based on a certain criteria), or you can target a specific element. Here is an example of both that uses the information from the above example:
; set up a variable that keeps track of where the "Text" command will draw ; on the Y axis txty = 0 ; go through a loop and print out the values in the "DataX" array For x = 0 To 3 Print DataX(x) Next ; add up the 1 and 3 element of the array "DataX" iValue = DataX(1) + DataX(3) ; print out iValue using the Y axis variable (txty) for placement Print "iValue = "+iValue
Before going any further, there is a little tricky piece that gets most people starting out in programming. Computers don't exactly count like we do. If someone was to ask you to count to 10, you'd go <IP_ADDRESS>.<IP_ADDRESS>.9.10, right? Well, computers would sorta do that to, but they'd start with 0 instead of 1. Kooky, eh? What this means is that when you reference your arrays, you'd better make sure that you're starting with the computer's idea of the first element and not your idea. Otherwise, you'll get some strange results.
So, in the above program when I put the comment "add up the 1 and 3 element...", I was being literal. If I had said "add up the first and 3rd element of the array...", the line of code following would have looked like this:
; add up the first and 3rd element of the array "DataX" iValue = DataX(0) + DataX(2)
This is also why you'll see nearly all for loops start from 0. Just something you'll want to grasp now before it bites ya ;)
Arrays aren't limited to integers. You can use strings and floats and such...heck, you can even have an array of Types if you want. So, flex your Array muscles and try loading up different things!
Types, like Arrays, allow you to hold elements. Unlike Arrays, Types allow you to hold various kinds of elements within a single Type and there is no pre-set limit.
For example, let's say that you wanted to hold information on a ship. You want to know the name of the ship, what the current X and Y coordinates are, the shield points left, the armor points left, and the type of weapon the ship currently has. Using a Type this is simple! Here's what you'd do.
Type Ship Field ShipName$ Field iX,iY Field iShieldPoints Field iArmorPoints Field iWeaponType Field iAlive End Type
Now that Type, called "Ship", will allow all that stuff to be stored for each ship! From here you would need to create a New element of Type "Ship". You can add as many of these elements as your computer's memory will allow. As an example, here is how we could add one...let's use the Player's ship:
PlayerShip.Ship = New Ship PlayerShip\ShipName$ = "Kliazian Warbird" PlayerShip\iX = ScreenWidth / 2 PlayerShip\iY = ScreenHeight / 2 PlayerShip\iShieldPoints = 100 PlayerShip\iArmorPoints = 50 PlayerShip\iWeaponType = 1 PlayerShip\iAlive = 1
What we just did was populate the elements in the "PlayerShip" element of Type "Ship". The beauty of this is that we can now add enemy ships, or ship information from multiplayer connections, etc. They can all use this same Type!
For enemy ships, though, I'd recomment naming the element differently. I would call it "EnemyShips" or something to that effect. This helps ensure that you won't be confused when going through your code at a future date.
The next cool thing is that we can update each element in the Type by going through a special kind of For loop that BB has for Types. It allows the Each command. To demonstrate how it looks, here is an example that updates all the enemy ship locations:
For EnemyShips.Ship = Each Ship EnemyShips\iX = EnemyShips\iX + iDirectionX EnemyShips\iY = EnemyShips\iY + iDirectionY Next
That's it. It goes through each "EnemyShips" element and makes changes to the current X,Y for that element. I'm using the variable iDirectionX just as an example. This would likely be something that included speed and such so the ships could all move at different rates...don't want it to look like everything is in perfect order!
If you blow up an enemy ship, you're going to want to remove it from the EnemyShips element. To do that all you have to do is use the BB Delete command. The following code looks for any EnemyShips element that has the "iAlive" flag set to 0, and delete's it accordingly:
For EnemyShips.Ship = Each Ship If EnemyShips\iAlive = 0 Delete EnemyShips EndIf Next
Study the files in the zip file for this tutorial and you'll see that I have put up some rocks on the screen. There are Array and Type versions of these programs so you can compare the code, speed, etc.
Currently the rocks move in only one direction (SE) and they don't spin or anything. I would recommend that you use the image rotation information in previous tutorials to rotate the rocks and then add a field to the "Rocks" Type called "iFrame". Each time you update the X,Y coordinates, update the frame too. You'll probably also want to mess with the timer functions on this so you can avoid the rocks spinning too quickly...I'll touch on the timer a bit in the next tutorial, but see if you can figure it out ahead of time ;)
You'll note that I'm starting to leave more exploring up to you rather than spelling out each detail. This is intentional. I'm doing this so you'll study the code and get used to seeing things in action. Also, I'm hopeful that you'll take that code and do some more stuff with it. Anything that is really difficult, I'll try to get into detail on...but most of these items are building blocks from other things we've touched on already so they shouldn't give a brain freeze :)
Anyways, play around and experiment...most importantly, have fun!
 Doing this with DirectX and C can be a real pain to figure out on your own, but fortunately BB saves us a lot of headache!
This article will touch on simple loading of images to more complex tiling and parallaxing effects. It's recommended that you download the source code so you can see all this in action.
Loading an image, like say a splash screen, is quite simple. All you need to do is define a variable to point to the image, call the LoadImage function, check to make sure the image was loaded successfully (optional, but recommended), and then use DrawImage to display it. Here's a piece of sample code that does just that (source is in "loadimg.bb"):
; Initialize BB to run at 800x600 Graphics 800,600 ; Load the KrylarLogo.BMP file and point to it with the variable "imgKrylarLogo" imgKrylarLogo = LoadImage("graphics\krylarlogo.bmp") ; See if the image was loaded successfully (the "imgKrylarLogo" will be 0 if not) If imgKrylarLogo = 0 Then Text 100,100,"Invalid Image!" ; tell the user it was invalid if 0 Else DrawImage(imgKrylarLogo,250,100) ; otherwise, draw the image around the center EndIf ; wait for the user to press a key WaitKey ; end the program, return control to Windows End
One of the things that a lot of games do is have a 2D graphic that rotates around it's mid-point. For example, let's say that you're making a 2D space game (why not, everyone does!). You could make your player's ship by: a) drawing it at all the different angles by hand (ouch!), b) drawing it facing straight up and then use your graphics program to rotate each frame and then place the frames together (not too bad), c) draw it facing straight up, have BB load it and do all the rotations for you (ah...that's better).
Now this method isn't going to work in all situations. If, for example, you had the same image that either changed sizes real-time or had different light-sourcing depending on the angles (and that light-sourcing was not dynamic), you couldn't use this method. But I've used this for a number of demos and games without hesitation.
Just like the previous example, you're going to need to load the image you want to rotate and you're going to need a variable to point to it. From there, you'll use a combination of the CopyImage command and the RotateImage command. You may also need to use the MaskImage command if you have a mask color that is not black. Also, you should set BB's AutoMidHandle to True. This will ensure that your images are rotated at their center point. If you don't do this your images will rotate around the the top-left corner (at least that's what it looks like to me). Try yanking out the AutoMidHandle True section of the source to see what I mean.
Side Note: A mask color is used to tell BB NOT to draw any pixels (dots on the image) of that color. This is so your image will appear transparent. You wouldn't want to have this cool looking ship drawn with a big black rectangle all around it, so you'll need to tell BB to not draw certain colors. The default for transparency is black (or Red=0,Green=0, Blue=0), but a lot of people use a really ugly color (like bright magenta) to ensure they won't accidently use the transparent color as part of the actual art.
Even though the image I'll be loading will use black as the mask, the following source code will use the MaskImage function for demonstration purposes. Here's the code (source is in "loadimgrt.bb"):
; Initialize BB to run at 800x600 Graphics 800,600 Const iNumRotations=36 ;how many rotations do we want? Dim imgShipFrames(iNumRotations) ;Holds the rotated images Global iCurrentFrame = 0 ;What is the current frame being displayed? ; tell BB to handle the centering of our images AutoMidHandle True ; Load the player image and point to it with "imgTemp" imgTemp = LoadImage("graphics\player.bmp") ; See if the image was loaded successfully (the "imgTemp" will be 0 if not) If imgTemp = 0 Then Text 100,100,"Invalid Image!" ; tell the user it was invalid if 0 Else ; set it's mask (transparent color) MaskImage imgTemp,0,0,0 ; now run through the loop and rotate the image For iLoop=0 To iNumRotations-1 ; first let's copy the original image into the current frame imgShipFrames(iLoop)=CopyImage( imgTemp ) ; then rotate that frame the appropriate number of degrees RotateImage imgShipFrames(iLoop),iLoop*360/iNumRotations Next EndIf ; loop until the player hits the ESC key While Not KeyHit(1) ; clear the screen Cls ; display the current Ship Frame in the center of the screen DrawImage(imgShipFrames(iCurrentFrame),400,300) ; change the current frame (spin it to the right) iCurrentFrame = iCurrentFrame + 1 ; if the current frame counter goes past our number of ; allowable rotations, reset it to 0 If iCurrentFrame > iNumRotations - 1 iCurrentFrame = 0 EndIf Flip Wend ; end the program, return control to Windows End
So this basically loads in a ship and spins it around on the center of the screen. Mess around a bit with the delay speeds and the iNumRotations variables to see the weird things you can do ;)
Let's say that you had an image that you wanted to paste all over the screen, side by side and top to bottom. You could write a routine that used a couple of for loops and that did some positioning calculations, or you could simply use BB's TileBlock command.
For fun, let's use that same little ship image to tile our background with. To do this we would simply call TileBlock with the image to use and optionally the x,y coordinates to start the drawing at. If you don't supply the x,y coordinates, BB will assume you want to start in the top-left corner.
Here's the code (source is in "tileblock.bb"):
; Initialize BB to run at 800x600 Graphics 800,600 ; Load the player image and point to it with "imgShip" imgShip = LoadImage("graphics\player.bmp") ; See if the image was loaded successfully (the "imgShip" will be 0 if not) If imgShip = 0 Then Text 100,100,"Invalid Image!" ; tell the user it was invalid if 0 Else ; Tile the ship image all over the screen TileBlock imgShip EndIf ; wait for the user to press a key WaitKey ; end the program, return control to Windows End
Now you probably want to see how they do those cool parallaxing starfields in most of those 2D space games (like Insectoids). It's actually a snap with BB. You simply use a combination of the TileBlock and the TileImage commands.
TileImage is basically the same thing as TileBlock with the primary difference being that TileImage draws the tile using transparency...thus it's a little slower. You'll need this, though, because you don't want to overwrite the backgrounds as you parallax over them.
Side Note: If you don't know what parallaxing is, here's the basic idea. Pretend you're in a car that's going down a highway with close hills and faraway mountains. The close hills will appear to be going past much faster than the faraway mountains. They're not, it just looks that way because of your proximity to them. Now look at a 2D starfield, the dim stars (way faraway) should appear to move more slowly than the bright stars (close up). It's just an illusion, really, but it adds a good amount of life to your game.
I borrowed the spacing of the starfields from Insectoids (thanks guys!), but I decided that having three actual images looked better. They're the exact same in layout, but they have different brightness and contrast values. This is so I could make the faraway stars look dimmer than the closer ones. The code piece for the calculations is straight out of Insectoids though, so the credit goes there.
One last thing, this example uses a couple of things that may seem foreign to you...the SetBuffer and the Flip commands. I'm going to touch on these in a future article, but for now I'm just using them to make the starfield scroll smoothly (without flicker).
Here's the code (source is in "prlxstars.bb"):
; Initialize BB to run at 800x600 Graphics 800,600 ; set up the drawing buffer to be the backbuffer SetBuffer BackBuffer() ; load up the star backgrounds (3 total) imgStarsFar=LoadImage( "graphics\starsfar.bmp" ) imgStarsMid=LoadImage( "graphics\starsmid.bmp" ) imgStarsClose=LoadImage( "graphics\stars.bmp" ) ; create a variable to keep track of our drawing locations Global iStarsScroll ; loop until the player hits the ESC key While Not KeyHit(1) ; clear the screen/buffer Cls ; Fill the whole background with the 3 star layers ; in their current positions TileBlock imgStarsFar,0,iStarsScroll TileImage imgStarsMid,7,iStarsScroll*2 TileImage imgStarsClose,23,iStarsScroll*3 ; calculate the new position to start the next drawing cycle iStarsScroll=(iStarsScroll+1) Mod ImageHeight( imgStarsFar ) ; flip the back drawing buffer to the display Flip Wend ; end the program, return control to Windows End
For a more in-depth version of parallaxing starfields with pseudo 2D space
physics, check out my 2D
Space Physics and More BlitzBasic article...warning, it gets into some
pretty advanced stuff.
One of the topics I've not covered yet is page flipping and page blitting.
Although if you've followed my previous articles you've certainly seen it in
action, I haven't really delved into what it's all about. So I'll touch on that
in here.
Also, seeing that you'll want a way to get your users to move images and such
around the screen, I figured a talking about input devices would be in order.
This will cover the fundamentals on keyboard, mouse, and joystick usage. They
are super simple to use, so this won't be a massive article.
It's recommended that you download the source
code so you can see all this in action.
This form of animation actually allows you to write to the screen's buffer
real-time. This used to be the way that games were made, especially at 320x200
resolutions, but it's not as common today. The idea is that the monitor is
refreshed n number of times per second. If we catch the monitor half-way through
it's refresh phase, we'll see flickering in our images. This looks bad.
Page flipping is utilized most often in today's games because it's a way to
ensure you're not going to get flicker. The concept is to have a piece of memory
set aside (preferably video memory, for speed reasons) that is laid out exactly
like your primary video memory (or screen buffer). So, you'd have a primary
(front) buffer and a secondary (back) buffer. The back buffer, again, is simply
a duplicate layout of the primary buffer. The primary buffer is also known as
the front buffer.
Now, the idea is that while your front buffer is displayed to the user you
are busy drawing on the back buffer. This way you are not drawing anything to
the main screen while the user watches. When you have completed your drawing you
simply Flip the two pages.  Since this simply tells the video card
to point to a new place in video memory when doing it's refresh, it's instant.
Plus I'm sure that BB (or more likely, DirectX) makes sure the Verticle Retrace
is accounted for when doing the Flip.
There are three functions that you'll need to use in order to do page flip
animation. They are the SetBuffer, BackBuffer, and the Flip
commands. The SettBuffer command tells BB where to draw. BackBuffer
returns a pointer to the back buffer we discussed above. The Flip command
tells BB that we're ready to swap our front and back buffers.
You can find the full source for Page Flip animation inside the flipimage.bb
file, but here's the set up code and the main While loop to show you how
it's used:
When moving a ship around, firing, etc. you'll want to use a keyboard routine
that keeps track of when a key is held down. While you can certainly use the KeyHit
command for checking on one-time hit keys such as ESC, you'll need something a
little more robust for real-time stuff.
This is where the KeyDown function comes in. All this function does is
return a true or false response when asked if a particular key is being held
down. In order for you to send it a particular key to check, you'll need to know
the scancode. This is a code that the computer recognizes the key by.
Generally what I do is find the code (using BB's help area, under "Keyboard
Scancodes") and make a constant with a recognizable name. Like this:
Now I know that all I have to do is remember "RightArrow", not 205.
Makes it easier to read code that way, don't ya think?
The following code is a snippet from the kbinp.bb file. It's a
function that I called CheckKeys() and all it does is checks to see if
the left or right arrow is being held down and then spins the ship accordingly:
The next device I'll touch on is the mouse. Since the mouse has waaaaaaay
fewer codes to worry about, it's a little easier to check on. However, you may
still need a little trickery to get things done.
Let's say that we wanted to duplicate our keyboard routine using the mouse.
If the mouse is being run to the left, spin the ship left. If to the right, spin
it right.
First let's look at the problem. If you check the mouse coordinates using MouseX
and MouseY you'll find that they will be locked to the screen resolution.
This is cool if you are going to button clicks and such on a screen. But since
we want to spin the ship left as the mouse moves left, we'll need to see if the
current mouse position is different from the previous check. Since you'll
eventually get a MouseX postiion of 0, you'll find after a while that the
ship will stop spinning.
To solve this we use the MouseMove function (thanks to
"shockman" on the BB messageboards for getting me this function name!)
to re-center our mouse after each check. This will ensure that we will always
either be equal to, greater than, or less than our last check.
The following code is a snippet from the mouseinp.bb file. It's a
function that I called CheckMouse() and all it does is checks to see if
the mouse is moving left or right and spins the ship accordingly. Note that the
section before Function CheckMouse() is really located at the top of the
program, it's here for reference only:
I know that I didn't touch on button-clicks and such with the mouse and
Joystick, but if you look under "Input Device Commands" in the BB help
section you should be able to start incorporating those easily. Part of getting
the game coding and such down is to start tinkering with things on your own, so
I purposely avoided covering every input command. Get that hacker mentality
going...try things and see what happens! That's all part of becoming a game
programmer ;)
As an exercise you should consider putting all of the input functions into
one file and check to see if any of them are being used in your main While
loop. Also, why not check out the various scancodes to connect to your keys?
Page Flipping & Handling Input
Screen Blit Animation
Const iScreenWidth=800 ;what's our screen width?
Const iScreenHeight=600 ;what's our screen height?
; Initialize BB's Graphics using our constants
Graphics iScreenWidth, iScreenHeight
; Set up our primary drawing surface to be the BackBuffer
; this is to allow for page-flip animation
SetBuffer BackBuffer()
; loop until the player hits the ESC key
While Not KeyHit(1)
; check to see if any keys were hit
CheckKeys()
; clear the BackBuffer
Cls
; draw the current Ship Frame on the center of the BackBuffer
DrawImage(imgShipFrames(iCurrentFrame),iShipX,iShipY)
; Flip the BackBuffer to the Display
Flip
Wend
; end the program, return control to Windows
End
; Setup Keyboard Constants (Arrows, KeyPad Arrows)
Const LeftArrow=203, RightArrow=205
Const LeftKPArrow=75, RightKPArrow=77
Function CheckKeys()
If KeyDown(LeftArrow) Or KeyDown(LeftKPArrow) Then
; change the current frame (spin it to the left)
iCurrentFrame = iCurrentFrame - 1
; if the current frame counter is less than 0
; reset it to the number of rotations - 1
If iCurrentFrame < 0
iCurrentFrame = iNumRotations - 1
EndIf
EndIf
If KeyDown(RightArrow) Or KeyDown(RightKPArrow) Then
; change the current frame (spin it to the right)
iCurrentFrame = iCurrentFrame + 1
; if the current frame counter goes past our number of
; allowable rotations, reset it to 0
If iCurrentFrame > iNumRotations - 1
iCurrentFrame = 0
EndIf
EndIf
End Function
Using the Mouse
; center the mouse on the screen
MoveMouse iScreenWidth/2, iScreenHeight/2
;Save our mouse position for X
Global iCurrentMouseX=MouseX()
Function CheckMouse()
If MouseX() < iCurrentMouseX Then
; change the current frame (spin it to the left)
iCurrentFrame = iCurrentFrame - 1
; if the current frame counter is less than 0
; reset it to the number of rotations - 1
If iCurrentFrame < 0
iCurrentFrame = iNumRotations - 1
EndIf
EndIf
If MouseX() > iCurrentMouseX Then
; change the current frame (spin it to the right)
iCurrentFrame = iCurrentFrame + 1
; if the current frame counter goes past our number of
; allowable rotations, reset it to 0
If iCurrentFrame > iNumRotations - 1
iCurrentFrame = 0
EndIf
EndIf
; reset the mouse to be at the center of the screen
MoveMouse iScreenWidth/2, iScreenHeight/2
; reset iCurrentMouseX to be at the center of the screen
iCurrentMouseX = MouseX()
End Function


Contents
class Leap.Controller
The Controller class is your main interface to the Leap Motion Controller.
Create an instance of this Controller class to access frames of tracking data and configuration information. Frame data can be polled at any time using the Controller.frame() function. Call frame() or frame(0) to get the most recent frame. Set the history parameter to a positive integer to access previous frames. A controller stores up to 60 frames in its frame history.
Polling is an appropriate strategy for applications which already have an intrinsic update loop, such as a game.
Constructor Top
| Controller () |
Methods Top
| Leap.Frame | frame (Number history) |
Constructor details
Top
controller.js at line 9
Controller
()
Constructs a Controller object.
When creating a Controller object, you may optionally pass in options
to set the host , set the port, enable gestures, or select the frame event type.
var controller = new Leap.Controller({
host: '<IP_ADDRESS>',
port: 6437,
enableGestures: true,
frameEventName: 'animationFrame'
});
Constructs a Controller object.
When creating a Controller object, you may optionally pass in options to set the host , set the port, enable gestures, or select the frame event type.
var controller = new Leap.Controller({
host: '<IP_ADDRESS>',
port: 6437,
enableGestures: true,
frameEventName: 'animationFrame'
});
Methods Detail Top
controller.js at line 93
Returns a frame of tracking data from the Leap.
Use the optional history parameter to specify which frame to retrieve. Call frame() or frame(0) to access the most recent frame; call frame(1) to access the previous frame, and so on. If you use a history value greater than the number of stored frames, then the controller returns an invalid frame.


There are many places you can read how to Brew it so im not going to write it, I'm lazy. I am not an overly inteligent guy, details are usually just a bit beyond me, my friends how ever have a slightly better way of comunicating. But they didn't 'trip' like I did. Me and two of my friends ordered the ingrediants and proceded to 'cook' the two brews. 5 grams each for the seeds, a brownish liquid was extracted. We placed it in the fridge and continued to brew the roots (8 1/2 grams each). It came out bright red, almost blood red. We used pink sobe to make a 'mixed drink' with the root. We drank the seeds liquid. 25 minutes later I drank the blood red sobe root concoction.
Its onset was slow, no puke and only slightly enhanced visual perception, like a half an eight of shrooms. I was disapionted. I didn't eat that day or at all for two more, I forgot to to be honest. I have been eating valume and doing coke and adderal during this time, and have no idea what it did for the trips.
That following day is where the trip begins, lol
We just cooked 120 grams of the root and split it three ways. I puked an hour later and it began instantly. Everything had a pattern or a face, I started talking to myself in the bathroom, and this thing was in the shower, the thing was being sneaky but I didn't see it, so I looked around the curtain and this little thing jumps out at me to either play a joke on me or scare me out of my mind, hard to explain but it had a 2d, 4d, black and white elf look to it, it was a higher being than I am, so my mind didn't quite 'get it'.
Most people probuably would have freaked out but I got the sense it was all in the name of fun. So I laughed myself silly went and layed on the couch and watched people. I could know what they were thinking, not like a psychic, more like there subconcious wants and flaws. I UNDERSTOOD but can't put words to the facts that I thought. It felt like all theese drugs I do are worthless, accept this beutiful feeling of enlightenment. I knew what I wanted, peace of mind peace with myself not the pretend peace you get from oxy or some other euphoric drug I wanted to be happy with who I am. I studied people for the come down, and found myself being judgmental in a sorry for you sort of way.
The next day I reboiled all the roots because they still had color, three times. And and seeds we had left, This time was the hardest I have ever triped, and I have done a lot of wierd drugs.
This time I layed down and I knew I couldn't sleep but tried to anyway, now this might sound wierd but I clear my mind before I go to bed, like meditation, I focus on nothing. I layed thier and this time the onset was a creeper.  One of theese spirits had a feminine aspect the other a masciline but not quite male or female.
This is when I peaked, an even more 'enlightened being' caressed me like a plotonic hug.  I was back in my body and my trip was on the come down.
This has some spiritual implications, I think that when I die my soul will be free, maybe to join the cosmos, but this universe created itself, maybe created life and with it thought, I believe we will become an 'ENERGY ENTITY', using energy lightly because if thier is matter and energy why not a diffrent spiritual substance? ho knows maybe I am crazy. I am done with drugs, I might do this Ayahuasca agian but the others wont make me happy, not really.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Before Change
self.assertEqual(seq.kmer_frequencies(3, overlap=False), expected)
expected = Counter(["GATTACA"])
self.assertEqual(seq.kmer_frequencies(7, overlap=False), expected)
expected = Counter([])
self.assertEqual(seq.kmer_frequencies(8, overlap=False), expected)
def test_kmer_frequencies_relative(self):
seq = Sequence("GATTACA", positional_metadata={"quality": range(7)})
After Change
expected = {"GATTACA": 1}
self.assertEqual(seq.kmer_frequencies(7, overlap=False), expected)
expected = {}
self.assertEqual(seq.kmer_frequencies(8, overlap=False), expected)
def test_kmer_frequencies_relative(self):
seq = Sequence("GATTACA", positional_metadata={"quality": range(7)})


|
NISTConst
|
| const double NISTConst::protonChargeToMassQuotient = 9.578833226e7 |
\(\frac{e}{m_p} \ (\frac{C}{kg})\) Proton charge to mass quotient in coulombs per kilogram.
| const double NISTConst::protonChargeToMassQuotientUncertainty = 0.000000059e7 |
\(\frac{e}{m_p} \ (\frac{C}{kg})\) Uncertainty in proton charge to mass quotient in coulombs per kilogram.
| const double NISTConst::protonComptonWavelength = 1.32140985396e-15 |
\(\lambda_{C,p} \ (m)\) Proton Compton wavelength in meters.
| const double NISTConst::protonComptonWavelengthOver2Pi = 0.210308910109e-15 |
\(\frac{\lambda_{C,p}}{2\pi}\ (m)\) Proton Compton wavelength over 2 pi in meters.
| const double NISTConst::protonComptonWavelengthOver2PiUncertainty = 0.000000000097e-15 |
\(\frac{\lambda_{C,p}}{2\pi} \ (m)\) Uncertainty in proton Compton wavelength over 2 pi in meters.
| const double NISTConst::protonComptonWavelengthUncertainty = 0.00000000061e-15 |
\(\lambda_{C,p} \ (m)\) Uncertainty in proton Compton wavelength in meters.
| const double NISTConst::protonElectronMassRatio = 1836.15267389 |
\(\frac{m_p}{m_e} \ (1)\) Proton-electron mass ratio.
| const double NISTConst::protonElectronMassRatioUncertainty = 0.00000017 |
\(\frac{m_p}{m_e} \ (1)\) Uncertainty in proton-electron mass ratio.
| const double NISTConst::protongFactor = 5.585694702 |
\(g_p \ (1)\) Proton g factor.
| const double NISTConst::protongFactorUncertainty = 0.000000017 |
\(g_p \ (1)\) Uncertainty in proton g factor.
| const double NISTConst::protonGyromagneticRatio = 2.675221900e8 |
\(\gamma_p \ (\frac{rad\ Hz}{T})\) Proton gyromagnetic ratio in radian hertz per tesla. Note that the units of radians are added for clarity.
| const double NISTConst::protonGyromagneticRatioOver2pi = 42.57747892 |
\(\frac{\gamma_p}{2\pi} \ (\frac{rad\ MHz}{T})\) Proton gyromagnetic ratio over 2 pi in radian megaahertz per tesla. Note that the units of radians are added for clarity.
| const double NISTConst::protonGyromagneticRatioOver2piUncertainty = 0.00000029 |
\(\frac{\gamma_p}{2\pi} \ (\frac{rad\ MHz}{T})\) Uncertainty in proton gyromagnetic ratio over 2 pi in radian megaahertz per tesla. Note that the units of radians are added for clarity.
| const double NISTConst::protonGyromagneticRatioUncertainty = 0.000000018e8 |
\(\gamma_p \ (\frac{rad\ Hz}{T})\) Uncertainty in proton gyromagnetic ratio in radian hertz per tesla. Note that the units of radians are added for clarity.
| const double NISTConst::protonMagneticMoment = 1.4106067873e-26 |
\(\mu_p \ (\frac{J}{T})\) Proton magnetic moment in joules per tesla.
| const double NISTConst::protonMagneticMomentToBohrMagnetonRatio = 1.5210322053e-3 |
\(\frac{\mu_p}{\mu_B} \ (1)\) Proton magnetic moment to Bohr magneton ratio.
| const double NISTConst::protonMagneticMomentToBohrMagnetonRatioUncertainty = 0.0000000046e-3 |
\(\frac{\mu_p}{\mu_B} \ (1)\) Uncertainty in proton magnetic moment to Bohr magneton ratio.
| const double NISTConst::protonMagneticMomentToNuclearMagnetonRatio = 2.7928473508 |
\(\frac{\mu_p}{\mu_N} \ (1)\) Proton magnetic moment to nuclear magneton ratio.
| const double NISTConst::protonMagneticMomentToNuclearMagnetonRatioUncertainty = 0.0000000085 |
\(\frac{\mu_p}{\mu_N} \ (1)\) Uncertainty in proton magnetic moment to nuclear magneton ratio.
| const double NISTConst::protonMagneticMomentUncertainty = 0.0000000097e-26 |
\(\mu_p \ (\frac{J}{T})\) Uncertainty in proton magnetic moment in joules per tesla.
| const double NISTConst::protonMagneticShieldingCorrection = 25.691e-6 |
\(\sigma'_p \ (1)\) Proton magnetic shielding correction.
| const double NISTConst::protonMagneticShieldingCorrectionUncertainty = 0.011e-6 |
\(\sigma'_p \ (1)\) Uncertainty in proton magnetic shielding correction.
| const double NISTConst::protonMass = 1.672621898e-27 |
\(m_p \ (kg)\) Proton mass in kilograms.
| const double NISTConst::protonMassInJPercSquared = 1.503277593e-10 |
\(m_p \ (\frac{J}{c^2})\) Proton mass in joules per speed of light squared.
| const double NISTConst::protonMassInJPercSquaredUncertainty = 0.000000018e-10 |
\(m_p \ (\frac{J}{c^2})\) Uncertainty in proton mass in joules per speed of light squared.
| const double NISTConst::protonMassInMeVPercSquared =<PHONE_NUMBER> |
\(m_p \ (\frac{MeV}{c^2})\) Proton mass in megaelectron volts per speed of light squared.
| const double NISTConst::protonMassInMeVPercSquaredUncertainty = 0.0000058 |
\(m_p \ (\frac{MeV}{c^2})\) Uncertainty in proton mass in megaelectron volts per speed of light squared.
| const double NISTConst::protonMassInu = 1.007276466879 |
\(m_p \ (u)\) Proton mass in unified atomic mass unit.
| const double NISTConst::protonMassInuUncertainty = 0.000000000091 |
\(m_p \ (u)\) Uncertainty in proton mass in unified atomic mass unit.
| const double NISTConst::protonMassUncertainty = 0.000000021e-27 |
\(m_p \ (kg)\) Uncertainty in proton mass in kilograms.
| const double NISTConst::protonMolarMass = 1.007276466879e-3 |
\(M_p \ (\frac{kg}{mol})\) Proton molar mass in kilograms per mole.
| const double NISTConst::protonMolarMassUncertainty = 0.000000000091e-3 |
\(M_p \ (\frac{kg}{mol})\) Uncertainty in proton molar mass in kilograms per mole.
| const double NISTConst::protonMuonMassRatio = 8.88024338 |
\(\frac{m_p}{m_\mu} \ (1)\) Proton-muon mass ratio.
| const double NISTConst::protonMuonMassRatioUncertainty = 0.00000020 |
\(\frac{m_p}{m_\mu} \ (1)\) Uncertainty in proton-muon mass ratio.
| const double NISTConst::protonNeutronMagneticMomentRatio = -1.45989805 |
\(\frac{\mu_p}{\mu_n} \ (1)\) Proton-neutron magnetic moment ratio.
| const double NISTConst::protonNeutronMagneticMomentRatioUncertainty = 0.00000034 |
\(\frac{\mu_p}{\mu_n} \ (1)\) Uncertainty in proton-neutron magnetic moment ratio.
| const double NISTConst::protonNeutronMassRatio = 0.99862347844 |
\(\frac{m_p}{m_n} \ (1)\) Proton-neutron mass ratio.
| const double NISTConst::protonNeutronMassRatioUncertainty = 0.00000000051 |
\(\frac{m_p}{m_n} \ (1)\) Uncertainty in proton-neutron mass ratio.
| const double NISTConst::protonrmsChargeRadius = 0.8751e-15 |
\(r_p \ (m)\) Proton rms charge radius in meters.
| const double NISTConst::protonrmsChargeRadiusUncertainty = 0.0061e-15 |
\(r_p \ (m)\) Uncertainty in proton rms charge radius in meters.
| const double NISTConst::protonTauMassRatio = 0.528063 |
\(\frac{m_p}{m_\tau} \ (1)\) Proton-tau mass ratio.
| const double NISTConst::protonTauMassRatioUncertainty = 0.000048 |
\(\frac{m_p}{m_\tau} \ (1)\) Uncertainty in proton-tau mass ratio.
| const double NISTConst::shieldedProtonGyromagneticRatio = 2.675153171e8 |
\(\gamma'_p \ (\frac{rad\ Hz}{T})\) Shielded proton gyromagnetic ratio in radian hertz per tesla. Note that the units of radians are added for clarity.
| const double NISTConst::shieldedProtonGyromagneticRatioOver2Pi = 42.57638507 |
\(\frac{\gamma'_p}{2 \pi} \ (\frac{rad\ MHz}{T})\) Shielded proton gyromagnetic ratio over 2 pi in radian megaahertz per tesla. Note that the units of radians are added for clarity.
| const double NISTConst::shieldedProtonGyromagneticRatioOver2PiUncertainty = 0.00000053 |
\(\frac{\gamma'_p}{2 \pi} \ (\frac{rad\ MHz}{T})\) Uncertainty in shielded proton gyromagnetic ratio over 2 pi in radian megaahertz per tesla. Note that the units of radians are added for clarity.
| const double NISTConst::shieldedProtonGyromagneticRatioUncertainty = 0.000000033e8 |
\(\gamma'_p \ (\frac{rad\ Hz}{T})\) Uncertainty in shielded proton gyromagnetic ratio in radian hertz per tesla. Note that the units of radians are added for clarity.
| const double NISTConst::shieldedProtonMagneticMoment = 1.410570547e-26 |
\(\mu'_p \ (\frac{J}{T})\) Shielded proton magnetic moment in joules per tesla.
| const double NISTConst::shieldedProtonMagneticMomentToBohrMagnetonRatio = 1.520993128e-3 |
\(\frac{\mu'_p}{\mu_B} \ (1)\) Shielded proton magnetic moment to Bohr magneton ratio.
| const double NISTConst::shieldedProtonMagneticMomentToBohrMagnetonRatioUncertainty = 0.000000017e-3 |
\(\frac{\mu'_p}{\mu_B} \ (1)\) Uncertainty in shielded proton magnetic moment to Bohr magneton ratio.
| const double NISTConst::shieldedProtonMagneticMomentToNuclearMagnetonRatio = 2.792775600 |
\(\frac{\mu'_p}{\mu_N} \ (1)\) Shielded proton magnetic moment to nuclear magneton ratio.
| const double NISTConst::shieldedProtonMagneticMomentToNuclearMagnetonRatioUncertainty = 0.000000030 |
\(\frac{\mu'_p}{\mu_N} \ (1)\) Uncertainty in shielded proton magnetic moment to nuclear magneton ratio.
| const double NISTConst::shieldedProtonMagneticMomentUncertainty = 0.000000018e-26 |
\(\mu'_p \ (\frac{J}{T})\) Uncertainty in shielded proton magnetic moment in joules per tesla.


Nyzo version 511 (commit on GitHub) improves the accuracy of the scoring system by introducing a one-block delay between freezing blocks and counting block votes. It also activates UDP sending of block votes and improves performance of the thread that receives UDP messages.
This version affects only the verifier. The sentinel does not maintain performance scores, and it does not send or receive block votes.
In BlacklistManager, an overload of the inBlacklist() method has been added to accept a ByteBuffer directly. The old overload of the method wraps the byte array argument and uses the new overload.
The registerVote() method of BlockVoteManager now accepts votes at the current frozen edge.
In MeshListener, the single byte array packet buffer has been replaced with a queue of 50000 pre-constructed DatagramPacket instances.
In the TCP socket loop, the condition for sleeping when the verifier is paused has been removed. This was a testing mechanism that was never fully implemented, so this does not change any behavior.
The UDP read socket has been updated to only read the incoming packet and store it in the processing queue. If the processing queue is full, the packet is discarded.
A new thread has been added for processing UDP packets. Some simple checks are implemented to avoid unnecessary work for packets that are superficially useless, but the small size of the packets keeps processing overhead low in all cases.
When pings or UDP block votes are received, the appropriate counters in the StatusResponse class are incremented. These are temporary fields that will be removed in a few versions when the UDP code is reasonably well vetted.
In the Message.fromBytes() method, the discardMessageLength parameter has been renamed to isUdp. In addition to discarding the message length from the buffer, this parameter is now used to determine if blacklisting should be avoided for this message. Source IP addresses can be spoofed for UDP messages, so IP-based blacklisting should not be used for these messages.
In the NodeManager class, a lookup has been added to check if an IP address belongs to an in-cycle verifier. This is currently used only to check incoming UDP packets, but it will likely be used in a later version to improve performance of reading TCP messages, also.
Also in the NodeManager class, version 2 node-join messages are now sent. This will activate UDP block votes for all verifiers.
In UnfrozenBlockManager, the visibility of castVote() has been changed to allow the Verifier class to cast late votes to support performance scores.
In the Verifier class, a vote is now cast when a block is frozen if the verifier has not yet cast a vote at the height that is being frozen. This is an uncommon occurrence, but it allows a verifier to take full advantage of the delayed performance-score tabulation.
Performance scores are now updated one block back from the block that was just frozen. This eliminates the possibility that minor timing issues would cause a verifier to be unfairly penalized.
In VerifierPerformanceManager, the increment has been changed to 6 and the decrement to -7. The total time that a verifier can be completely uninvolved in the mesh before receiving removal votes is still 2 days from 0, and the total credit that a verifier can earn for good performance is still an additional 2 days. However, the time required to earn that full credit is now 12 days, and a verifier now needs 6 days of good performance to make up for each day of no involvement.
The performance-score filename has been changed to version 3. This will reset all performance scores.
In the StatusResponse class, some fields have been added for monitoring and testing the UDP functionality. Some or all of these will likely be removed in a later version.
The hash of the frozen edge has also been added to the status response. There have been a number of cases where groups of out-of-cycle verifiers have stalled on a common block. One possible explanation for such a stall is freezing of an incorrect block on these verifiers. Inclusion of this field will allow easy confirmation or exclusion of this explanation.
A bounty will be awarded for finding the issue of using spoofed UDP packets to cause a verifier to be blacklisted. The amount and transaction will be posted here shortly.


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--newton.Callback
A Callback is a class which makes it easy to wrap a Java method appear as a NewtonScript function. Most commonly this is used to make callback functions -- for example, protoTextButton's ButtonClickScript, or an Endpoint's callback function when data has arrived.
The method you'll wrap is Ref call(Ref[] args), which gets passed its arguments as an array of Refs, and returns a Ref as the return value back to NewtonScript. You need to create a callback which subclasses from the Callback class, and implement this method. The simplest way to do this is with a Java anonymous class. Here's an example template for you. The call() method will be called when NewtonScript calls the callback function.
Callback mycallback = new Callback() { public Ref call(Ref[] args) { // if this is a one-shot callback, I should remove myself from // the mailbox here. Otherwise if the callback will be called // several times, then you'll need // to remember to remove the callback sometime in the future. // If the callback is to be called repeatedly for the life of // the application, you don't even need to bother with this; // when the app quits, the callback will be removed. remove(); // do your stuff here. // Lastly, you need to return the return value of the callback. // To return nil, you could simply do: return new Ref(); } };
Next you need to generate the NewtonScript wrapper callback function, telling it how many args to have. You also need to register the callback in the mailbox. Let's say you have 4 arguments in your callback function. Then you'd say:
Ref myfunc = mycallback.func(4); // registered. myfunc is the NS wrapper function.
Now you can pass in myfunc as a Ref representing a 4-argument function. If you didn't remove your callback from the mailbox by calling remove() during your call() code, you should remember to remove it later. You can keep the callback in the mailbox as long as you like -- and it will continue to get called every time NewtonScript tries to call it. If you remove it from the mailbox, it will cease to be called (though NewtonScript may continue to try unless you've told it to stop!!)
Do NOT make a callback with more than 10 arguments -- Waba will limit it to 10.
Also, beware of recursion! Within your call() code, you cannot call a function which will recursively call you back again, unless you have made a copy of your args first (they'll get overwritten).
| Constructor Summary | |
Callback()
Makes a callback function of 0 arguments |
| Method Summary | |
abstract Ref |
call(Ref[] args)
Called when a callback function hits this mailbox. |
void |
clearAll()
Removes all callbacks from the mailbox. |
Ref |
func(int numArgs)
Creates an NS function, if not already done, and registers the callback in the mailbox, if not already done. |
void |
remove()
Removes the callback from the mailbox if it's there. |
static Ref |
sendInherited(String functionName,
Ref frame,
Ref[] args)
Calls an inherited version of the function functionName in the frame frame, passing it the arguments in the array args, bypassing any declared version of the function directly stored in a slot in frame. |
| Methods inherited from class java.lang.Object |
equals, hashCode, toString |
| Constructor Detail |
public Callback()
| Method Detail |
public Ref func(int numArgs)
public void remove()
public void clearAll()
public abstract Ref call(Ref[] args)
public static final Ref sendInherited(String functionName, Ref frame, Ref[] args)
This method is found in Callback because it is likely to be used almost solely by Callback functions. Let's say you're making a protoPopupButton (a button which pops up a list). The Callback you're implementing is PickActionScript(index), which gets called when item #index in the list is chosen by the user. The documentation says that you are required to call inherited:?PickActionScript(index) within the body of your NewtonScript code implementing PickActionScript. But you don't have NewtonScript code. How do you do it? In a way something like this:
// assume an instance member variable called button is already declared...
template = NS.frameWithProto("protoPopupButton");
template.setSlot("PickActionScript",
new Callback()
{
public Ref call(Ref[] args)
{
Ref gotback = Callback.sendInherited("PickActionScript",button,args);
// ... do your PickActionScript stuff here, maybe using gotback
}
 }.func(1));
// create the button from the template. In this example we will do so by
// adding it as a stepview to our Waba window.
button = Ref.call("AddStepView", NS.object(NS.WINDOW), template);
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


my values
reflections
displaying elements
emotional intelligence
javascript and DOM
neuroplasticity and growth mindset
problem solving
Foundations reflections


How many years do you have left in MERCURY
*Based on the average death age on Earth: 79
How many years do you have left in VENUS
*Based on the average death age on Earth: 79
How many years do you have left in MARS
*Based on the average death age on Earth: 79
How many years do you have left in JUPITER
*Based on the average death age on Earth: 79


Apple's Phil Schiller thinks students won't succeed on a Chromebook
Source: Android Central
What you need to know
- Apple introduced a new MacBook Pro with a keyboard that ditches the unpopular "butterfly" switches.
- Interim Comms Lead Phil Schiller talked in detail about all of the changes needed to improve the keyboard.
- Schiller's final point was a jab saying students would not be successful using Chromebooks in class.
Apple's MacBook Pro butterfly keyboard was problematic enough that Apple created an extended service program just to cover broken keyboards. It was such a contentious issue that when Apple launched its newest, most powerful, and largest laptop in years, the first thing commenters mentioned was the new keyboard, which is actually a return to an old keyboard design. In a deep-diving conversation with CNET's Roger Cheng about just how much time Apple spent considering its keyboard, recently-appointed Head of Communications, Phil Schiller, leaves with a jab at the inexpensive and popular Chromebook devices.
Source: iMore
Schiller details all of the feedback Apple gathered for its new-old keyboard design. Schiller applauds the company's decision to remove some of its TouchBar to bring back the Esc key. He sidesteps questions about any touchscreen laptop plans, saying that "engineering effort is better spent on making the Mac be the best keyboard-trackpad experience possible."
After detailing Apple's keyboard design concerns for the majority of the interview, Schiller addresses a question on the Mac's popularity in education by taking a swipe at Chromebooks. He claims that "Chromebooks have gotten to the classroom because, frankly, they're cheap testing tools for required testing," then proceeds to say that when schools rely on Chromebooks, the students are "not going to succeed." Currently Chromebooks own 60% of education sales for mobile devices, according to an Edweek report on Futuresource Consulting research.
In a later post on Twitter, Schiller again takes an implicit stab at Chromebooks, saying:
"Every child has the ability to succeed — helping them to do that has always been our mission ... giving kids and teachers the content, curriculum and tools they need to learn, explore and grow. Not just to take a test."
Update: Twitter post from Phil Schiller added
Best Chromebook
Lenovo Chromebook C340
The Chromebook to help you succeed
With all-day battery life and an adaptable touchscreen 2-in-1 format, the pink C340 is ready to show you and your classmates what Chrome can do for your schoolwork.
We may earn a commission for purchases using our links. Learn more.


I have never thought of myself as someone that would ever blog about anything. It's not that I don't like to take part in discussions and share ideas about things, but it just seems like so many people become all consumed in their own ideas and opinions through their blog posts. I will have to say that through this process I have perhaps had a shift of my own opinion on this. I have learned so much by putting my thoughts down somewhere and allowing others access to read and respond to them. I feel like I have allowed myself to ask for criticism in the hopes that I can become better and make progress. I think that this is important in doing just that.
I have really enjoyed creating this site and making tweaks to the CSS, trying to get things just right. I don't feel like I failed, but I still have much to work on and make better. Integrating the blog posts into the website proved to be some difficult for me. For some reason, I didn't have the foresight to bundle the two together. I mean that I didn't use the same header and footer and other structures for both the main website and the blog. I created them as separate things, and this made a bit more work for me to pull them together later. I think I learned a lesson in planning due to this. I will try to think ahead more clearly before jumping into a project.
I see the value in writing blog posts about topics. Whether they are technical posts or cultural posts doesn't really matter. Each has benefit from thinking about and expressing ideas on the topic. For the technical posts, usually it requires me to do some additional research on topics to get a better understanding. This helps to learn more as I go. For the cultural posts, this is a time to reflect on the ideas and morals that I embody. I think it's always important to either know or to want to know how you feel about something. It helps you grow as an individual and also become a stronger part of a community.
So my experience of creating a website and trying out something new in blogging about it has been a success. I feel like I have learned a great deal and that I have accomplished some things as well. I have built confidence in myself being able to clearly express my ideas and feel like they have weight in a discussion. I am encouraged to continue doing this and hope that I can continue growing.


Shipping
Choose your shipping options
Cute dogs come in a variety of shapes and sizes. Some cute dogs are cute for their adorable faces.
Cute dogs come in a variety of shapes and sizes. Some cute dogs are cute for their adorable faces.
There are many breeds of dogs. Each breed varies in size and temperament. Owners often select a breed of dog that they find to be compatible with their own lifestyle and desires from a companion.


Regular expression are also used in replacing, splitting and re-arranging text. Regular expressions are generally follow a similar pattern in most of the programming languages.
You can quickly create and test your regex with following websites:
Search for a text
For example, if we are going to search for html tags

,

,

,

,

,

, and

,

,

,

,

,

, then we can simply write the code
like this:
/<\/?h[1-6]>/ig
PHP Example
PHP uses these functions for search and replace, preg_match
and
preg_match_all
for matching and preg_replace
for replacement.
$html = '
Heading 1
'; $pattern = '/<\/?h[1-6]>/ig'; echo preg_match($pattern, $html); //prints "1"
preg_match
searches text for a match to the regular expression given in
pattern (/
is pattern delimiter) and returns 1
if the pattern
matches given text, 0
if it does not, or false
if an error
occurred.
JavaScript example
In JavaScript, regular expressions (or regex
) are implemented as their own
type of object (such as the RegExp
object). These objects store patterns
and options and can then be used to test and manipulate strings.
var regex = new RegExp('<\/?h[1-6]>','ig'); //or var regex = /<\/?h[1-6]>/ig; regex.test('
Heading 1
'); //returns true
Regex meta (or special) characters
The $^*()+.?[\{|
punctuation letters are called meta characters which make
regular expressions work. Here is an overview of these special characters:
Pattern delimiter
In PHP, a delimiter can be any non-alphanumeric, non-backslash,
non-whitespace character. Often used delimiters are forward slashes /
, hash
signs #
and tildes ~
. The
following are equivalent:
<?php $pattern = "/\w+/"; //same as previous, but different delimiter $pattern = "~\w+~"; //same as previous, but different delimiter $pattern = "!\w+!"; //same as previous, but different delimiter $pattern = "#\w+#";
In JavaScript you would delimit regex with the /
(forward slash) character.
You also can use the global object RegExp
using the normal string escape
rules. The following are equivalent:
// Using delimiter var pattern = /\s+/; //Without delimiter, using RegExp object var pattern = new RegExp("\\s+");
Matching start or end of text
^
lets the recognition start at the beginning. If you write
^a
, the expression will match the letter “a
” only
if it appears at the very first character.
$
define where the pattern ends.
| Meta | Description |
|---|---|
^ |
Beginning of text |
$ |
End of text |
If you look for the word “hello”, the “h” must be at the
beginning, while “o” is at the end. To search this string exactly (and
nothing before and after), your pattern is /^hello$/
.
If the word you’re looking for is at beginning in the text, your pattern is
/^hello/
.
If the word you’re looking for is at the end in the text, your pattern is
/hello$/
.
If the word you’re looking for is anywhere in the text, the pattern is simply
/hello/
.
Quantifiers
*
, +
, ?
, {
, }
interprets
as quantifiers unless they are included in a character class. Quantifiers specify how
many instances of a character, group, or character class must be present in the input
for a match to be found.
| Meta | Description |
|---|---|
? |
Once or not at all (0 – 1) |
* |
Zero or more time (0 – ∞) |
+ |
One or more time (1 – ∞) |
{n} |
Exactly n times (where n is a number) |
{n, } |
At least n times (n – ∞) |
{ ,m} |
No or m times (0 – m) where m is a number |
{n,m} |
At least n but not more than m times |
Matching “no or one character”
?
represent no or one character (and is equivalent to
{0, 1}
).
/hurrah!?/
matches “hurrah
” and
“hurrah!
“
Matching “no or any number of characters”
*
represent no or any number of characters (and is
equivalent to {0, }
).
/hurrah!*/
matches “hurrah!
“,
“hurrah!!!
” and “hurrah
“
Matching “one or any number of characters”
+
represent one or any number of characters (and is
equivalent to {1, }
).
/hurrah!+/
matches “hurrah!
” and
“hurrah!!!
“
Matching minimum, or maximum, or exact number of occurrence
{ }
Quantifier or repetition marker, defines the character
before the braces. The range can be defined by numbers; if the start and the end are
given separately, the numbers are written with a comma {1,4}
.
{100}
Match exact number of characters. The
{100}
matches a string of 100 characters.
{1,4}
For variable repetition, we use the quantifier
{n,m}
, where n
is a non-negative integer and m
is
greater than n
. 0{1,4}
matches 0
character with
one to four digits (0, 00, 000 or 0000).
{0, 1}
matches zero or once and ?
does the
same as {0,1}
.
{1,}
Minimum number of characters. The quantifier
{n,}
allows for infinite repetition. {1, }
matches one or more
characters, and +
does the same. {0, }
matches zero or more
characters, and *
does the same.
{,4}
Zero or maximum number of characters.
/hurrah!{0,1}/
works similar to?
/hurrah!{0, }/
works similar to*
/hurrah!{1,}/
works similar to+
/hurrah!{3}/
matcheshurrah!!!
/hurrah!{0,2}/
matcheshurrah
,hurrah!
andhurrah!!
/hurrah!{1,2}/
matcheshurrah!
andhurrah!!
Groups
Parentheses ( )
are used to define groups in regular
expressions. You can use the set operators *, +, and ? in such a group, too. Groups show
how we can extract data from the input provided.
| Meta | Description |
|---|---|
() |
Capturing group |
(?<name>) |
Named capturing group |
(?:) |
Non-capturing group |
(?=) |
Positive look-ahead |
(?!) |
Negative look-ahead |
(?<=) |
Positive look-behind |
(?<!) |
Negative look-behind |
Character classes
[ ]
Character class, match only characters that listed in
the class. Defines one character out of group of letters or digits. [aeiou]
match either a, e, i, o or u. A hyphen -
creates a range when it is placed
between two characters. The range includes the character before the hyphen, the
character after the hyphen, and all characters that lie between them in numerical order.
See following examples:
| Meta | Description |
|---|---|
[0-9] |
Matches any digit. |
[a-z] |
Matches any small alphabet character. |
[A-Z] |
Matches any capital alphabet character. |
[a-zA-Z0-9] |
Matches any alphanumeric character. |
gr[ae]y |
Matches grey or gray but not graey. |
Negation (matching if specific character(s) not exist)
The caret ^
at the beginning of the class means
“No
“. If a character class starts with the ^
meta-character it will matches only those characters that not in that class.
| Meta | Description |
|---|---|
[^A-Z] |
matches everything except the upper case letters A through Z |
[^a-z] |
matches everything except the lowercase letters a through z |
[^0-9] |
matches everything except digits 0 through 9 |
[^a-zA-Z0-9] |
combination of all above mentioned examples |
Matching any character
The .
(dot) is a shorthand for a character class that matches any
character. If you want to search for a date, for example 08/08/2008 or 08-08-2008,
simply use \d{2}.\d{2}.\d{4}
.
\d{2}.\d{2}.\d{4}
matches 01-12-2017, 10/10/2017 or 12.04.2000
\d
is equivalent to[0-9]
.\d{2}
matches exactly two digits.\d{4}
matches exactly four digits.
Alternation, combine multiple regex
Logical OR
, the |
vertical bar, or pipe symbol, splits the
regular expression into multiple alternatives. School|College|University
matches School, or College, or University with each match attempt. Only one name matches
each time, but a different name can match each time.
/a|b|c/
matches a
, or b
, or c
with
each match attempt.
Escape characters \
\
(the backslash) masks metacharacters and special
characters so that they do no longer possess a special meaning. ˆ
and
$
are called metacharacters. If you want to look for a metacharacter as a
regular character, you have to put a backslash in front of it. For example if you want
to match one of these characters: $^*()+.?[\{|
, you should have to escape
that character with \
.
/\$[0-9]+/
will match $100
.
\$
, \^
will match $
and ^
The backslash itself is a metacharacter, too. If you look for the backslash in
particular, you write \\
.


Position
Office
Extn.
Start date
Salary
Edit / Delete
Position
Office
Extn.
Start date
Salary
Edit / Delete


Materialize: OptionBox Plugin
This plugin is an attempt to create an insanely light-weight user interface control that is not quite as intrusive as a modal state dialog, but allows more than just navigation functionality offered by most drop-down components. This plugin uses the Materialize user interface library.
Specifically, the people option box on this page contains an input element. You'll notice setting focus to the element does not hide the control. OptionBox allows fully interactive content inside its container.
Future Improvements
Right now the control only detects horizontal document collision. It would be ideal to have vertical collision as well where the OptionBox could be positioned above or to the side of trigger elements.
It would be great to able to add classes to OptionBox child elements that would trigger the box to close.