Applied microsoft .net framework programming

Xem 1-20 trên 37 kết quả Applied microsoft .net framework programming
  • The Microsoft .NET Framework introduces many new concepts, technologies, and terms. My goal in this chapter is to give you an overview of how the .NET Framework is architected, introduce you to some of the new technologies the framework includes, and define many of the terms you’ll be seeing when you start using it. I’ll also take you through the process of building your source code into an application or a set of redistributable components (types) and then explain how these components execute....

    pdf1p doxuan 03-08-2009 598 311   Download

  • JYTHON 315 Even though web2py runs with Jython out of the box, there is some trickery involved in setting up Jython and in setting up zxJDBC (the Jython database adaptor). Here are the instructions: • Download the file "jython installer-2.5.0.jar" (or 2.5.x) from Jython.org • Install it: 1 java -jar jython_installer-2.5.0.jar • Download and install "zxJDBC.jar" from http://sourceforge.net/projects/zxjdbc/ • Download and install the file "sqlitejdbc-v056.jar" from http://www.zentus.

    pdf10p yukogaru14 30-11-2010 43 4   Download

  • WEB2PY WEB2PY Enterprise Web Framework / 2nd Ed. Massimo Di Pierro Copyright ©2009 by Massimo Di Pierro. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc.

    pdf10p yukogaru14 30-11-2010 28 3   Download

  • MODEL-VIEW-CONTROLLER 5 In this simple example, the HTML page structure is represented programmatically by the HTML, BODY, and H1 objects; the database db1 is queried by the select command; finally, everything is serialized into HTML. This is just one example of the power of web2py and its built-in libraries. web2py does even more for the developer by automatically handling cookies, sessions, creation of database tables, database modifications, form validation, SQL injection prevention, cross-site scripting (XSS) prevention, and many other indispensable web application tasks.

    pdf10p yukogaru14 30-11-2010 36 2   Download

  • LAMBDA 35 1 2 file = open('myfile.txt', 'w') file.write('hello world') Similarly, you can read back from the file with: 1 2 3 file = open('myfile.txt', 'r') print file.read() hello world Alternatively, you can read in binary mode with "rb", write in binary mode with "wb", and open the file in append mode "a", using standard C notation. The read command takes an optional argument, which is the number of bytes. You can also jump to any location in a file using seek. You can read back from the file with read 1 2 3 print file.seek(6) print file.

    pdf10p yukogaru14 30-11-2010 29 4   Download

  • HTTP AND REDIRECT 115 4.11 HTTP and redirect web2py defines only one new exception called HTTP. This exception can be raised anywhere in a model, a controller, or a view with the command: 1 raise HTTP(400, "my message") It causes the control flow to jump away from the user’s code, back to web2py, and return an HTTP response like: 1 2 3 4 5 6 7 8 9 HTTP/1.1 400 BAD REQUEST Date: Sat, 05 Jul 2008 19:36:22 GMT Server: CherryPy/3.1.0beta3 WSGI Server Content-Type: text/html Via: 1.1 127.0.0.

    pdf10p yukogaru14 30-11-2010 34 4   Download

  • OTHER OPERATORS 175 6.10 Other Operators web2py has other operators that provide an API to access equivalent SQL operators. Let’s define another table "log" to store security events, their timestamp and severity, where the severity is an integer number. 1 2 3 db.define_table('log', Field('event'), Field('timestamp', 'datetime'), Field('severity', 'integer')) As before, insert a few events, a "port scan", an "xss injection" and an "unauthorized login". For the sake of the example, you can log events with the same timestamp but with different severities (1, 2, 3 respectively).

    pdf10p yukogaru14 30-11-2010 28 4   Download

  • FORM 185 Hidden fields When the above form object is serialized by {{=form}}, and because of the previous call to the accepts method, it now looks like this: 1 2 3 4 5 6 7 your name: Notice the presence of two hidden fields: " formkey" and " formname". Their presence is triggered by the call to accepts and they play two different and important roles: • The hidden field called " formkey" is a one-time token that web2py uses to prevent double submission of forms. The value of this key is generated when the form is serialized and stored in...

    pdf10p yukogaru14 30-11-2010 34 4   Download

  • CHAPTER 9 SERVICES The W3C defines a web service as “a software system designed to support interoperable machine-to-machine interaction over a network”. This is a broad definition, and it encompass a large number of protocols not designed for machine-to-human communication, but for machine-to-machine communication such as XML, JSON, RSS, etc. web2py provides, out of the box, support for the many protocols, including XML, JSON, RSS, CSV, XMLRPC, JSONRPC, AMFRPC. web2py can also be extended to support additional protocols.

    pdf10p yukogaru14 30-11-2010 40 4   Download

  • CONTENTS xi 6.14 7 Table Inheritance 179 181 182 185 186 186 187 188 189 189 193 194 195 197 198 198 200 200 201 202 203 210 211 212 213 214 215 216 217 218 220 220 223 225 227 228 Forms and Validators 7.1 FORM Hidden fields keepvalues onvalidation Forms and redirection Multiple forms per page No self-submission SQLFORM Insert/Update/Delete SQLFORM SQLFORM in HTML SQLFORM and uploads Storing the original filename Removing the action file Links to referencing records Prepopulating the form SQLFORM without database IO SQLFORM.

    pdf10p yukogaru14 30-11-2010 34 3   Download

  • ACKNOWLEDGMENTS 15 1.9 Acknowledgments web2py was originally developed by and copyrighted by Massimo Di Pierro. The first version (1.0) was released in October, 2007. Since then it has been adopted by many users, some of whom have also contributed bug reports, testing, debugging, patches, and proofreading of this book.

    pdf10p yukogaru14 30-11-2010 32 3   Download

  • TYPES 25 For user-defined classes, str and repr can be defined/redefined using the special operators str and repr . These are briefly described later on; for more, refer to the official Python documentation [38]. repr always has a default value. Another important characteristic of a Python string is that, like a list, it is an iterable object. 1 2 3 4 5 6 7 for i in 'hello': print i h e l l o list The main methods of a Python list are append, insert, and delete: 1 2 3 4 5 6 7 8 9 10 a = [1, 2, 3] print type(a)...

    pdf10p yukogaru14 30-11-2010 27 3   Download

  • FORM SELF-SUBMISSION 55 1 2 3 4 5 6 7 def first(): form = FORM(INPUT(_name='visitor_name', requires=IS_NOT_EMPTY()), INPUT(_type='submit')) if form.accepts(request.vars, session): session.visitor_name = form.vars.visitor_name redirect(URL(r=request, f='second')) return dict(form=form) where we are saying that the FORM tag contains two INPUT tags. The attributes of the input tags are specified by the named arguments starting with underscore. The requires argument is not a tag attribute (because it does not start by underscore) but it sets a validator for the value of visitor name.

    pdf10p yukogaru14 30-11-2010 34 3   Download

  • AN IMAGE BLOG 65 The first thing to notice is that a view is pure HTML with special {{...}} tags. The code embedded in {{...}} is pure Python code with one caveat: indentation is irrelevant. Blocks of code start with lines ending in colon (:) and end in lines beginning with the keyword pass. In some cases the end of a block is obvious from context and the use of pass is not required. Lines 5-7 loop over the image rows and for each row image display: 1 LI(A(image.title, _href=URL(r=request, f='show', args=image.id)) This is a ... tag that contains an ... tag which contains the...

    pdf10p yukogaru14 30-11-2010 27 3   Download

  • A WIKI 75 66 67 68 69 70 71 pattern = '%' + request.vars.keyword.lower() + '%' pages = db(db.page.title.lower().like(pattern))\ .select(orderby=db.page.title) items = [A(row.title, _href=URL(r=request, f=show, args=row.id)) \ for row in pages] return UL(*items).xml() Lines 2-6 provide a comment for the index action. Lines 4-5 inside the comment are interpreted by python as test code (doctest). Tests can be run via the admin interface. In this case the tests verify that the index action runs without errors. Lines 19, 33, and 43 try fetch a page record with the id in request.args(0).

    pdf10p yukogaru14 30-11-2010 24 3   Download

  • MORE ON ADMIN 85 [EDIT] You have used the [EDIT] page already in this chapter. Here we want to point out a few more functionalities of the [EDIT] page. • If you click on any file name, you can see the content of the file with syntax highlighting. • If you click on edit, you can edit the file via a web interface. • If you click on delete, you can delete the file (permanently). • If you click on test, web2py will run tests. Tests are written by the developer using Python doctests, and each function should have its own tests. • View...

    pdf10p yukogaru14 30-11-2010 30 3   Download

  • REQUEST 105 Helpers 1 2 3 4 5 6 7 XML, URL, BEAUTIFY A, B, BODY, BR, CENTER, CODE, DIV, EM, EMBED, FIELDSET, FORM, H1, H3, H3, H4, H5, H6, HEAD, HR, HTML, IFRAME, IMG, INPUT, LABEL, LI, LINK, OL, UL, MENU, META, OBJECT, ON, OPTION, P, PRE, SCRIPT, SELECT, SPAN, STYLE, TABLE, TD, TAG, TBODY, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, XHTML Validators 1 2 3 4 5 IS_ALPHANUMERIC, IS_DATE, IS_DATETIME, IS_EMAIL, IS_EXPR, IS_FLOAT_IN_RANGE, IS_IMAGE, IS_INT_IN_RANGE, IS_IN_SET, IS_IPV4, IS_LENGTH, IS_LOWER, IS_MATCH, IS_NULL_OR, IS_NOT_EMPTY, IS_TIME, IS_URL, IS_UPLOAD_FILENAME, IS_LIST_OF, ...

    pdf10p yukogaru14 30-11-2010 38 3   Download

  • EXECUTION ENVIRONMENT 125 models and controllers are designed to be executed in a prepared environment that has been prepopulated with web2py global objects (request, response, session, cache and T) and helper functions. This is necessary because Python is a statically (lexically) scoped language, whereas the web2py environment is created dynamically. web2py provides the exec environment function to allow you to access models and controllers directly.

    pdf10p yukogaru14 30-11-2010 38 3   Download

  • HTML HELPERS 135 CODE This helper performs syntax highlighting for Python, C, C++, HTML and web2py code, and is preferable to PRE for code listings. CODE also has the ability to create links to the web2py API documentation. Here is an example of highlighting sections of Python code. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 print CODE('print "hello"', language='python').xml() 1.print "hello" Here is a similar example for

    pdf10p yukogaru14 30-11-2010 33 3   Download

  • PAGE LAYOUT 145 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 {{=response.title or request.application)}} {{include 'web2py_ajax.html'}} [Here goes the header] {{if response.menu:}} {{=for _name, _active, _link in response.menu:}}

    pdf10p yukogaru14 30-11-2010 38 3   Download

CHỦ ĐỀ BẠN MUỐN TÌM

Đồng bộ tài khoản