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 602 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 48 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 30 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 37 2   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 38 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 32 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 36 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 44 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 43 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 30 3   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 30 4   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 31 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 32 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 40 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

  • QUERY, SET, ROWS 165 4 5 6 Alex Bob Carl With the argument distinct=True, you can specify that you only want to select distinct records. This has the same effect as grouping using all specified fields except that it does not require sorting. When using distinct it is important not to select ALL fields, and in particular not to select the "id" field, else all records will always be distinct. Here is an example: 1 2 3 4 5 for row in db().select(db.person.name, distinct=True): print row.

    pdf10p yukogaru14 30-11-2010 30 3   Download

  • SQLFORM 195 1 2 3 4 5 6 7 8 9 def display_manual_form(): form = SQLFORM(db.person) if form.accepts(request.vars, formname='test'): response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' else: response.flash = 'please fill the form' return dict() and insert the form in the associated "default/display manual form.html" view: 1 2 3 4 5 6 7 8 {{extend 'layout.html'}} Your name is Notice that the action does not return the form because it does not need to pass it to the view. The view contains a form created manually in HTML.

    pdf10p yukogaru14 30-11-2010 30 3   Download

  • CRUD 215 1 def data: return dict(form=crud()) would expose the following URLs: 1 2 3 4 5 http://.../[app]/[controller]/data/tables http://.../[app]/[controller]/data/create/[tablename] http://.../[app]/[controller]/data/read/[tablename]/[id] http://.../[app]/[controller]/data/delete/[tablename] http://.../[app]/[controller]/data/select/[tablename] However, the following action: 1 2 def create_tablename: return dict(form=crud.create(db.tablename)) would only expose the create method 1 http://...

    pdf10p yukogaru14 30-11-2010 28 3   Download

  • REMOTE PROCEDURE CALLS 255 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 simple todo application simple todo application type a new task to insert in db, click on existing task to delete it This view just executes the Pyjamas code in "static/output/todoapp". Code that we have not yet created. Fifth, in "static/TodoApp.py" (notice it is TodoApp, not todoApp!), enter the following client code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18...

    pdf10p yukogaru14 30-11-2010 43 3   Download

  • THE AJAX FUNCTION 275 and the associated "default/one.html" view: 1 2 3 4 5 {{extend 'layout.html'}} This allows for more articulated responses than simple strings. Auto-completion Another application of the above ajax function is auto-completion. Here we wish to create an input field that expects a month name and, when the visitor types an incomplete name, performs auto-completion via an Ajax request. In response, an auto-completion drop-box appears below the input field.

    pdf10p yukogaru14 30-11-2010 42 3   Download

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

Đồng bộ tài khoản