Skip to main content

Home/ Python Programming/ Group items tagged in

Rss Feed Group items tagged

Jac Londe

HTTP referer - Wikipedia - 0 views

  • is an HTTP header field that identifies the address of the webpage (i.e. the URI or IRI) that linked to the resource being requested. By checking the referer, the new webpage can see where the request originated.
  • In the most common situation this means that when a user clicks a hyperlink in a web browser, the browser sends a request to the server holding the destination webpage. The request includes the referer field, which indicates the last page the user was on (the one where they clicked the link). Referer logging is used to allow websites and web servers to identify where people are visiting them from, for promotional or statistical purposes.[1]
  • ^ Kyrnin, Jennifer (2012-04-10). "Referrer - What is a Referrer - How do HTTP Referrers Work?". About.com. Retrieved 2013-03-20.  Jump up ^ Hallam-Baker, Philip (2000-09-21). "Re: Is Al Gore The Father of the Internet?". alt.folklore.computers. Retrieved 2013-03-20.  Jump up ^ Fielding, Roy (1995-03-09). "Re: Referer: (sic)". ietf-http-wg-old. Retrieved 2013-03-20.  Jump up ^ "Hypertext Transfer Protocol -- HTTP/1.1 (RFC 2616 § 14.36)". IETF. June 1999. Retrieved 2013-03-20. "The Referer[sic] request-header field allows the client to specify […] the address (URI) of the resource from which the Request-URI was obtained […]"  ^ Jump up to: a b "Network.http.sendRefererHeader". MozillaZine. 2007-06-10. Retrieved 2013-03-20.  Jump up ^ "HTML DOM Document referrer Property". w3schools.com. Retrieved 2013-03-20.  Jump up ^ Gundersen, Bret (2011-10-19). "The Impact of Google Encrypted Search". Adobe Digital Marketing Blog. Retrieved 2013-03-20.  Jump up ^ "HTML Techniques for Web Content Accessibility Guidelines 1.0: The META element". W3C. 2000-11-06. Retrieved 2013-03-20.  Jump up ^ "Hypertext Transfer Protocol -- HTTP/1.1: Encoding Sensitive Information in URI's (RFC 2616 § 15.1.3)". IETF. June 1999. Retrieved 2013-03-20. "Clients SHOULD NOT include a Referer[sic] header field in a (non-secure) HTTP request if the referring page was transferred with a secure protocol"  Jump up ^ "4.12 Links — HTML Living Standard: 4.12.5.8 Link type "noreferrer"". WHATWG. 2013-03-20. Retrieved 2013-03-20.
reckoner reckoner

Plotting NaNs in Matplotlib (matplotlib-users) - 0 views

  • Your example works as you describe on recent matplotlib versions. I suspect you are using an old one. The preferred way of handling missing points in numpy, and therefore in matplotlib and pylab, however, is via masked arrays.import pylabimport numpy as npfrom numpy import maa = [1,2,3,4,5]b = np.array([6,2,np.nan,1,9])bm = ma.masked_where(np.isnan(b), b)pylab.plot(a,bm)pylab.show()There are many other examples of masked array use in the examples directory of the matplotlib distribution.EricFernando Abilleira wrote:> Dear sourceforge community,> > I come from a Matlab environment so I am used to plotting matrices that > contain NaN elements. This is very useful because in some cases one > doesn't have data for the entire matrix. If one tries plotting the data, > the NaN elements won't be plotted.
reckoner reckoner

Huffman coding in Python - Program - Python - Builder AU - 0 views

  • In our last article on compression we showed you how to demonstrate run time encoding in Python. In this article we'll show you how to implement another kind of compression, Huffman encoding, which is useful when dealing with small sets of items, such as character strings.
utkarsh11111

What tasks do remote python developers execute as a freelancer? - 1 views

Python freelancers are the back-end development magicians. Businesses expect them to work not only on coding but also on multiple tasks. The tasks can differ and vary depending on the industry and ...

python programming developer

started by utkarsh11111 on 16 Dec 21 no follow-up yet
reckoner reckoner

Lightweight Approach to AOP (aspect-oriented programming) in Python - 0 views

  • aspects.py library provides means to intercept function calls. Functions and methods (also in Python standard library and third party code) can be wrapped so that when they are called, the wrap is invoked first. Depending on the wrap, the execution of the original function can be omitted, or the function can be called arbitrarily many times. Wraps are able to modify the arguments and the return value of the original function. In the terminology of aspect-oriented programming, the library allows applying advices (wraps) to call join points of methods and functions in around fashion.
  •  
    aspect-oriented programming
