close

real player download gratis windows 7 portugues quicktime 3 64 bit download nokia battery monitor app download patient manager express free download The Cons: The book aims to become simple and brief, but idea too easy and brief. Yes I learned to discover the computer to accomplish this or that, but I would not fully find some good of the concepts. In fact, I think the novel moved on to fancy stuff like graphics before I got down all I needed on the basics like file control. Perhaps a person that already knew something about programming could have had less trouble. For example, the information on corresponding with a file stored around the hard drive for future use was fine, where it went. But I realized, when attemping to write a plan of my, that I would not understand heavily weighed. If you have recorded some data to data, and want to revise that data, Python rewrites your entire file. Huh? What about my original data? Read more Thank you for the feedback. Sorry, we did not record your vote. Please try again Python Programming by Michael Dawson is definitely a well written book created to enthuse amateur programmers in to the world of gaming programming. By the time you finish chapter 12 of the book you can be ready to design your own mini games much much like games you discover on apps on phones etc. For those of you who desire this immediate pleasure I have to say, this is the novel for you and disregard my poor rating. But for individuals who really need to get down to your nitty-gritty basics of python and create a solid knowledge of it, this is not the publication for you. So if youre a programmer who wants being a application designer one day, I say buy this book without delay - its fun. But if youre searching for a more formal method of programming and arent necessarily considering the gaming component of Python Programming continue reading. Let me show you why I think this book deserves only 3 stars. A bit of background, I started researching with particle physicists and astronomers within my school and programming python was much required so I decided I wanted a solid perception of creating basic python scripts. What I found themselves getting would have been a unorganized book that gave the impression to toss in information exclusively for the soul intent behind creating a game after each chapter. This was very bearable with the first 3-5 chapters but from then on I couldnt get to the single chapter and never having to scroll through multiple pages to locate what a certain thing does for the lack of structure. It also lacks direction, it explains enough to acquire through the chapter but doesnt allow you to spread your wings and grow creative with all the script, by this I mean that it helps you with the very basics and moves on without obtaining a bit creative while using code. Read more Thank you to your feedback. Sorry, we did not record your vote. Please try again Published 28 days ago by david j. blackstone Product received as advertised, and fast shipping. This book is awesome!! Michael passes through step by step what his code does. And its not dry as being a lot of computer books is usually. Read more Love this book! Great for anyone who desires to learn Python. Published a couple of months ago by JRv! Beyond that, this author uses packages including LiveWires and tkinter without telling how for getting them and Read more Published 4 months ago by N. Vadulam Books, books, -Prospero, the tempest Sunday September 16, 4:00 pm - Jam CLASS Nick Antonaccio Ryan Gaughan Mark Carson Sunday September 23, 4:00 pm - Jam CLASS Nick Antonaccio Ryan Gaughan Mark Carson Sunday September 30, 4:00 pm - Jam CLASS Nick Antonaccio Ryan Gaughan Mark Carson home/path/publichtml/rebol/rebol - cs REBOL title: Jam print content-type: text/html/print read ; print HTML HEAD TITLE Bulletin Board/TITLE /HEAD BODY bbs: load print center table border1 cellpadding10 width600 tr td center strong font size4 Please REFRESH this site to see new messages. /font /strong /center print-all: does print br hr font size5 Posted Messages: /font br hr foreach bb reverse bbs print rejoin BR Date/Time: bb/2 Name: bb/1 BR BR bb/3 BR BR HR submitted: decode-cgi system/options/cgi/query-string if submitted/2 none entry: copy append entry submitted/2 append entry to-string now 3:00 append entry submitted/4 append/only bbs entry save bbs print BR strong Your message may be added: /strong BR print-all print font size5 Post A New Public Message:/font hr FORM br Your Name: br input typetext size50 namestudent BR BR Your Message: br textarea namemessage rows5 cols50 /textarea BR BR INPUT TYPESUBMIT NAMESubmit VALUEPost Message /FORM /td /tr /table /center print read The default format for REBOL CGI information is GET. Data submitted with the GET method within an HTML form is displayed inside URL bar on the users browser. If you dont want users to view that data displayed, or if how much submitted information is larger then might be contained inside the URL bar of the browser, the POST method needs to be used. To work while using POST method, the action inside your HTML form needs to be: You need to use the read-cgi function below to decode the submitted POST data as part of your REBOL script. This example produces a password protected online text editor, with the automatic backup feature: home/path/publichtml/rebol/rebol - cs REBOL print content-type: text/html/print HTML HEAD TITLE Edit Text Document/TITLE /HEAD BODY ; submitted: decode-cgi system/options/cgi/query-string ; We cant utilize the normal line above to decode, because ; were utilizing the POST strategy to submit data because data ; in the textarea can get too big to the GET method. ; Use the next standard function to process data from ; a POST method instead: read-cgi: func/local data buffer switch system/options/cgi/request-method POST data: make string! 1020 buffer: make string! 16380 while positive? read-io system/ports/input buffer 16380 append data buffer clear buffer GET data: system/options/cgi/query-string data submitted: decode-cgi read-cgi ; if has become edited and submitted: if submitted/2 save ; save newly edited document: write to-file rejoin./submitted/6 submitted/4 print Document Saved. print rejoin META HTTP-EQUIVREFRESH CONTENT0; /folder/submitted/6 quit ; if user is only opening page, no data continues to be submitted ; yet, request user/pass: if submitted/2 none or submitted/4 none print strong W A R N I N G - Private Server, Login Required: /strong BR BR FORM Username: input typetext size50 namename BR BR Password: input typetext size50 namepass BR BR INPUT TYPESUBMIT NAMESubmit VALUESubmit /FORM quit ; check user/pass against those involved with, ; end program if incorrect: userlist: load folder: submitted/2 password: submitted/4 response: false foreach user userlist if first user folder and password second user response: true if response false print Incorrect Username/Password. quit ; if user/pass is alright, go ; backup before changes are produced: cur-time: to-string replace/all to-string now/time : - documenttext: read to-file rejoin./folder write to-file rejoin./foldernow/date cur-time documenttext ; note the POST method from the HTML form: prin strong Be certain to SUBMIT when done:/strong BR BR FORM methodpost INPUT TYPEhidden NAMEsubmitconfirm VALUEsave textarea cols100 rows15 namecontents ; ; The following line is what we wish to do, however it wont work with ; HTML documents that includes textarea s ; ; print documenttext ; ; The following line fixes the situation: ; prin replace/all documenttext /textarea lt/textarea gt; print /textarea BR BR print rejoin INPUT TYPEhidden NAMEfolder VALUE folder print INPUT TYPESUBMIT NAMESubmit VALUESubmit print /FORM print /BODY /HTML The following is really a generic form handler that is usually used to avoid wasting GET or POST data to your text file. Its a good replacement for generic form mailers, and definitely makes the data considerably more accessible later by other scripts: home/path/publichtml/rebol/rebol - cs REBOL print content-type: text/html/read-cgi: func/local data buffer switch system/options/cgi/request-method POST data: make string! 1020 buffer: make string! 16380 while positive? read-io system/ports/input buffer 16380 append data buffer clear buffer GET data: system/options/cgi/query-string data submitted: decode-cgi read-cgi print HTML HEAD TITLE Your Form Has Been Submitted/TITLE /HEAD BODY CENTER TABLE border0 cellPadding10 width80% TR TD entry: rejoinTime Stamp: form now 3:00foreach title value submitted entry: rejoin entry mold title mold valueappend entrywrite/append entry html: copy foreach title value submitted repend html TR TD width20% mold title /TD TD mold value /TD /TR print rejoin FONT size5 Thank You! The following information is submitted: /FONT BR BR Time Stamp: now 3:00 BR BR TABLE border1 cellPadding10 width100% html /TABLE BR To correct any errors as well as to submit forms for added people, please go through the BACK button inside your browser, make any changes, and resubmit the shape. Youll hear from us shortly. Thank you! BR BR CENTER FONT size1 Copyright 2009 This Web Site. All rights reserved./FONT /CENTER /TD /TR /CENTER /BODY /HTML quit Heres a simple form example that is certainly processed with the above script. You can add numerous text, textareas, as well as other form items as desired, as well as the script helps you to save all the submitted data the action link from the form below assumes the script above is saved inside the text file named : The following nearly identical script converts text data output by another script within the web site to WAP format, so it can be continue reading small cellphone browsers. Because WAP syntax can be a bit more strict than HTML, some HTML tags have to be removed replaced in the source script output. You should be careful to strip out unnecessary tags and characters in text formatted for display in cellphones. Most WAP browsers will surely display one if they encounter improperly formatted content: rebol276 - cs REBOL prin Content-type: //prin?xml version1.0 encodingiso-8859-1?prin !DOCTYPE wml PUBLIC - //WAPFORUM//DTD WML 1.1//EN print wml card id1 titleWap Page p prin replace/all read /BODY /HTML print /p /card /wml quit Heres much more useful version with the above script allowing users to specify the file for being converted, right within the URL of WAP page, detail script is in, and also the user wishes to read within their WAP browser, then this URL can be : foreach row read rejoin mysql://root:rootlocalhost/Contacts? SELECT from Contacts print row For a far more detailed explanation about how exactly to set up MYSQL, how you can us the SQL language syntax, and also other related topics, see section-27. For a helpful open source SQL database system created entirely in native REBOL, see Be bound to search for additional information and code relevant to databases. One oddity about Rebols GUI dialect is who's doesnt add a native strategy to create standard menus. Users typically click buttons or text choices directly in REBOL GUIs to generate selections. The request-list function along with the GUI choice widget are short and easy substitutes which offer menu-like functionality. The menu example shown earlier within this tutorial can be useful, nonetheless it doesnt look or operate from the typical way users expect. The popular REBOL GUI tool called RebGUI carries a simple facility for creating basic menus, which could be useful. For real menus with the many bells and whistles, animated icons, appropriate look-and-feel for assorted operating systems, and each possible display option, a module is created to simply provide that capability: Heres a minor example demonstrating its use: do-thru /library/scripts/menu-system.r menu-data: edit: item Menu menu item Item1 item Item2 simple-style: item style action alert item/body/text view center-face layout/size at 2x2 menu-bar menu menu-data menu-style simple-style 400x500 REBOL ; You can download the menu-system.r script to your hard disk: in any other case exists? %menu-system.r write %menu-system.r read /library/scripts/menu-system.r ; If youre packaging your program into file, be certain to ; range from the menu-system.r script within your package: do %menu-system.r ; Heres the way to create a menu layout: ; The menu-data block contains all of the top level menus. ; Items in everyone of those menus get into separate menu blocks. ; Submenus are just items using own additional menu blocks. ; Use - - for separator lines: menu-data: file: item File menu item Open item Save item Quit edit: item Edit menu item Item 1 item Item 2 ctrl-q - item menu item Submenu Item 1 item Submenu Item 2 item Submenu Item 3 menu item Sub-Submenu Item 1 item Sub-Submenu Item 2 - - item Item 3 icons: item Icons menu item Icon Item 1 icons item Icon Item 2 icons ; Each menu selection is now able to run any code you would like. ; Just make use of the switch structure below: basic-style: item style action switch item/body/text ; put any code you need, in each block: case Open the-file: request-file alert rejoin You opened: the-file case Save the-file: request-file/save alert rejoin You saved to: the-file case Quit if request/confirm Really Quit? true quit case Item 1 alert Item 1 selected case Item 2 alert Item 2 selected case Item 3 alert Item 3 selected case Submenu Item 1 alert Submenu Item 1 selected case Submenu Item 2 alert Submenu Item 2 selected case Submenu Item 3 alert Submenu Item 3 selected case Sub-Submenu Item 1 alert Sub-Submenu Item 1 selected case Sub-Submenu Item 2 alert Sub-Submenu Item 2 selected case Icon Item 1 alert Icon Item 1 selected case Icon Item 2 alert Icon Item 2 selected ; The following lines need being added to eliminate a prospective problem ; closing down: evt-close: func face event either event/type close quit event insert-event-func:evt-close ; Now placed the menu inside your GUI, as follows: view center-face layout size 400x500 ; make use of this stock code: at 2x2 menu-bar menu menu-data menu-style basic-style Below can be an intermediate example with explanations on the most important features. It also includes some stock code to show off menus using a standard MS Windows style OS specific appearance. The menu module may be compressed and embedded directly into your script, using compress read /library/scripts/menu-system.r so that this module does not need for being downloaded or included being a separate file: REBOLs built-in text-list GUI widget is a snap to use, nevertheless it can only display one column of internet data: REBOL is equipped with a built-in list widget for multiple column data grid displays, but its a little more complex make use of than the link-list widget. Earlier in this particular text, Henrik Mikael Kristensens listview module was introduced as being a simple solution for creating multiple column data grid displays. It is effective, but requires you to definitely include a alternative module. With a little knowledge and rehearse, youll learn that REBOLs built-in list widget may be very powerful and easy make use of. In its simplest form, the native list widget needs a size parameter, and a couple of additional block parameters: The size parameter is undoubtedly an XxY pair indicating the pixel size on the overall list widget. The GUI widget layout block is often a layout of ordinary VID widgets used to produce each row of data inside grid. The GUI elements within this block are replicated to show off each consecutive row of data within the grid. The GUI layout block typically offers the word across simply because widgets are used to come up with rows of internet data, and it also typically includes size parameters for every widget. The data block consists of rows of information being displayed inside grid. Each row of information is contained in an outside interior block: view layout list 220x100 across text 100 text 100 data row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 view layout list 200x100 across space 0 text red 100 text blue 100 data row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 The GUI block does not need for being comprised of only text fields. You can display the rows of knowledge on widgets from a type : view layout list 304x100 across space 0 button 150 button 150 data row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 IMPORTANT: You can make widgets inside the list perform actions, much like in another view layout code: view layout list 304x100 across space 0 button 150 alert face/text ; When clicked, alert the written text button 150 alert face/text ; contained about the buttons face. data row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 This shows that creating user editable cells is a snap - just reassign the text with the clicked face, then update the display: view layout list 304x92 across space 0 btn 150 face/text: request-text/default face/text show face btn 150 face/text: request-text/default face/text show face data row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 Unintentional visual artifacts may be caused with the caret cursor in text widgets. To eliminate them, simply focus and unfocus the widget after updating the display: Notice the number of rows contained inside data block does not affect the quantity of rows displayed. The list always shows numerous rows as will fit inside the overall pixel size from the widget well address this issue : view layout list 304x100 across space 0 button 150 button 150 data row 1, column 1 row 1, column 2 view layout list 304x100 across space 0 button 150 button 150 data row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 row 5, column 1 row 5, column 2 row 6, column 1 row 6, column 2 row 7, column 1 row 7, column 2 insert-event-func either event/type resize li/size: gui/size - 40x40 t1/size: t2/size: as-pair round li/size/12 19 show li unview view gui none event view/options gui: layout li: list 220x110 across t1: text 100 t2: text 100 data row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 resize gui-size: 220x110 li-size: 100x19 gui-block: li: list li-size across text first li-size2 ; 1/2 the width in the list widget text first li-size2 data row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 insert-event-func either event/type resize li-size: gui/size - 40x40 unview view/options gui: layout gui-block resize none event view/options gui: layout gui-block resize Of course, it is possible to assign a label to your properly formatted data block, and display it later in a very list widget: x: row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 view layout list 220x100 across text 100 text 100 data x Heres a resizable version from the script above, containing user editing enabled to the first column only: x: copy for i 1 12 1 some-info: copy append some-info pick system/locale/months i append some-info pick system/locale/days i append/only x some-info gui-size: 220x110 li-size: 100x19 gui-block: li: list li-size across text first li-size2 face/text: request-text/default face/text ; enable user edit show face focus face unfocus face text first li-size2 data x insert-event-func either event/type resize li-size: gui/size - 40x40 unview view/options gui: layout gui-block resize none event view/options gui: layout gui-block resize view layout the-list: list 304x100 across space 0 info 150 face/text: request-text/default face/text show face info 150 face/text: request-text/default face/text show face data row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 btn Display Current Data editor second second get within the-list subfunc This might be used just to save and load all data inside list to files, or elsewhere put make use of. That definitely makes the widget invaluable for data treating all types! Take a look at this script to determine one way in order to save and load data: x: copy row 1, column 1 row 1, column 2 row 2, column 1 row 2, column 2 row 3, column 1 row 3, column 2 row 4, column 1 row 4, column 2 do qq: view layout the-list: list 304x100 across space 0 info 150 face/text: request-text/default face/text show face info 150 face/text: request-text/default face/text show face data x across btn Save save to-file request-file/save second second get inside the-list subfunc show the-list btn Load x: copy load to-file request-file unview do qq display area do-events ; the vicinity widget Notice that this area widget above has built-in undo/redo features using CTRL-Z and CTRL-Y REBOLs native view layout area does not have any undo/redo capability. A built-in spellchecker will also be activated using CTRL-S! To makes use of the spellchecker, you should download a dictionary from /RebGUI/dictionary, and unzip it into /RebGUI/dictionary/or from the/dictionary subdirectory of wherever rebgui.r is found. do %rebgui.r ; be guaranteed to include the path, if needed display Pie Chart pie-chart data VID yellow 19 RebGUI red 81 do-events display Spreadsheet sheet options size 7x7 data a1 very a2 cool a3 join a1 a2 do-events display Chat chat data Nick blue I like RebGUI yellow 20-sep-2009/1:00 do-events display/maximize Menu menu data File Open request-file Save request-file About Info alert RebGUI is fantastic! do-events You can run the RebDoc.r program to determine the syntax required to utilize any from the other RebGUI widgets, requestors and operations. The/close refinement from the display function helps you to set any actions you desire to run any time a GUI window is banned. This can help avoid data loss from accidental window closure, and supplies a strategy to automatically process data or run other applications whenever a window is closed: display/close area question Really Close? do-events Be bound to try the request-ui requestor function. It permits you to easily adjust the worldwide settings for that overall look and feel of layouts made with RebGUI on your own machine. Settings are saved from the file, inside current working directory. These directives automatically set the primary size of any widget: L - align the correct hand edge on the widget with all the adjacent edge V - align the bottom edge on the widget while using adjacent edge O - align the left hand edge from the widget together with the adjacent edge adjacent edge could be the edge with the adjacent widget, or even the edge on the GUI, if you find no adjacent widget. These directives automatically adjust the scale and position of an widget if the GUI is resized: H - stretch or shrink the widget to install the window height W - stretch or shrink the widget to install the window width X x - move the widget x quantity of pixels to the correct Y y - move the widget y variety of pixels downward Heres a totally functional, resizable text editor application, with built-in undo/redo, spell checking, and close event handling: do %rebgui.r display/maximize/close Text Editor menu LHW data File Open x/text: read to-file request-file show x Save write to-file request-file/save x/text return x: area LHW question Really Close? do-events Now thats a wide range of program for only a little code! Heres an effective spreadsheet application, with save, load, print and data view features: do %rebgui.r display Spreadsheet x: sheet options size 3x3 widths 8 8 10 data A1 32 A2 12 A3 a1 a2 A4 1.06 to-integer a3 return button Save x/save-data save to-file request-file x/data button Load x/load-data load to-file request-file button View x/save-data alert form x/data button Print save/png to image! x browse ; or call do-events To really become familiar with RebGUI, explore its main object ctx-rebgui: The ctx-rebgui object is established much like REBOLs built-in system/view/vid object. You can explore it using path notation. Notice that built-in assistance is included inside the tip path of the widget: ctx-rebgui/widgets/tree/tip Be likely to read the main RebGUI user guide at, along with the cookbook at Then read through every one of the info in RebDoc.r, examine the code in tour.r, and become familiar with your way around ctx-rebgui. Youll likely learn that RebGUI may be the best option for GUI layout in most situations. Here is really a point of sale system sales checkout, receipt printer, and data storage system written using RebGUI. It should provide a volume of practical insights into the best way to use RebGUI. Note which the username and password info from the file needs to be created and look using another method, and encrypted. The example file is established here as being a demonstration. Note also that this first field within the layout was designed to accept input at a keyboard wedge bar code scanner, with data inside the format: item space booth space price inserted ENTER key character. Using this format, and also the automatic refocus upon entry, an individual can continually scan multiple items into your system: REBOL title: POINT OF SALE SYSTEM write username password username2 password2 ; etc. make-dir %./receipts/write/append ; create file otherwise exists unless exists? %schemehaschanged write decompress 789C9552CB92A3300CBCE72BBCDCA18084995A7E652A078115F08EB129592C33 7FBFC24E32CC2387A5EC2A49ED6EB56C267845E5BB3FD8F32FF57250F2CD3060 ABEAA629E23E95B1CAF8C6AD7A3A1571A5D28813E6D60CA32055752AAAE67751 97CF3B5003BDB6EA5817CF821E9B8804067E484BE04F34BFB035EE4EACCB5371 DD9FE044AD8E4FC5751FCE6AFA3E648FD6B62A51516F035731BE78B7B9AAEF49 3EE2D5693A3CC02CCD63B8F5DB8CC464021A8CBB49066B3492901EB4879E8D77 B92C74BC1D7CD1E467992DB0D8319CA28B41ABE53D42583D691566E31C521438 7F9161E844241276780F84BCC117DF2F410E480E7BFCBDB7A697FA407E99F3CE BF493787568511919588E631DF5146131F602FFA1F8645B1437D35A2BA85D93B F5317A8C9810BF5DC240E6A1F0CF374CE4D790B31F507E45B9E10BD8801122D0 6633DEEC5E3CFB8BA4C14176AF6D936540066CA6B2DE2F649094C35532361386 EC0B270D18660B61CC355A78BFFD53ECBD6533DF8A655BCA4AD08A9D366E905E 4C4B72B71AA7FDDA2AE71D1ECEFF004BE40F38A0030000 do /rebgui.r do login: userpass: request-password if length? userpass 2 quit posp-database: to-block read logged-in: false foreach user posp-database if userpass/1 user/1 and userpass/2 user/2 logged-in: true either logged-in true alert Incorrect Username/Password do login calculate-totals: does tax:.06 subtotal: 0 foreach item booth price pos-table/data subtotal: subtotal to decimal! price set-text subtotal-f subtotal set-text tax-f round/to subtotal tax.01 set-text total-f round/to subtotal subtotal tax.01 set-focus barcode add-new-item: does if copy f1/text or copy f2/text or error? try to-decimal copy f3/text alert trim/lines You must enter an appropriate Item Description, Booth Number, and Price. return pos-table/add-row/position reduce copy f1/text copy f2/text copy f3/text 1 calculate-totals print-receipt: does if empty? pos-table/data alert Theres not even attempt to print. return html: copy rejoin html head title Receipt/title /head body table width40% border0 cellpadding0 tr td h1 Business Name/h1 123 Road St. br City, State 98765 br 123-456-7890 /td /tr /table br br center table width80% border1 cellpadding5 tr td width60% strong Item/strong /td td width20% strong Booth/strong /td td width20% strong Price/strong /td /tr foreach item booth price pos-table/data append html rejoin tr td width60% item /td td width20% booth /td td width20% price /td /tr append html rejoin tr td width60% /td td width20% strong SUBTOTAL: /strong /td td width20% strong copy subtotal-f/text /strong /td /tr append html rejoin tr td width60% /td td width20% strong TAX: /strong /td td width20% strong copy tax-f/text /strong /td /tr append html rejoin tr td width60% /td td width20% strong TOTAL: /strong /td td width20% strong copy total-f/text /strong /td /tr append html rejoin /table br Date: strong now/date /strong, Time: strong now/time /strong, Salesperson: userpass/1 /center /body /html write/append to-file saved-receipt: rejoin %./receipts/now/date replace/all copy form now/time : - userpass/1 html browse saved-receipt save-receipt: does if empty? pos-table/data alert Theres nothing to avoid wasting. return if allow-save false unless true resaving: question trim/lines This receipt has been saved. Save again? if true question Print another copy on the receipt? print-receipt return if resaving true resave-file-to-delete: copy display/dialog Delete compose text 150 trim/lines IMPORTANT - DO NOT MAKE A MISTAKE HERE! Since youve made changes with an existing receipt, you MUST DELETE the main receipt. The original receipt are going to be REPLACED from the new receipt The original data will probably be saved in the audit history file, and often will not appear in almost any future seaches or totals. Please CAREFULLY choose the initial receipt to DELETE: return tl1: text-list 150 data Im making changes into a NEW receipt that I JUST SAVED Im making changes in an OLD receipt that Ive RELOADED resave-file-to-delete: tl1/selected hide-popup return button - 1 Cancel resave-file-to-delete: copy hide-popup if resave-file-to-delete resaving: false return if resave-file-to-delete trim/lines Im making changes with a NEW receipt that I JUST SAVED the-file-to-delete: saved-file if resave-file-to-delete trim/lines Im making changes in an OLD receipt that Ive RELOADED the-file-to-delete: loaded-receipt or else question to-string the-file-to-delete return write read write/append rejoin newline newline newline to-string the-file-to-delete newline newline look at the-file-to-delete delete the-file-to-delete alert Original receipt may be deleted, and new receipt saved. resaving: false if true question Print receipt? print-receipt saved-data: mold copy pos-table/data write/append to-file saved-file: copy rejoin %./receipts/now/date replace/all copy form now/time : - userpass/1 saved-data splash compose size: 300x100 color: sky text: rejoinSAVED/saved-filefont: ctx-rebgui/widgets/default-font wait 1 unview allow-save: false if true question Clear and initiate new receipt? clear-new load-receipt: does if error? try loaded-receipt: to-file request-file/file/filter %./receipts alert Error selecting file return if find form loaded-receipt deleted alert Improper file selection return if error? try loaded-receipt-data: load loaded-receipt alert Error loading data return insert clear pos-table/data loaded-receipt-data pos-table/redraw calculate-totals allow-save: false search-receipts: does search-word: copy request-value/title Search word: Search ; if search-word none return found-files: copy foreach file read %./receiptsif find read join %./receipts/file search-word if suffix? file and file append found-files file if empty? found-files alert None found return found-file: request-list Pick information to open found-files if found-file none return insert clear pos-table/data load loaded-receipt: copy to-file join %./receipts/found-file pos-table/redraw calculate-totals allow-save: false clear-new: does if allow-save true unless true question Erase without saving? return foreach item barcode f1 f2 f3 subtotal-f tax-f total-f do rejoin clear item/text show item clear head pos-table/data pos-table/redraw allow-save: true change-appearance: does request-ui if true question Restart now with new scheme? if allow-save true if false question Quit without saving? return write %schemehaschanged launch %pos.r ; EDIT quit title-text: Point of Sale System if system/version/4 3 : load/library get-tb-focus: make routine! return: int GetFocus set-caption: make routine! hwnd int a string! return: int SetWindowTextA show-old::show show: func face show-old face hwnd: get-tb-focus set-caption hwnd title-text allow-save: true resaving: false saved-file: loaded-receipt: screen-size: system/view/screen-face/size cell-width: to-integer screen-size/1ctx-rebgui/sizes/cell cell-height: to-integer screen-size/2ctx-rebgui/sizes/cell table-size: as-pair cell-width to-integer cell-height2.5 current-margin: ctx-rebgui/sizes/margin top-left: as-pair negate current-margin negate current-margin display/maximize/close POS at top-left L main-menu: menu data File Print print-receipt Save save-receipt Load load-receipt Search search-receipts Options Appearance change-appearance About Info alert trim/lines Point of Sale System. Copyright 2010 Nick Antonaccio. All rights reserved. return barcode: field LW tip Bar Code parts: parse/all copy barcode/text set-text f1 parts/1 set-text f2 parts/2 set-text f3 parts/3 clear barcode/text add-new-item return f1: field tip Item f2: field tip Booth f3: field tip Price do NOT include sign add-new-item set-focus add-button add-button: button - 1 Add Item add-new-item set-focus add-button button - 1 OX Delete Selected Item remove/part find pos-table/data pos-table/selected 3 pos-table/redraw calculate-totals return pos-table: table table-size LWH options Description center.6 Booth center.2 Price center.2 data reverse panel sky XY data after 2 text 20 Subtotal: subtotal-f: field text 20 Tax: tax-f: field text 20 TOTAL: total-f: field reverse button - 1 XY Lock do login button - 1 XY New clear-new button - 1 XY SAVE and PRINT save-receipt do set-focus barcode question Really Close? do-events PDF can be a standard extendable used to produce and print document content in exactly the same on different computer platforms. In Windows as well as other operating systems, the PDF reader by Adobe can often be installed automatically. Other free PDF readers including Foxit, Sumatra, and PDF-Xchange allow that you view and print PDF documents. Openoffice could be used to produce, convert, and save various document formats MS Word and also other word processor formats to PDF, in order that they are viewable/printable inside the exact same visual layout, on any computer. Gabriele Santilli has established a REBOL pdf-maker script that generates universally readable and printable PDF files right from REBOL code. The official documentation can be acquired at the REBOL source accustomed to create that PDF document is accessible at /soft/Misc/pdf-maker-doc.r. Pdf-maker.r can be a complete, self contained multi-platform solution for creating PDFs. No other software is instructed to create PDFs with REBOL. The basic functionality of pdf-maker.r is simple. Import pdf-maker.r using the do function or simply just include it directly as part of your code. Next, run the layout-pdf function, that can one block to be a parameter, and write its output to file while using write/binary function. Inside the block passed towards the layout-pdf function, a range of formatting functions is usually included to layout text, images, and manually generated graphics. Heres an elementary example on the format, with one particular text layout function: do /soft/Misc/pdf-maker.r write/binary layout-pdf textbox Hello PDF world! ; To open the created document within your default PDF viewer: call Heres a much more complex example that generates a multi-page PDF file and demonstrates many with the basic capabilities of Separate page content is within separate sub-blocks. All coordinates are designed in MILLIMETER format: REBOL title: pdf-maker example do /soft/Misc/pdf-maker.r write/binary layout-pdf compose/deep page size 215.9 279.4 ; American Letter Size!!! textbox Here is the first page. It just contains this text. textbox 55 55 90 100 Heres page 2. This text box boasts a starting XxY position along with an XxY size. Coordinates will be in millimeters and extend in the BOTTOM LEFT with the page this box extends from place to start 55x55 and is also 90 mm wide, 100 mm tall. NOTE ABOUT PAGE SIZES - IMPORTANT!!! All the next page sizes would be the default ISO A4, or 211Ч297 mm. That is SLIGHTLY SMALLER compared to the standard American Letter page size. If you are printing on American Letter sized paper, be likely to manually set your paper size, along with done about the first page of the example. textbox 0 200 200 50 center font Helvetica 10.5 This is page 3. The text inside this box is centered and formatted using Helvetica font, having a character size 10.5 mm. apply rotation 20 translation 35 150 textbox 4 4 200 20 This is page 4. The textbox is rotated 20 degrees and translated moved over 35x150 mm. Graphics and images may also be rotated and translated. textbox 5 200 200 40 Heres page 5. It contains this textbox and lots of images. The first image lies at beginning 50x150 and is particularly 10mm wide by 2.4mm tall. The second image is 2x bigger and rotated 90 degrees. The last image is positioned at beginning 100x150 and it is streched to 10x its size. Notice that this ENTIRE layout block has become evaluated with compose/deep to guage the images from the following parentheses. image 50 150 10 2.4 system/view/vid/image-stock/logo image 50 100 20 4.8 rotated 90 system/view/vid/image-stock/logo image 100 150 100 24 system/view/vid/image-stock/logo textbox This page contains this textbox and many generated graphics: a line, a colored and filled box which has a colored edge, along with a circle. line width 3 20 20 100 50 ; starting and ending XxY positions solid box edge width 0.2 edge 44.235.77 150.0.136 100 67 26 16 circle 75 50 40 ; beginning 75x50, radius 40mm call The compose/deep evaluation is important when using computed values in PDF layouts. Take a look on the following example that utilizes computed coordinates and image values: do /soft/Misc/pdf-maker.r xpos: 50 ypos: 200 offset: 5 size: 5 width: 10 size height: 2.4 size page1: compose/deep image xpos offset ypos offset width height system/view/vid/image-stock/logo write/binary layout-pdf page1 call Here is a software program that I wrote for guitar students. It prints out fretboard note diagrams that may be cut out, wrapped around, and taped straight away to guitar fretboards of specific varied sizes. The pdf-maker script is roofed in compressed, embedded format: Flash can be a ubiquitous multimedia format accustomed to deliver graphics, sound, video, games, and entire web sites about the Internet. Flash has already been installed on over 90% of the computers connected on the Internet. It is available like a small free plugin for every single major browser, at /flashplayer. There are many different other flash players available which may display Flash formatted files on mobile phones, on desktop systems, and around the web. Flashs ubiquity, power, and comprehensive multimedia features causes it to become a popular platform for rich media development, especially online. Flash was originally created through the Macromedia company, and is also now belonging to Adobe. Adobes Flash CS4 development package is definitely an expensive and high development environment which has a significant learning curve, and it also requires proficiency inside Actionscript language. There are many other commercial and open source offerings that may be used to make files, some those are oriented to earning simple animations with moving text effects, graphic sweeps, pans, fades, etc. CS4 is usually a fantastically powerful tool a standard, however for many Flash development needs, you will be happy to learn that you just dont must venture beyond the REBOL world. REBOLers their very own own Flash creation tool available, which can be freely downloadable and which does not need any additional languages or development tools to build rich files. Just perform the REBOL/flash script at /hmm/rswf/rswflatest.r, and youve got an effective Flash development system when you need it. Using REBOL/flash is not difficult. The following 3 lines demonstrate the fundamental process of installing the dialect DOing the REBOL/flash script file, compiling a downloaded REBOL/flash source code file, then viewing the file as part of your browser: do /hmm/rswf/rswflatest.r ; install REBOL/flash make-swf/save/html /yhex2cf ; compile the origin browse ; comprehend the To begin their day with REBOL/flash in earnest, youll wish to save a copy with the REBOL/flash dialect to your disk drive: write %rswf.r read /hmm/rswf/rswflatest.r Monday: 3 student1, 555-1234, parents names, payment history, notes 3:30 student2, 555-1234, parents names, payment history, notes 4 gone 3-17 student3, 555-1234, payment history, notes 4:30 student4, 555-1234, parents names, payment history, notes 5 student5, 555-1234, parents names, payment history, notes Tuesday: 3 - - 3:30 - - 4 john doe 3-18 - - 4:30 - - 5 student1, 555-1234, parents names, payment history, notes 5:30 student2, 555-1234, parents names, payment history, notes 6 student3, 555-1234, parents names, payment history, notes 6:30 - - 7 student4, 555-1234, parents names, payment history, notes 7:30 - - 8 student5, 555-1234, parents names, payment history, To run my offer, I wanted to generate the above schedule format over a web page, and frame it in a HTML document that have some permanent info which teachers wouldnt alter. I wanted each teacher to get able to create adjustments to their schedule and never have to mess with ftp or anything having to do together with the web site. I just wanted them to become able to click a desktop icon, type changes within their schedule, and also have it appear with a web page. I imagined a straightforward application that could do them, and developed this basic outline of how it may work: Download a teachers current schedule text file. Backup a copy with the existing schedule, in the event that. Upload the altered schedule data back for the website. Include the revolutionary schedule text inside an HTML template, retaining the correct line format. Confirm which the changes were made correctly and that they displayed correctly for the web page. Keep the teacher interface easy and intuitive, like writing with a piece of paper. After looking on the above outline, I just did each step above within the most direct way you can in REBOL code: first set I some initial required variables: url: /teacher ftp-url: /publichtml/teacher and gave the teacher some instructions: alert Edit your schedule, then click save and quit. The website will likely be automatically updated. ; 1 download the file containing the schedule text: write read rejoin url ; 2 produce a timestamped backup around the web server: write rejoin ftp-urlnow/date now/time read ; 3 and 7 edit the writing: editor ; 4 save the edited text back for the web site: write rejoin ftp-url read ; 6 confirm the changes are displayed correctly: browse url To satisfy step 5 inside outline, I made a downloadable executable file in the above program using XpackerX, and uploaded it on the web site. In the /teacher folder about the web site, I created an script containing the next code: home/path/publichtml/rebol/rebol - cs REBOL print content-type: text/html/print a targetblank Download Scheduler/a br print rejoin pre read /pre The first HTML line results in a download link, so that this teacher can download and run his scheduler program at any remote location. The second line includes the preformatted schedule text for the web page. I can put another HTML I want on this site, that the teacher never touches their contact details, lesson rates, information regarding vacation dates, varieties of students they need to teach, etc. What may have been a very long and involved database programming task was accomplished within minutes, and was adopted every day for most months within the business. The free form format enabled by by using a simple text file provided the chance to incorporate various notes, changes, and info that could otherwise be awkward to add or tricky to emphasize within a database type scheduling app. In this case, writing the pseudo code outline provided an instant solution, and yes it worked out to become the best approach to satisfy our needs. Youll see later how I built this essence into a a lot more complex application which runs a fast paced business of 25 instructors. When putting together the online world site for my music lesson business, I wanted to regularly add photos of students performing at various events. At first, I just uploaded the photos individually, and added a link towards the folder that contained them. As the collection grew, I wanted users to view the images easier, while not having to click on everyone file name. So, I put together a fairly easy flash presentation that showed the photos one by one. But updating that presentation needed to much maintenance. What I wanted ended up being to simply upload photos, and have absolutely them all display in the nice format over a single webpage, with virtually no required maintenance. This style of small CGI application was perfectly fitted to REBOL. It only took a number of minutes to create, and it also now gets used everyday. For the offer, heres the outline and pseudo code I worked through around my head: Start by developing a simple command line script on my small home computer that reads a directory listing and runs on the foreach loop to run from the files and perform necessary actions. Within the foreach loop, pay attention to specified image types extensions in each file name, and simply work with those files. Add a counter to produce the total quantity of images. To do this, make use of a counter variable and increment it each time with the loop. In the foreach loop, wrap each image inside the list inside the HTML tags instructed to disply them with a web page. Add necessary headers to build a CGI script that runs about the web site. The script should print the HTML to your visitors browser in order that they see a website containing all of the images. REBOL folder: read %. foreach file folder print file ; this is definitely a dummy action to become sure the loop is functional halt For vehicle, I added the counter variable, and checked for specified image types employing an if any conditional expression: I shortened that script a lttle bit by employing an alternate version which will depend on nested foreach loops. The alternate code definitely makes the list of potential image types simpler to extend from the future: REBOL folder: read %. count: 0 foreach file folder foreach ext if find file ext print file count: count 1 print rejoin newline Total Images: count halt For the final step, I borrowed a line in the earlier guitar chord diagram maker example. It builds the HTML required to show off each image on the web page. I replaced the dummy print function above using this code: Finally, I added the standard CGI headers and page formatting code required for making REBOL CGI scripts perform correctly understand the previous CGI examples in this particular tutorial for similar patterns: home/path/publichtml/rebol/rebol - cs REBOL title: Photo Viewer print content-type: text/html/print HTML HEAD TITLE Jam Session Photos/TITLE /HEAD BODY print read folder: read %. count: 0 foreach file folder foreach ext if find file ext print BR CENTER print rejoin img src file print /CENTER count: count 1 print BR print rejoin Total Images: count print read I uploaded that script to your folder containing images on our web server, and updated the link on the photos on our internet site. Now, we simply upload new images directly on the server, and when web page visitors select the Photos link on our site, they instantly experience a dynamically created webpage full coming from all images currently found in that folder. In my opportunity, teachers often should figure the volume of days which might be between any two given dates. I can achieve that easily together with the REBOL interpreter - just subtract anybody date from another. For the unfortunate souls who don't realize REBOL, I wanted to produce a little GUI app that may quickly figure the calculation by incorporating simple pointing and clicking. This application finished up being inbuilt stages. I started using this very simple pseudo-code idea for any script: Use the request-date function to obtain a start date from your user. Assign the response with a variable. I would occasionally click personal files accidentally while browsing, so I added the next line to confirm whether the code above should often be run: if request Edit/view this file? true perform code above I have several sites that I update regularly. It could well be easy to simply copy this script a couple of times, and change the tough coded FTP information for each and every web site, but I wanted a far more elegant solution. I decided to provide a mechanism to avoid wasting and load FTP info for just about any website, inside a config file. First I made a button inside GUI to save lots of FTP info for any site. Heres the thought procedure for what should happen once the button is clicked: Use a text requester to question the user with the FTP info. Ill save it in URL format, united line, the way its typed into your GUI text field. Use the actual FTP URL typed to the text field since the default text from the requester. To avoid a blunder, hold on there if the person cancels out with the requester, doesnt enter anything. Use folders requester to ask the person for a text file in order to save the info to default to. Add another error check to produce sure the consumer has actually selected information. If the file doesnt exist, create it by writing the FTP URL line to your new file. If the file does exist, append the FTP URL line towards the existing file. Alert the user how the operation is complete. As always with REBOL, all of those steps is exceedingly simple: btn Save URL url: request-text/title/default URL to avoid wasting: p/text if url none break config-file: to-file request-file/file/save if url none and config-file %none otherwise exists? config-file write/lines config-file write/append/lines config-file to-url url alert Saved Now I need a control button to load saved URLs. Heres the idea process: Use an either condition to evaluate if the file exists. If the file doesnt exist, notify the person that they ought to first save URLs with a config file. If the file does exist, have an individual select the desired FTP information through the file one URL line from your file. An easy way to make this happen is while using request-list function. Ill load each line inside config file in a block work with a foreach loop to learn and append each line inside file into a new block, and display that list using the request-list function. When the consumer selects a line from your list, Ill copy the selected distinctive line of text towards the GUI text list the initial text field on this program, containing the FTP information. Again, thats all very an easy task to do: I added an emphasis function to your end with the above button code, so that this user can just hit their ENTER answer to connect to your server after choosing a URL from your config file. It makes sense that quite a few users would have Load URL, Save URL, and Connect buttons, so I also chose to add an outside Connect button for the GUI. Since clicking around the text field and clicking around the button both perform the same thing, I developed a connect function, to ensure that code wouldnt need for being duplicated inside action block of everyone of those GUI widgets. In that function I added a mistake check, so which the program doesnt crash if the person types in incorrect FTP information: As I tested the code, I realized which it would be far better to increase the size with the text list plus the text field, making sure that I could view your entire FTP URL along with the listed file/folder names. 600x350 pixels is successful fits on screens with low resolution, but is very large enough to view full file paths. This is how this program looks now: As I used this system more, I recognized several additional essential features which were required. I needed to get able to: upload/download binary files, create new folders, delete, copy, rename, change permissions, and find info about existing files. I just added buttons on the existing GUI to implement every one of those features. Heres my thought process and also the code which does everyone of those things: To receive the file size and date from a selected file, I just used the scale? and modified? functions constructed into REBOL: btn Get Info p-file: to-url rejoin p/text f/picked alert rejoin Size: size? p-file Date: modified? p-file To delete an active file, I simply use REBOLs built-in delete function. I added a requester to confirm how the user actually desires to delete the selected file. When the operation is complete, the directory is important listing is updated and also the user is notified through an alert message: btn Delete p-file: to-url request-text/title/default File to delete: join p/text f/picked if confirm: request Are you sure? true delete p-file f/data: sort append read to-url p/text./show f if confirm true alert File deleted Renaming personal files is just as simple, while using rename function. Again, I just added a confirmation request and notification when complete: btn Rename new-name: to-file request-text/title/default New File Name: to-string f/picked if confirm: request Are you sure? true rename to-url join p/text f/picked new-name f/data: sort append read to-url p/text./show f if confirm true alert File renamed btn Copy new-name: to-url request-text/title/default New Path: join p/text f/picked if confirm: request Are you sure? true write/binary new-name read/binary to-url join p/text f/picked f/data: sort append read to-url p/text./show f if confirm true alert File copied btn New File p-file: to-url request-text/title/default New File Name: join p/text if confirm: request Are you sure? true write p-file f/data: sort append read to-url p/text./show f if confirm true alert Empty file created - click to edit. keys: open/binary/no-wait scheme: console forever in any other case none? wait/all keys:00:00.01 switch to-string to-char to-integer copy keys k print you pressed k l print you pressed l ; print nothing pressed ; ensure its working Next, I integrated the above mentioned code to the loop created earlier to go the shape around the screen. Notice that I added a conditional if, being executed when either k or l keystrokes are encountered. It checks the horizontal bounds dont go beyond your 5-30 positions. That keeps the shapes inside horizontal boundaries on the playing field. Also, notice the variable old-xpos is employed to hold the position on the shape that needs to get erased: Its coming along well: Now I need being able to spin the shapes around. Heres some pseudo code to prepare my thoughts: Watch with the O key to become pressed. That are going to be the keycode to perform the shape spinning code. Create some conditionals to cycle with the list of rotated shapes in connection with the current shape. For example, in the event the current shape variable r is number 12, next the rotated versions of the shape are numbers 11-14. With each press with the O key, replace the variable r while using next shape because list. That logic must wrap around, another shape after 14 needs to be 11. Instead of utilizing a block set of shapes to achieve this, I decide to make use of a switch structure to individually map each shape on the one it will rotate to similar to if shape r is 14, turn shape r into 11 - achieve that explicitly for each and every shape. I have already got some code to see for keystrokes, so Ill try the past part on the above outline first: Wait a sec - that helps to make the shapes rotate clockwise from 11 check out 12, 14 to 11, etc. I prefer for the crooks to rotate counterclockwise 11 to 14, 14 to 13, etc. Heres the revised code: Now add the letter O on the list of keys for being watched, and run the above mentined code when its pressed. Also create an old-r variable to support the number from the shape that needs for being erased. Since anyone changes shapes after the existing one may be printed, we ought to keep track of which to erase: The shapes are moving correctly now, but theres still a large amount of work to become done. The first line in the last section with the overall game outline reads: If is very important touches the bottom in the playing field, allow it to become lock in to the grid of other shapes which may have already fallen. Right now the pieces all just fall to several stopping points inside playing field based on their height, plus they dont stack on top of each and every other. Heres some pseudo code to mend that: I need for being aware from the highest coordinate in each column around the playing field. When the overall game starts, the very best coordinate in most column in the playing field is row 30 the flat bottom line that creates up the field. Ill store everyone of these coordinates in a very block called floor. I also need being aware on the lowest coordinate in each column in the currently falling shape. Ill produce a block called edge to hold on to those coordinates referring for the lower edges from the shape. Those coordinates will define the job of each with the lowest points inside currently falling shape, regarding its top left point the pos coordinate. Every time the contour falls one position on the screen, add each on the edge coordinates to your pos coordinate. If any of the coordinates is position higher compared to floor coordinate within the same column, then stop moving that shape break out on the for loop that definitely makes the shape fall. Use a foreach loop to cycle over the current coordinates within the relevant columns of the block, using a comparison check around the floor and edge coordinates in each column. When a shape finishes its drop on the screen, calculate the newest highest position inside columns it occupies the coordinates in the top character in each column, to make those changes to your block to hold high point information. To do this, Ill need to create a top block to hold on to the relative positions with the highest coordinates within the shape, and add them for the height with the current coordinates from the appropriate columns. Ill start off simply, just getting each fit around lay flat about the floor from the playing field row 30. For the moment, all I should do is make a block of floor coordinates signifying that net profit: Next, Ill define some lower coordinates for every single shape, and store them in a very nested block structure comparable to the earlier shape block. 0x0 refers for the same coordinate as pos 0 positions to the correct, and 0 positions down from pos. 0x10 is certainly one position to the appropriate, and 1x0 is position down. I look with the visual representations on the shapes again to come up using the list: So, the relative coordinates on the low points fit and healthy 3, one example is, are called edge/3. Heres some sample code to indicate how I can refer to your bottom points in different shape utilizing a foreach loop. The code pos position refers to your low edge in each column: To verify that any of people edges are touching the soil, make use of a foreach loop to cycle from the current coordinates from the relevant columns of the block, using a comparison check around the floor and edge coordinates in each column. Heres some sample code to flesh out and test that idea: Now lets integrate this technique to the existing code. Well utilize a new variable halt to break out in the loop that drops the contour, if your current shape touches the ground: This works, but theres a bug. If the piece may be spun around while using the O key, the newest foreach loop does not stop the piece from falling. Thats for the reason that foreach loop only cycles from the coordinates in the edge/r block. If the consumer flips the form around, the r value gets changed before this code runs. The easiest solution to fix this issue is to simply repeat the foreach loop while using edge/old-r block. This is undoubtedly an inefficient quick hack, but Im offering this late at night - and theres some value to declaring bad coding practice - so I choose to work with that solution. I produce a promise to myself to come up with a far more elegant solution Note to self: every coding solution is implemented, changes are harder to produce, and bad code typically remains I need being careful about using quick hacks. Heres the latest code: Next, I elect to test the present program for other bugs. Ive been keeping separate text files containing each of the code changes I make as I complement. Every time I make, test, and change a chunk of code, I save the modern trial version that has a new filename and version number. I save each version, just in order that I dont permanently erase old code with each change - it might be potentially useful. My current working version is currently 19. I noticed throughout this debugging session that shape 1 still breaks with the right side with the wall. I could change that by adjusting the xpos Now I can check in the event the shape is in the right boundary, while using revised code below: That check also needs being performed anytime the O key's pressed we dont want the form breaking out on the wall gets hotter spins. I make the above mentined changes to my current version with the program, and also the problems are fixed. The game is absolutely starting to take shape! Now we need for making the shapes stack on top of each and every other. Earlier, I wrote these outline thoughts: each time a shape finishes its drop around the screen, calculate the brand new highest position within the columns it occupies the coordinates from the top character in each column, to make those changes on the block maintain high point information. To accomplish that, Ill need for making a top block to keep the relative positions with the highest coordinates within the shape, and add them for the height in the current coordinates inside appropriate columns. Sounds like Ill must loop through some columns to generate the changes for the floor. To produce the top block I look with the visual representations of every shape just as before, accessible up having a coordinate list representing the high points inside the shape, relative on the top left coordinate. Its much like the edge block: The shape finishes its drop about the screen over the previous foreach loops we created, in like manner calculate the brand new highest positions inside columns occupied from the shape, I first have to determine which shape was the very last one about the screen r or old-r. The quick hack I made earlier is actually coming to bite me a little - I now need to generate duplicates of the changes that happen in both foreach loops: stop-shape-num: r ; or stop-shape-num: old-r, depending about the foreach loop stop: true break Now for making the changes for the floor block, I loop throughout the columns occupied with the piece, setting each from the top characters within the shape to become the high coordinates inside the respective columns on the floor. The poke function lets me replace the main coordinates inside floor block using the new coordinates. Those changes are designed just before breaking out from the loop that drops the form: if stop true ; find the left-most column the very last shape occupies: left-col: second pos ; get the amount of columns the design occupies: width-of-shape: length? compose top/stop-shape-num ; get the correct most column the design occupies: right-col: left-col width-of-shape - 1 ; Loop through each column occupied through the shape, ; replacing each coordinate from the current column ; on the floor using the new high coordinate: counter: 1 for current-column left-col right-col 1 add-coord: compose top/stop-shape-num/counter new-floor-coord: pos add-coord -1x0 poke floor current-column new-floor-coord counter: counter 1 break The new stacking code works, but theres a design flaw. If I maneuver a shape into an unoccupied space directly underneath any high point within the floor, without first touching the high point because column, the piece doesnt stop. Furthermore, in the event it happens, it changes the modern high point for the bottom in the column that your current shape occupies. I realize here that what I should mark are not only found the high points within the floor, and also every additional coordinate about the screen that includes a character. This is only as very easy to accomplish. Instead of changing the actual coordinates from the floor block while using poke function: just add the brand new coordinates on the list using append. That will keep track of the points from which a character is printed around the screen: That fixes the condition above, but Ive also remarked that if I move a shape sideways into an empty position within the floor, the characters sometimes still overlap inappropriately. Thats since the top and edge blocks only mark the biggest and lowest points in each shape. It strikes me since I could just combine the two blocks into one, marking each of the coordinates occupied using a shape. Heres the newest block - I it is known as oc, short for occupied: I remove the highest and edge blocks, and replace all code references for many years with oc. Below would be the code to the classic Snake game. The point on the snake game is always to move a snake image throughout the screen, devouring a food pellet that appears arbitrarily locations. Every time you consume a pellet, your snake body grows by one unit. Avoid punching the edge with the playing field, and get away from hitting your individual body as long as possible. Embed the pictures needed to produce snake sections and food pellets for this example, I used simple green and red button images created while using to-image and layout functions, but that might be easily changed. Set some initial variables starting score, random starting coordinates, initial values for flags used throughout this program, etc. Create a board block to keep the image data and coordinates with the snake sections and food images. Display the playing board in the view layout draw block, and move hands per hour along by continuously checking for feel engage serious amounts of key events. Change the direction the snake moves anytime a secret's pressed. Adjust snake coordinates move the snake section images, and adjust the score, each time a timer event occurs 15 times per second. As inside ski game, develop a temporary block to repeat and adjust all of the new snake coordinates move the head in the snake to your new adjacent location, then move each consecutive section from the snake to your previous location of their adjoining section. Check for collisions by comparing coordinate positions from the snake sections with items about the board. End the game in the event the snake collides using a wall, or itself. Whenever the snake collides having a food image, move your food image to your new random coordinate, and convey a new snake section image on the board append an image for the board block, to raise the length on the snake. Just to keep things interesting, I created an obfuscated unreadable version in the snake program. REBOL is certainly a malleable language that the possible to produce unbelievably compact code. I was capable of squash the aforementioned 2030 bytes of nicely formatted code into your following 771 bytes of pure REBOL fury: dop::append u::reduce k::pick r::random y::layout q: image z::if g::to-image v::length? x: doesalert joinSCORE: v bquits: g y/tight btn red 10x10o: g y/tightbtn tan 10x10d: 0x10 w: 0 r/seed now b: uq or 19x19 10 50x50q sr 19x19 10 50x50view center-face y/tightc: area 305x305 effectdraw brate 15 feelengage: funcf a ez a keyd: select uup 0x-10 down 0x10 left - 10x0 right 10x0e/keyz a timez anyb/6/1 0 b/6/2 0 b/6/1 290 b/6/2 290xz findat b 7b/6xz within? b/6 b/3 10x10p b uq slast bw: 1 b/3:r 29x29 10n: copy/part b 5 p nb/6 dfor i 7v b1 eithertype?k b i pair!p n k bi - 3p n k b iz w 1clearback tail np nlast bw: 0b: copy n show cdofocus c The above code can be a fully functional snake program don't wait, paste it in to the. I created it by renaming functions using single-letter labels r::random, p::append, etc. Any function that was utilized several times from the program got renamed. I also removed any spaces which surrounded parentheses or brackets. Line breaks are included only so the code fits inside this webpage - otherwise, theyre not essential. Theres almost no practical purpose to obfuscating code within this way, but it might be used to impress your friends who have no idea REBOL: Below is surely an extremely simple variation in the classic Space Invaders game idea. Compare the code outline with this program with that on the previous games, and notice again the similar structure: embedded image definitions, game board block creation, view layout draw display, feel engage key and time event loops, coodinate calculations to relocate game images and also to detect collisions, etc. Notice also the system/view/caret: none and system/view/caret: head f/text code before each show scrn. This erases the written text caret small vertical line that appears in the face whenever the main focus function is known as: I designed a version on this game for my fiance utilising an image of my face for ship1, with an image of her face as alien1. An XpackerX executable version of it can be acquired at Now come out from coding, and play a number of games: This research study started each time a reader of the tutorial sent me a message question. He was having trouble setting up a simple script that will load the file names at a directory on his hard disk drive into a GUI text list. He wanted for being able to click files within the list so that you can play the sounds. I generally do not have time to respond to your questions like that, but this one became a quicky. The following code switches to your Windows media folder, reads the directory is important listing, and displays the file names inside a GUI text list: change-dir %/c/Windows/media view layout text-list data read %. I just added the contents from the play-sound function found earlier on this tutorial, to your action block with the text list. This loads the contents with the value selected within the text list the file name, and plays the sound: change-dir %/c/Windows/media view layout vh2 Click a File to Play: text-list data read %. wait 0 sound-port: open sound://insert sound-port load value wait sound-port close sound-port A week later your reader emailed me for a lot of additional help. As it stands, the script crashes if the consumer selects anything aside from file, or if another file is selected while is now playing. I wrote back by incorporating code to find the text list showing files and to create the program wait to try out another file. I also wrote some additional code to allow users pick a different starting directory. Here it is: Heres how to makes use of the request-dir function to let anyone ; opt for a folder to modify into: start-dir: request-dir/dir %/c/Windows/media change-dir start-dir ; To display only files that has a extension within your text list, ; produce a new empty block. Use a foreach loop to go with the ; directory listing, and append to your new block only file names ; which have because the suffix: waves: foreach file read %. if suffix? file append waves file ; Now it is possible to display the waves block of data within the GUI text list. ; To wait for sounds to end playing before another file can ; be selected, include a wait-flag variable on the play-sound ; function. When a sound starts playing, set the wait-flag ; variable to true. When its finished playing, set the wait-flag ; to false. Also be guaranteed to set it initially to false at ; the starting of your program: play-sound: func sound-file wait 0 wait-flag: true ring: load sound-file sound-port: open sound://insert sound-port ring wait sound-port close sound-port wait-flag: false wait-flag: false ; When information is selected from your text list, only run the ; play-sound function in the event the wait-flag variable just isn't ; set to true, if no sounds are playing: view layout vh2 Click a File to Play: text-list data waves if wait-flag true play-sound value As I tested the aforementioned code, I pointed out that a few files within the Windows media folder wouldnt play properly, and also the script crashed. I added these code to deal with errors: if error? try play-sound value alert malformed wave ; Alert the user which has a message, close sound-port ; close the port opened through the broken wait-flag: false ; play-sound function, as well as set the flag ; to false so other waves can begin to play. I also decided to feature a button on the GUI permitting users to change your directory at will, instead of just on the beginning from the script: btn Change Folder change-dir request-dir waves: copy foreach file read %. if suffix? file append waves file file-list/data: waves show file-list At this time, weve got a pleasant playing application: REBOL play-sound: func sound-file wait 0 wait-flag: true ring: load sound-file sound-port: open sound://insert sound-port ring wait sound-port close sound-port wait-flag: false wait-flag: false change-dir %/c/Windows/media waves: foreach file read %. if suffix? file append waves file view layout vh2 Click a File to Play: file-list: text-list data waves if wait-flag true if error? try play-sound value alert malformed wave close sound-port wait-flag: false btn Change Folder change-dir request-dir waves: copy foreach file read %. if suffix? file append waves file file-list/data: waves show file-list This was posted online, and within several days several readers asked precisely the same question: How do I understand to 3 files?. REBOL cannot natively play mp3s, and we need to make use of an external tool for making that happen. Earlier within the tutorial, I included example that plays mp3 files, but I wanted a somewhat more industrial strength solution. I chosen to give the recognized LAME mp3 encoder/decoder trying. I downloaded the compiled Windows version of LAME from, and compressed version of it while using binary resouce embedder found earlier within this tutorial. For the sake of saving space with this tutorial, I uploaded the compressed, embedded code to The following line writes the program to your current directory of your hard disk drive: do /reboltutorial/lame.r ; 250k download To use our media player program without needing to download anything, simply placed the above lame.r code directly inside your script. Once youve got on your harddrive, you are able to use it to a few files files while using format: I added the road above to my existing program, and changed the waves block-building foreach routine to three files: and you get the next parsed-block, as intended: First Name Last Name Street Address City, State, Zip Parse is commonly utilized to convert spreadsheet data into REBOL blocks. In Excel, Open Office, along with spreadsheet programs, you may export every one of the columns of information in a worksheet by saving it as being a CSV formatted comma separated text file. People often put various waste descriptive text, labels and column headers into spreadsheets to create them more readable: The following code turns the exported CSV spreadsheet data in to a nice useable REBOL block, with group heading data included with each line: You are able to use parse to evaluate whether any specific data exists inside of a given block. To accomplish that, specify the rule matching pattern because the item youre looking for. Heres a sample: Both lines above evaluate to true since they match exactly. IMPORTANT: By default, once parse discovers something that doesnt match, the whole expression evaluates to false, EVEN when the given rule IS found one or more times from the data. For example, these is false: But thats just default behavior. You can control how parse responds to items which dont match. Adding the text below into a rule will return true in the event the given rule matches the data from the specified way: parse apple orange any string! parse apple orange some string! parse apple orange 1 2 string! You can cause rules offering multiple match options - just separate the choices using a character and enclose them in brackets. The following is true: parse apple orange any string! url! number! You can trigger actions that occur whenever a rule is matched. Just enclose those things in parentheses: parse apple orange any string! alert The block posesses a string. url! number! You can skip through data, ignoring chunks until you receive to, or past a particular condition. The word to ignores data UNTIL the condition is available. The word thru ignores data until JUST PAST the condition can be found. The following is true: parse 234.1 50 apple thru string! The real worth of pattern matching is which you can try to find and extract data from unformatted text, in a organized way. The word copy is utilized to assign a flexible to matched data. For example, the subsequent code downloads the raw HTML on the REBOL homepage, ignores everything except whats between HTML title tags, and displays that text: The following code extends the example above to offer the useful feature of displaying the external ip address in the local computer. It reads, parses out of the title text, and parses that text again to come back only the IP number. The local network address can also be displayed, while using built in dns protocol in REBOL : Heres a good example that removes all comments from the given REBOL script any part of your line that begins having a semicolon ;: code: read to-file request-file parse/all code any to ; begin: thru newline ending: remove/part begin index? ending - index? begin:begin editor code For more to do with parse, see this links: With REBOL s view layout VID dialect it is possible to easily build graphic user interfaces including buttons, fields, text lists, images along with GUI widgets, however it is not meant to address general purpose graphics or animation. For that purpose, REBOL has a built-in draw dialect. Various drawing functions allow you for making lines, boxes, circles, arrows, and virtually any shape. Fill patterns, color gradients, and effects of sorts might be easily put on drawings. Implementing draw functions typically involves building a view layout GUI, that has a box widget thats used since the viewing screen. Effect and draw functions are then put into the box definition, as well as a block is passed on the draw function containing more functions that basically perform here is your chance of various shapes along with other graphic elements from the box. Each draw function takes a suitable set of arguments for your type of shape created coordinate values, size value, etc. Heres a rudimentary example in the draw format: view layout box 400x400 effect draw line 10x39 322x211 ; line is often a draw function Color is usually added to graphics with all the pen function. Shapes could be filled with color, with images, and to graphic elements with all the fill-pen function. The thickness of drawn lines is set together with the line-width function: view layout box 400x220 effect draw fill-pen 200.100.90 polygon 20x40 200x20 380x40 200x80 fill-pen 200.130.110 polygon 20x40 200x80 200x200 20x100 fill-pen 100.80.50 polygon 200x80 380x40 380x100 200x200 gradmul 180.180.210 60.60.90 Drawn shapes are automatically anti-aliased lines are smoothed, but that default feature may be disabled: Animations could be created with draw by changing the coordinates of image elements. The fundamental process will be as follows: Assign a thing label on the box in that this drawing develops the word scrn is used within the following examples. Create a brand new draw block in that your characteristics from the graphic elements position, size, etc. are changed. Assign the revolutionary block to yourlabel/effect/draw, scrn/label/draw: changed draw block in this particular case. Display the changes using a show yourlabel function, show scrn with this case. view layout scrn: box 400x400 black effect draw circle 200x200 20 btn Move scrn/effect/draw: circle 200x300 20 ; replace the block above show scrn

2015 python programming absolute beginner pdf free download

Thank you for your trust!