reckoner reckoner

Siva Chandran P: TermEmulator 1.0 Released!!! - 0 views

  • The module comes with a demo application which is written in wxWidgets. The demo emulates any terminal program inside a text box. The following are the screenshots of emulating bash, emacs and vi using TermEmulator and the demo. successfully emulated(ran in a text box) bash, emacs, vi and some other terminal programs.
  • Provides callback for updating terminal screen
  •  
    I'm hoping this means that you can access the items in the terminal window via an external Python script..
reckoner reckoner

dbtxt (page 43) python database module - 0 views

  • I wrote dbtxt because I needed a small, flat database in a python environment that didn't depend upon any external libraries. Most libraries are contaminated with the GPL, and this needed to be OK for commercial distribution without any complications. So that's what we have here - a complete (though small) database system that depends on nothing at all other than the Python language and its internal libraries. The entire database comes in at about 20k bytes (that's right, "k", not hundreds of k or megabytes) and I was able to implement all the functions I needed. So I was happy. Will you be happy? Well, download it and read the docs and see what you think. The download, zipped, is about 13k. Yep. 13k. :-) By all means, if you have a need for the same kind of thing, feel free to make any use of dbtxt you please. I have released it as PD, so you can use it in projects that are commercial, GPL, BSD, PD, private, government... whatever you like. Below you'll find a basic description taken from beginning of the docs; in the archive you'll download there is complete documentation, two sample databases, a test program and the database engine itself.
reckoner reckoner

Charming Python: Inside Python's implementations - 0 views

  • To attempt to explain it in the simplest terms, a continuation is a representation, at a particular point in a program, of everything the program is capable of doing subsequently. A continuation is a potential that depends on initial conditions. Rather than loop in a traditional way, it is possible to invoke the same continuation recursively with different initial conditions. One broad claim I have read is that continuations, in a theoretical sense, are more fundamental and underlie every other control structure. Don't worry if these ideas cause your brain to melt; that is a normal reaction.
reckoner reckoner

ASPN : Python Cookbook : Permutation and Combination Enumerator - 0 views

  • def comb(items, n=None): if n is None: n = len(items) for i in range(len(items)): v = items[i:i+1] if n == 1: yield v else: rest = items[i+1:] for c in comb(rest, n-1): yield v + c
  • def perm(items, n=None): if n is None: n = len(items) for i in range(len(items)): v = items[i:i+1] if n == 1: yield v else: rest = items[:i] + items[i+1:] for p in perm(rest, n-1): yield v + p
  • Permutation and Combination Enumerator
reckoner reckoner

pyscripter - PyScripter Development Site - 0 views

  • PyScripter is a free and open-source Python Integrated Development Environment (IDE) created with the ambition to become competitive in functionality with commercial Windows-based IDEs available for other languages. Being built in a compiled language is rather snappier than some of the other Python IDEs and provides an extensive blend of features that make it a productive Python development environment. 
  •  
    PyScripter is a free and open-source Python Integrated Development Environment (IDE) created with the ambition to become competitive in functionality with commercial Windows-based IDEs available for other languages. Being built in a compiled language is r
reckoner reckoner

Psyco - Introduction - 0 views

  • In short: run your existing Python software much faster, with no change in your source. Think of Psyco as a kind of just-in-time (JIT) compiler, a little bit like what exists for other languages, that emit machine code on the fly instead of interpreting your Python program step by step. The difference with the traditional approach to JIT compilers is that Psyco writes several version of the same blocks (a block is a bit of a function), which are optimized by being specialized to some kinds of variables (a "kind" can mean a type, but it is more general). The result is that your unmodified Python programs run faster. Benefits 2x to 100x speed-ups, typically 4x, with an unmodified Python interpreter and unmodified source code, just a dynamically loadable C extension module. Drawbacks Psyco currently uses a lot of memory. It only runs on Intel 386-compatible processors (under any OS) right now. There are some subtle semantic differences (i.e. bugs) with the way Python works; they should not be apparent in most programs.
reckoner reckoner

Debugging Python in VIM- Peter's Blog - 0 views

  • Following my thoughts yesterday, here are some VIM python scripts to add python breakpoint and debugging features to VIM. With this set up the F7 key will set a breakpoint on a line of code, Shift-F7 will remove all breakpoints and Shift-F12 will execute a script in the python debugger. This only runs on windows as far as I know, because it uses the 'start' command to launch the debugger in a seperate process without VIM waiting for it to finish. This allows you to look through the source code (and fix it) while the debugging is still in progress.
reckoner reckoner

Charming Python: Functional programming in Python, Part 1 - 0 views

  • Document options Document options requiring JavaScript are not displayed Rate this pageHelp us improve this contentLevel: IntroductoryDavid Mertz (mertz@gnosis.cx), Applied Metaphysician, Gnosis Software, Inc. 01 Mar 2001Although users usually think of Python as a procedural and object-oriented language, it actually contains everything you need for a completely functional approach to programming. This article discusses general concepts of functional programming, and illustrates ways of implementing functional techniques in Python. We'd better start with the hardest question: "What is functional programming (FP), anyway?" One answer would be to say that FP is what you do when you program in languages like Lisp, Scheme, Haskell, ML, OCAML, Clean, Mercury, or Erlang (or a few others). That is a safe answer, but not one that clarifies very much. Unfortunately, it is hard to get a consistent opinion on just what FP is, even from functional programmers themselves. A story about elephants and blind men seems apropos here. It is also safe to contrast FP with "imperative programming" (what you do in languages like C, Pascal, C++, Java, Perl, Awk, TCL, and most others, at least for the most part).
reckoner reckoner

rsync implemented in Python - 0 views

  • This script mimics rsync which is available for the unix platform and have been ported to win32 one. It is a sort of advanced version of xcopy. Its aim is to selectively synchronize folders. More precisely it copy selective parts of a folder to a destination folder and in addition can remove parts of the destination folder that do not correspond to parts of the original folder. I like its capability to avoid copying files through the .cvsignore mechanism or the pattern matching mechanism and its capability to delete files that are no longer relevant, not to mention that because it's a python script anyone can easily fix or improve it as he whish.
  •  
    rsync implemented in Python
reckoner reckoner

Python Idioms and Efficiency Suggestions - 0 views

  • What idioms should I use to make my code easier to read? Read "The Python Cookbook", especially the first few chapters. It's a great source of well-written Python code examples.
  • Use function factories to create utility functions. Often, especially if you're using map and filter a lot, you need utility functions that convert other functions or methods to taking a single parameter. In particular, you often want to bind some data to the function once, and then apply it repeatedly to different objects. In the above example, we needed a function that multiplied a particular field of an object by 3, but what we really want is a factory that's able to return for any field name and amount a multiplier function in that family:
  • Use zip and dict to map fields to names. zip turns a pair of sequences into a list of tuples containing the first, second, etc. values from each sequence. For example, zip('abc', [1,2,3]) == [('a',1),('b',2),('c',3)]. You can use this to save a lot of typing when you have fields in a known order that you want to map to names:
  •  
    suggestions for better programming style.
Chris 089

Talk titled "Python vs. Ruby: A Battle to The Death" by Gary Bernhardt - 0 views

  •  
    A highly interesting talk about the ugly syntactic freedoms in Ruby that enables the development of beautiful tools like rspec and cucumber which will never be possible in python due to its - generally beautiful - syntactic borders.
steelkiwi

How to Build an On-Demand Platform Like Uber or Airbnb - 0 views

  •  
    "When we talk about building an on demand delivery app clone, we're often talking about building an app like Uber or Airbnb. Two major decacorns (companies worth $10 billion or more), Uber and Airbnb are worth billions of dollars. To be more precise, Uber was valued at $72 billion and Airbnb at $29.3 billion as of August 2018. Uber is available in more than 65 countries and over 600 cities. Every day, nearly two million people rent accommodation through Airbnb. What's so great about these two companies that makes so many people regularly use their applications and makes entrepreneurs want to copy them? We're in this article to talk about the philosophy behind an Uber- or Airbnb-like on-demand delivery service app."
steelkiwi

How to Build an Online Marketplace - 0 views

  •  
    "The amount of online marketplaces increases every day. Both consumers and suppliers increasingly turn to online interaction. Online marketplaces dominate over traditional offline platforms due to convenience and time efficiency. In such a manner, more and more entrepreneurs come to an idea to build an online marketplace platform and need to make many decisions before any work is done. What are they? In this article, we discuss five main aspects you should consider if you want to build an online marketplace"
‹ Previous 21 - 40 of 191 Next › Last »
Showing 20 items per page