See: Description
| Interface | Description |
|---|---|
| Provider<T> |
Provides instances of
T . |
| Annotation Type | Description |
|---|---|
| Inject |
Identifies injectable constructors, methods, and fields.
|
| Named |
String-based qualifier.
|
| Qualifier |
Identifies qualifier annotations.
|
| Scope |
Identifies scope annotations.
|
| Singleton |
Identifies a type that the injector only instantiates once.
|
Many types depend on other types. For example, a Stopwatch
might
depend on a TimeSource
. The types on which a type depends are
known as its dependencies. The process of finding an instance of a
dependency to use at run time is known as resolving the dependency.
If no such instance can be found, the dependency is said to be
unsatisfied, and the application is broken.
In the absence of dependency injection, an object can resolve its dependencies in a few ways. It can invoke a constructor, hard-wiring an object directly to its dependency's implementation and life cycle:
class Stopwatch { final TimeSource timeSource; Stopwatch () { timeSource = new AtomicClock(...); } void start() { ... } long stop() { ... } }
If more flexibility is needed, the object can call out to a factory or service locator:
class Stopwatch { final TimeSource timeSource; Stopwatch () { timeSource = DefaultTimeSource.getInstance(); } void start() { ... } long stop() { ... } }
In deciding between these traditional approaches to dependency resolution, a programmer must make trade-offs. Constructors are more concise but restrictive. Factories decouple the client and implementation to some extent but require boilerplate code. Service locators decouple even further but reduce compile time type safety. All three approaches inhibit unit testing. For example, if the programmer uses a factory, each test against code that depends on the factory will have to mock out the factory and remember to clean up after itself or else risk side effects:
void testStopwatch() { TimeSource original = DefaultTimeSource.getInstance(); DefaultTimeSource.setInstance(new MockTimeSource()); try { // Now, we can actually test Stopwatch. Stopwatch sw = new Stopwatch(); ... } finally { DefaultTimeSource.setInstance(original); } }
In practice, supporting this ability to mock out a factory results in even more boilerplate code. Tests that mock out and clean up after multiple dependencies quickly get out of hand. To make matters worse, a programmer must predict accurately how much flexibility will be needed in the future or else suffer the consequences. If a programmer initially elects to use a constructor but later decides that more flexibility is required, the programmer must replace every call to the constructor. If the programmer errs on the side of caution and write factories up front, it may result in a lot of unnecessary boilerplate code, adding noise, complexity, and error-proneness.
Dependency injection addresses all of these issues. Instead of the programmer calling a constructor or factory, a tool called a dependency injector passes dependencies to objects:
class Stopwatch { final TimeSource timeSource; @Inject Stopwatch(TimeSource timeSource) { this.timeSource = timeSource; } void start() { ... } long stop() { ... } }
The injector further passes dependencies to other dependencies until it
constructs the entire object graph. For example, suppose the programmer
asked an injector to create a StopwatchWidget
instance:
/** GUI for a Stopwatch */ class StopwatchWidget { @Inject StopwatchWidget(Stopwatch sw) { ... } ... }
The injector might:
TimeSource
Stopwatch
with the TimeSource
StopwatchWidget
with the Stopwatch
This leaves the programmer's code clean, flexible, and relatively free of dependency-related infrastructure.
In unit tests, the programmer can now construct objects directly (without an injector) and pass in mock dependencies. The programmer no longer needs to set up and tear down factories or service locators in each test. This greatly simplifies our unit test:
void testStopwatch() { Stopwatch sw = new Stopwatch(new MockTimeSource()); ... }
The total decrease in unit-test complexity is proportional to the product of the number of unit tests and the number of dependencies.
This package provides dependency injection annotations that enable portable classes, but it leaves external dependency configuration up to the injector implementation. Programmers annotate constructors, methods, and fields to advertise their injectability (constructor injection is demonstrated in the examples above). A dependency injector identifies a class's dependencies by inspecting these annotations, and injects the dependencies at run time. Moreover, the injector can verify that all dependencies have been satisfied at build time. A service locator, by contrast, cannot detect unsatisfied dependencies until run time.
Injector implementations can take many forms. An injector could configure itself using XML, annotations, a DSL (domain-specific language), or even plain Java code. An injector could rely on reflection or code generation. An injector that uses compile-time code generation may not even have its own run time representation. Other injectors may not be able to generate code at all, neither at compile nor run time. A "container", for some definition, can be an injector, but this package specification aims to minimize restrictions on injector implementations.
@Inject


Welcome
To complete your account fill out the form below
Email
First name
Last name
Subscribe to newsletter and receive information about new versions and updates. View our
Privacy Policy
.
complete_profile_failed
Continue


Landing Page
Special Projects
This story is part of a series of specially designed stories that represents some of the best journalism The Post has to offer. Check out the rest of the special projects here.
Marcus Pavilonis
10/4/2018
In rural areas like Appalachia, there aren’t as many resources for minorities. Ohio University’s LGBT Center is one of the few places in Appalachia that offers these resources.
Different universities and community areas around Appalachia have developed LGBTQ centers to help the more rural areas. These include West Virginia University’s LGBTQ+ Center, Appalachian State’s Henderson Springs LGBT Center and the Appalachian Community Fund.
The LGBTQ+ Center in Morgantown, West Virginia, provides different resources, such as advocacy, education, programming and social events, Cris Mayo, director of the LGBTQ+ Center, said in an email.
The facility provides resources to students and staff, faculty and community members. Mayo explained that the center provides programming for Appalachian and rural LGBTQ issues.
West Virginia University offers a minor in LGBTQ studies through the LGBTQ+ Center. Mayo even said the LGBTQ+ Center is looking into scholarships it could offer.
“We have student assistantships and are working on scholarships, those will probably start next year (and include allies),” Mayo said.
While the center is related to the university, people not affiliated with the school are able to use it, according to West Virginia University. There are different assets provided by the center that allow high school students, teachers and residents to learn about the LGBTQ community. Mayo even said that the center has training to help residents learn about the LGBTQ community.
In Boone, North Carolina, the Henderson Springs LGBT Center is designed for students and staff, faculty and community members, Jake Reeves, a graduate assistant working for the center, said. Since there are no other centers in Boone, the center has opened the space for all people of the community.
Marcus Pavilonis | ILLUSTRATION
Reeves said that in the beginning of the Fall Semester, there are educational programming opportunities, such as scholarships, and several different clubs that work with the center to make the environment feel safe and welcoming.
The LGBT Center even hosts “LGBT 101” events to inform residents in the area about how to respect the LGBTQ community. The LGBT Center also provides a drag show for both amateurs and professionals. There is one show per semester. The professionals’ show is in the Spring Semester, and the Fall Semester is reserved for the amateurs’ show.
In the Fall Semester, the LGBT Center hosts a coming out day for those who live in Appalachia, Reeves said. One part of the coming out day includes providing new clothes for any student who is in transition.
For the students that are graduating, the LGBT Center hosts a lavender graduation. This is a separate graduation ceremony where students of the LGBTQ community are able to express themselves because they might not have come out to their parents and family yet, Reeves said.
Since it started supporting the LGBTQ community in 2006, the Appalachian Community Fund has provided grants for LGBTQ organizations.
Most grant recipients specifically requested money for one-time events, such as pride celebrations, gatherings, and religious or educational events, Kendall Bilbrey, the project director for Out in the South: Central Appalachia, said in an email.
There have been 16 grants awarded to 12 different organizations in Virginia, Tennessee, West Virginia and Kentucky.
The fund specifically grants money to groups that are nonprofit or have an agent who can receive and distribute funds to the appropriate programming, Bilbrey said in an email.
The LGBTQ Fund is a part of the Appalachian Community Fund, an organization that grants money to nonprofit organizations.
The organizations that have been given the money have used it in more urban areas because there are not as many LGBTQ centers in rural areas. This allows more people to attend the events. Bilbrey said that some of the community drove as far as four hours to attend the event.
“Through the LGBTQ Fund’s outreach program called Out in the South: Central Appalachia Project, we hosted six events and five of which were in rural areas of (Tennessee), (Kentucky) and (Virginia),” Bilbrey said in an email.
Landing Page
This story is part of a series of specially designed stories that represents some of the best journalism The Post has to offer. Check out the rest of the special projects here.


 Homemade pasta is stuffed with a hearty mix of slowly cooked beef and veal, and served in a bowl of broth.
For the anolini, heat the oil in a large, lidded casserole dish. Add the beef sirloin and veal and seal all over. Remove from the pan and rest on a plate.
Cook the onion, carrots and celery in the casserole for 5–8 minutes. Add the tomato purée and cook for 1–2 minutes.
Put the meat back in the pan. Add the bay leaf and wine and cook until reduced by half. Add the stock, put the lid on and cook for 3–4 hours.
Remove the cooked meat and shred it. Remove the vegetables and mash them in a bowl with a little of the cooking liquor. Season to taste. Mix in the meat, breadcrumbs and nearly all the Parmesan, keeping some for serving. Add more breadcrumbs if you need them to make a firm mixture.
For the broth, put the chicken, beef shin, carrot, onion, celery and garlic in a large saucepan and add enough water to cover. Bring to the boil, cover with a lid and simmer for 2 hours. Strain the liquor, keeping the broth and discarding the vegetables. Reserve the chicken and beef for another meal or your second course.
To make the pasta, in a food processor, mix the flour, eggs and salt. If the mixture is too dry, add a little water. Dust a work surface with a little flour and knead the mixture until it forms a dough. Wrap in cling film and rest in the fridge for 30 minutes.
Dust the pasta with a little flour, then roll it out using a pasta machine until it is about 2mm thick (around setting number five on the pasta machine). Alternatively, roll out the dough using a rolling pin.
Lay a sheet of pasta on a floured work surface and spoon a teaspoon of the meat mixture along the pasta leaving 2cm/¾in gap between each pile. Lay another sheet of pasta on top, taking out the air, and cut into parcels. Cook the pasta in a large saucepan of boiling salted water for 1–2 minutes.
To serve, reheat the chicken broth. Divide the parcels between the serving bowls, ladle over the stock and sprinkle over the remaining Parmesan.


{% extends "base.html" %} {% block content %}
{{ address.name }} {{ address.address1 }} {{ address.address2 }} {{ address.city }} {{ address.get_country_display }}
Update address
Delete address
Add new address


SongBox
Home
(current)
About
Add Song
Search
Add a song to songbox.
Options!
Only the song title is obligatory.
Song Title
Artist
This is one of my own songs!
lyrics:
Submit


Standard country field
Selected Country is {{ countryData.name }}
Reactive country field with default country
Selected Country is {{ countryControl.value.name }}
Input box
Selected Country is {{ countryData.name }}
Input box with default country
Input box with default country and no label


What is it?
Require.js is a module system for client-side javascript. It embraces asynchronous loading.
It looks like this inside of myApp.js
define(
['jquery', 'knockout', 'shootZombies'],
function($, ko, zombieShooter) {
var $ctx = $('#main');
var viewModel = zombieShooter();
ko.applyBindings(viewModel,k $ctx);
});
The Wrong (Let's Say Limited) Way
As recommended on the site:
<script src="/js/require.js" data-main="/js/myApp.js"></script>
You usually need a decent amount of global configuration
requirejs.config({
baseUrl: '/js'
,paths: {
'jquery': 'jquery-2.0.3.min'
,'underscore': 'underscore-min'
,'jqueryUi.widget': 'jquery-ui.widget.1.10.3'
}
,shim: {
underscore: { exports: '_' }
,'jqueryUi.widget': {
deps: ['jquery']
}
}
});
require(['jquery', 'underscore']);
The data-main approach works fine so long as your entire site is exactly one page or you have no global configuration and you're not using the require.js optimizer.
If you have multiple pages then you need multiple bootstrapping data-main classes and need to duplicate this configuration.
If you use the require.js optimizer you're bundling the duplciated code in each bundle
A Better Setup
Don't use data-main. It is too simplistic for real-world use.


This is a new Template for **line chatbot**!
sudo adduser --disabled-login linebot
* If python pip is not here, you can :python -m ensurepip --default-pip
//or// curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py;python get-pip.py
//or// python -m ensurepip --default-pip
* sudo pip install line-bot-sdk flask
* git clone https://github.com/line/line-bot-sdk-python
* Make yourself a DNS name, [[http://duckdns.org|Duck DNS]] is fantastic and free (thanks guys!)
* Now you need a certificate, so use certbot ([[https://letsencrypt.org/|let's encrypt]] thanks for your free service!) for that. I tried many options, but ended by using the manual method: sudo certbot certonly --manual -d myserver.duckdns.org
mkdir -p /tmp/certbot/public_html/.well-known/acme-challenge
cd /tmp/certbot/public_html
printf "%s" ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > .well-known/acme-challenge/ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
sudo $(command -v python2 || command -v python2.7 || command -v python2.6) -c "import BaseHTTPServer, SimpleHTTPServer; \
s = BaseHTTPServer.HTTPServer(('', 80), SimpleHTTPServer.SimpleHTTPRequestHandler); \
s.serve_forever()"
* You should now be able to run the basic samples of Line, after editing the code as below to enable listening to outside request (host="<IP_ADDRESS>") and enabling the certificates:
if __name__ == "__main__":
app.run(host="<IP_ADDRESS>", ssl_context=('fullchain.pem', 'privkey.pem'))
* Now go to [[https://developers.line.biz/console/|Line website]] and go to your channel then provider and edit the 2 webhooks settings:
* Use webhooks: set to //Enabled//
* Webhook URL: put the url of your callback service, ie https://myserver.duckdns.org/callback You can even test, though it fails for me with the sample "flask-echo" but it works when you call it by talking to your line bot!
Victory, as you're here, you have a beta prototype working. Good job, go grab a beer. Yes you can, you deserve it.
python -m pip install -U virtualenv
virtualenv .env
source .env/bin/activate
pip install -U spacy
python -m spacy download en


'I woke up to thousands of messages from Malaysia'
by Zoe KleinmanLondon-based artist Laura Melissa Williams woke up one morning last week to find thousands of messages for her on social media - all from Malaysia.
Overnight, the thirty-something Briton, who paraglides as a hobby, had accidentally caught the attention of the nation's teenagers.
They are in the process of taking SPM exams, roughly the equivalent of GCSEs.
And one of the English comprehension questions was about a fictional paraglider called Melissa.
The question described the fictional Melissa hitting a storm-cloud - like "being tossed around in a washing machine" - and having to be rescued from the roof of a farm by villagers.
Following the exam, a student looked up the question on the internet, found Ms Williams (whose middle name is Melissa), realised from her social media she was a paraglider - and the hashtag "The real Melissa" was born.
"It's a bizarre set of coincidences that created the perfect storm and then went viral," Ms Williams told BBC News.
It began with a whirlwind of humorous memes about washing machines and farms.
"At first, I thought it was funny," she said.
Some thought Ms Williams was somehow working with the Malaysian government.
But as the day wore on, some of the comments became more personal and nastier - along with sarcastic posts about whether "Melissa" should have been paragliding in the first place.
"I checked with some Malay-speaking friends as I started worrying, I got a bit concerned about any threats - they just said it was mainly immature," she said.
And then overnight in UK time, Ms Williams found herself the subject of another hashtag: "Stop cyber-bullying Melissa".
Word had reached Arwind Kumar, a social-media influencer with nearly 200,000 subscribers on YouTube.

And from then on, Ms Williams said, apologies had flooded in.
"I awoke to thousands of messages of apology, from students across Malaysia - some of whom posted nasty comments originally and now regret it and some who apologised on behalf of their cohort," she said.
She has since received invitations to go to dinner in Malaysia, offers of gifts, and apologies from school teachers, influencers and the media. A female Malaysian paraglider got in touch to ask if they could take a flight together.
"For me that's the most amazing thing about this - that the tide turned," said Ms Williams, who doesn't currently have plans to visit the country.
"You hear stuff in the media about celebrities being bullied and that's the immediate thing that comes to your head, that it's a bunch of 17-year-olds who got carried away, but that's the problem - it's group behaviour, people don't stop and think."
In total, she has now received 210,000 Instagram messages, 30,000 tweets, countless direct messages and she has also acquired 5,000 new followers.
"I now have an army of people as my protectors and standing up for what is right and moral," she said.
Ms Williams is now considering creating an art exhibition based on her experience.
Surprisingly, it's not the first time this has happened - the SPM exam in 2018 featured a question about a fictional surfer named Sarah, which propelled Malaysian surfer Sarah Faudzi to Instagram stardom.
In September, Malaysia's queen, the Raja Permaisuri Agong, returned to Twitter in order to express disappointment the police were arresting people who had insulted her on social media.
"I am truly upset that the police have detained those people. Through the years, my husband and I have never made any police report on bad things said about us," she wrote, according to the Straits Times newspaper.
The tweet has now been deleted.


Family
public enum Family : String
A type that describes the product family.
-
- phone: iPhone product family.
Declaration
Swift
case phone = "iPhone"
-
- pod: iPod touch product family.
Declaration
Swift
case pod = "iPod"
-
- pad: iPad product family.
Declaration
Swift
case pad = "iPad"
-
- tv: Apple TV product family.
Declaration
Swift
case tv = "AppleTV"
-
- watch: Apple Watch product family.
Declaration
Swift
case watch = "Watch"
-
The marketing name of the product family, e.g.
iPhone
,Apple TV
.Declaration
Swift
public var marketingName: String { get }


Computer Science learning pathways
Categorizing essential Computer Science knowledge
29 June 2018 | 13 August 2018
teaching phdAlso worth reading: Reverse engineering a curriculum.
I happened to come across a very interesting study path for “game programmers” published at https://github.com/miloyip/game-programmer. It’s a nice visual representation of books that help you become a better (game) programmer, starting from zero (game programming for kids) and ending at advanced game physics and Artificial Intelligence. I am not keen on becoming a game programmer but the reason this is interesting is that the author has done a great job trying to categorize the different requirements - what it takes to be a programmer in general. Let’s take a closer look at that.
A cut-out part of the study path, copyright Milo Yip
Study paths for any programmer
Starting at Computer Science (CS), many of my favorite books on the subject are prominently displayed: Structure and Interpretation of Computer Programs (SICP) and Introduction to Algorithms. Milo also identifies 3 categories within CS: CS Foundation (SICP), Algorithms, and Mathematics for CS.
After the required1 CS path, we move on to Programming Languages. For the game industry, C(++) and C# are important. Sadly, C++ is a horrible mess and requires different levels of specialized books to completely grasp. I was actually researching C++ books as I’m preparing a “Software design in C/C++ with Qt” course for the coming academic year.
Okay, what’s next after a basic CS layer with some intermediate language knowledge? Software development, being the practice (TDD, refactoring, clean code, legacy code) and the design (patterns). I’m ignoring his UML reference here. Why would you separate programming languages from software development? You need basic understanding of a language to speak. Grammar (syntax) and speaking (development) are useless separately but a lot of books focus too much on only one of these.
After that path, the in-depth game development parts begin. Let’s look at it this way: the bachelor years are over, time to specialize in the master years.
Study paths for an academic Master
As a little experiment, I decided to map out my own master education in order to compare the above to some academic reference material. You will see that the abstract “study paths” are very much alike.
The Bachelor years
These are the courses I followed in 2003 to reach the grade of Academic Bachelor in Informatics (Computer Science), at UHasselt.
First year:
- Introduction to CS and imperative programming 1
- Introduction to CS and imperative programming 2
- CS Tools (no idea anymore)
- Math for CS 1
- Math for CS 2
- Logic and modeling
- Computer-systems
- Computer arithmetic and decision science
- Human aspects of CS
- Introduction to research and seminars
Extremely heavy on the mathematics and logic, more than 50% of the students stop at this point and because of that. Almost everything is theoretically interesting but practically unprocessed.
Second year:
- Algorithms and data-structures
- OO programming
- Advanced algorithms and OO programming
- Probability statistics
- Operating systems
- Logic and Functional programming
- Introduction to databases
- Theoretical informatics
Slowly building upon the first year, introducing algorithms, extending on logic, moving from imperative to object-oriented programming.
Third year:
- Telecommunication and telematics
- Software engineering
- Computer networks
- Compilers
- Technology of multimedia systems and software
- Technology of tools of User Interfaces
- Data mining
- Distributed systems
- Bio-informatics
- AI techniques
Finally a lot of freedom for the student as I remember 40% of those courses were optional as I picked data mining and bio-informatics to fill up on points.
The Master year(s)
These are the courses I followed in 2007 to reach the grade of Master in Informatics (Computer Science), specialization human-computer interaction, at UHasselt.
- 3D interaction and virtual environments
- Advanced software engineering
- Evaluation of User Interfaces
- User-centric system development
- Actual trends in human-computer interaction
- Legal aspects of computer science
I ignored the obvious thesis and internship. The master year included a lot (+60%) of optional courses but I can’t remember exactly which one is and which one isn’t. The master year has changed a lot since 2007: it’s now 2 years and the specializations have expanded: I could choose from 3 (databases, the theoretical oriented one, multimedia, the graphical oriented one, and human-computer interaction, the engineering oriented one). Now there are six at that university!
There has been a lot of shoving-around (from bachelor to master and the other way around) since I graduated. Things like compilers for instance, and legal aspects seems to be an obligatory course now. But looking at the list from a distance, we can clearly distinguish the following trends (only looking at the Master years now!):
- (Big) “Data” became more apparent.
- Entrepreneurship is encouraged with some new courses dedicated to that and project management. (both required, rejoice!)
- Networking (security, IoT) became more apparent.
- AI and machine learning became more apparent. I was interested in this but in 2006 you could only follow a Master after Master in AI in another university.
- “Agile” is a thing and part of policy informatics. (Huh?)
According to the “Computer Science Education in 2018” interview2, CS education has been relatively static, with core classes still focused on programming (languages, algorithms, data structures), mathematics and systems design (operating systems, computer architecture). The objectives stay the same but the content has obviously been evolving among with us.
Over the years, I have seen curricular changes to make room for breadth courses unrelated to CS, and to make the programs more accessible to those who are not strong in mathematics. I believe that these changes come at the expense of a deeper understanding of computation.
Something has to be cut if one intends to make room and that something usually is mathematics - for better or for worse.
Essential Computer Science
It seems to me that most courses map quite well with Milo’s requirements on game programming. Would that also be the case with other source material?
Yes.
Look at this well-documented Google Coding Interview University. I’ll let the author speak for it’s contents:
I originally created this as a short to-do list of study topics for becoming a software engineer, but it grew to the large list you see today. After going through this study plan, I got hired as a Software Development Engineer at Amazon.
This is my multi-month study plan for going from web developer (self-taught, no CS degree) to software engineer for a large company.
This clearly suggests a (big?) difference between a developer and an engineer.3 The latter sounds a lot cooler for sure. But what exactly would be required to make the jump from one title to the other, according to jwasham? The list is too long so let’s make some abstractions:
- Algorithms (including NP-completeness) and their complexity
- Data structures (including dynamic programming)
- Object-Oriented Programming
- Design patterns
- Threading, processes and scheduling
- Networking
- System design, scalability and data handling
Which of these is the most important one?
SICP of course!
It’s an unordered list but you can easily map those subjects onto the previous bachelor years. It’s a bit more practically oriented though: a lot more in-depth algorithms and less logic, probability and mathematics. Prerequisites are knowing C so imperative programming got you covered. You can read more about his personal story on Medium.
A more hands-on approach is to be preferred to keep students engaged. Google’s Tech Dev Guide or classic pair programming brain teasers on Code Wars suggest the same but a close inspection reveals a rather theoretical approach!
In Applied informatics
So what about the professional Bachelor in Applied Informatics? Is this the road to become a developer but not an engineer, as explained by jwasham? Take a look at the programme from a nearby graduate school, PXL:
First year:
- Application development (Java/.NET/Web Essentials, Web Scripting)
- OS Essentials
- Security essentials
- IT & Data Essentials (“problem solving”)
- Business communication skills
Second year:
- Java/.NET/Web Advanced
- Server OS Essentials
- Software Analysis
- Security & Data Advanced
- Business communication skills 2
The third year is a specialization year with three choices: application development (mobile development, programming “expert”, software engineering), software management (modeling, management) and networking (cloud & automation, OS expert). I can only guess at the contents of the very vague course descriptions but almost anything from the computer science path seems to be completely vanished.
That leaves me to conclude that the “2. Programming Languages” study path with a bit of “3. software development” apply for a professional bachelor4. Advanced principles might as well be learned on-the-job if you’re hired (“6. Game development”) but it’s sad to see that not even a little bit of the essentials are integrated into the plan. I know this to be true because I was a guest lecturer for courses like the essential and advanced application development parts.
Of course as an academic I’m highly biased, but I have worked for 11 years in the software development industry where practicality is most important and most colleagues came from the applied trajectory.
Conclusion
Is basic Computer Science knowledge required to be a great software developer? I think that will depend on what kind of software you’ll be working on. If it’s domain-driven enterprise software then most of the complexity will come from unclear business rules that drives miscommunication. In that case common sense and critical thinking will be enough5. If it’s a game engine, a deep learning network or a new distributed protocol then the right mindset alone won’t cut it.
That also seems to clarify the difference between developing and engineering. There are a lot of articles on this subject to be found and the explanation is never clear but bound to the industrial context.
- According to the github link, and according to all academic educations. Applied informatics seems to completely (or partially) skip this step, see later on. [return]
- February 2018, DOI: 10.1109/MITP.2018.011021350 [return]
- To quote the source: “Large software companies like Google, Amazon, Facebook and Microsoft view software engineering as different from software/web development, and they require computer science knowledge.” [return]
- Remember, other graduate schools offer other trajectories. [return]
- Those skills are also trained while learning CS so it’s not to say that it will be useless! [return]


Yahoo! Address Book
From the Address Book of mrsrose_mkama_200
Dear,
Iam Mrs. Rose Mkama from Benin. I was married to Manfred The CEO Veekrol Link Benin Sarl, a seasoned Contractor In West African Region. Before he died in The year 2002. We are married for eleven years Without a child. He died after a Brief illness. After His Death I decided not tore-marry or get a child Outside My matrimonial home. When my late husband was Alive, he deposited the sum of US$31.5m dollars (US Dollars) in a Bank In Nigeria.
My Doctor told me that I would not last for the next Three months Due to cancer problem. Having known my Condition I decided to donate this funds to better the Lives of the less Privileged. I need honest and trust Worthy individual that will utilize this Money in Accordance With my instruction. I want the funds to be Used in funding religious Organizations, Orphanages And less privileged propagating the word of God.
I took this decision because I don t have any child That will inherit this money and my husband relatives Are very unkind to me and I don t Want my husbands Hard-earned money to be misused. I am not afraid of Death hence I know where I am Going. I know that I Am Going to be in the bosom of the Lord. Exodus 14 VS 14 Says that the Lord will fight my course and I shall Hold my peace. I Speak French and little English in Case you want a Telephone Communication in this
Regard.
As soon as I receive your reply I shall give you the Contact of the Bank, and my companies in Benin. For Legitimacy, I will also Issue you a letter of Authority that will empower you as the Original-Beneficiary of this fund. I want you to Always Pray for me, any delay in your Reply will give Me room in sourcing for another individual for this Same Purpose.
Kindly get back to me with this email ID
<EMAIL_ADDRESS>Thanks,
Yours sincerely
Mrs. Rose Mkama


A marker is assigned to each photo, let's drag-and-drop!
If your image already contains GPS location, you can still tune it.
At the end, latitude and longitude will be saved in the dedicated EXIF metadata.
You like to hike the mountains with a GPS in your backpack? With Locate, you can display your track and synchronise the position with your photos*.
Forgot to change the internal clock of your camera after landing in a diferent timezone? No worries, you can adjust a delay of ±12h with a 1sec precision and apply it easily to other pictures.
*Only with GPX and KML. GeoJSON is for display only.
Choose among five layouts and be sure to display the relevant information to place your photos:
Classic street style, hiking with topographic isolines, minimalist dark or light and satellite.
Who said maps have to be boring?
Search for places and display the actual address when markers are drag-and-droped!
“User Interface (UI) should not need a Help Menu”
With smart tooltips and a minimalist design, you already know how to use Locate!


home
portfolio
contact
about
Cândido Ferreira © 2020
contact
Name
E-mail
Subject
Message
Submit
Follow me
Follow me


Part V: Tiles, Maps, and Collisions
EditNow it's time to make some maps for the player to move around in! To do this, we're going to use a tool called Ogmo Editor. Ogmo is a free tile map editor that works very nicely with HaxeFlixel. For this part of the tutorial, we're just going to use a simple 2-tile Tilesheet with a tile for Walls and a tile for Floors.
You can make your own, with 16x16 pixel tiles, or use this one:
(Note: the first tile should be empty!)
Go to http://www.ogmoeditor.com to download and install it, then launch the editor.
Go to Project > New Project and name your project whatever you want. I would save it under assets/data.
Next, you need to define your project's settings. Go through each tab, one-by-one, and set it up to look like the following:
Hit Apply to save your changes. You should now see a screen that looks like this:
Make sure you're on the 'walls' layer, and, using tools on the right, draw out a simple map. Make sure it's completely encircled by walls (so the player can't wander off the map), and make the insides filled with floor tiles. You should end up with something like this:
Now, switch over to the 'entities' layer, and place your player entity somewhere in one of your rooms:
Go up to Level > Save Level, and save this as "room-001.oel" in "assets/data".
We're done with Ogmo for now, so save all your changes and exit.
One of the great things about using Ogmo with HaxeFlixel is that there is already a class built to load and use the maps, however, it's not in the 'standard' HaxeFlixel library - we have to install the flixel-addons library to get access to it.
Open up a new command prompt window, and enter:
haxelib install flixel-addons
This should run and install the new library. Close the command prompt window when it's finished.
Jump back into FlashDevelop and open up your Project.xml file. We need to tell our project to include flixel-addons in the libraries.
Look for a line that says:
<!--haxelib name="flixel-addons" /-->
and change it to:
<haxelib name="flixel-adddons" />
Save this change.
Go back to your PlayState, and, underneath where you define your _player object, add:
private var _map:FlxOgmoLoader; private var _mWalls:FlxTilemap;
We're basically just creating an object to hold our Ogmo Map, and then another one to hold the FlxTilemap that we will generate from the Ogmo map.
In the create function, before we setup the player object, add:
_map = new FlxOgmoLoader(AssetPaths.room_001__oel); _mWalls = _map.loadTilemap(AssetPaths.tiles__png, 16, 16, "walls"); _mWalls.setTileProperties(1, FlxObject.NONE); _mWalls.setTileProperties(2, FlxObject.ANY); add(_mWalls);
This just loads our room file into our FlxOgmoLoader object, generates our FlxTilemap from the 'walls' layer, and then sets tile 1 (our floor tile) to not collide, and tile 2 (walls) to collide from any direction. Then we add our tilemap to the state.
Now, we need to make our player object get placed in the right location on the map. So, change where we initialize our player from:
_player = new Player(20, 20);
to:
_player = new Player(); _map.loadEntities(placeEntities, "entities");
We're simply telling our _map object to loop through all of the entities in our 'entities' layer, and call the placeEntities function for each one (which we're about to make now).
Let's make the placeEntities function now. When we call loadEntities on our map, it will pass the name of the entity, as well as its Xml data to whatever function we want. In our function, we need to take this information and do something with it. It will look like this now:
private function placeEntities(entityName:String, entityData:Xml):Void { var x:Int = Std.parseInt(entityData.get("x")); var y:Int = Std.parseInt(entityData.get("y")); if (entityName == "player") { _player.x = x; _player.y = y; } }
So, if this function gets passed an entity with the name "player", it will set our player object's x and y values to the Entities x and y values (converting them from Strings to Ints).
Now, we want to add collision to our state, so the player will bump into walls instead of just walking through them. So, in our update function, after
super.update();
add:FlxG.collide(_player, _mWalls);
All this does is check collision between our player and our walls Tilemap each update, and will deal with overlaps accordingly.
Finally, we want to make a small tweak to the player sprite. It's a good idea to make sure that your player has a decent chance of making it through doorways. Since, by default, our player sprite is the same size as our tiles (16x16 pixels), it makes it so the player has to thread the needle to make it through 1-tile wide doorways. To remedy this, we're going to change the player sprite's size and offsets. This won't change what is actually displayed for the player's graphic, only the hitbox.
So, in the Player class, in the constructor, under where we set the drag, add:
setSize(8, 14); offset.set(4, 2);
Go ahead and run your project, and you should be able to run around the map.
In the next part, we'll talk about some small tweaks to the camera.


Aitor García
Ethos
Blog
Talks
Aitor García
is a person trying to do good work and make lasting things.


{% extends "sk_menu_page.html" %} {% block maincol_content %}
{{fences}} Fences,
{{entries}} Entries,
Optimum time: {{optimum_time}}
| Place | Number | Name | Horse | Pony Club | Faults | Finishing Time | Time Error | {% for round in rounds %}
| {{round.place}} | {{round.number}} | {{round.name}} | {{round.horse}} | {{round.group}} | {{round.faults}} | {{round.time}} | {{round.time_diff}} |


Basics
Here's some notes to know how our navbar works, before getting deeper into it.
- Most of the basics can be find in the official documentation of navbar component. It's highly recommended to get start from there.
- Our color scheme classes works inverse of the Bootstrap definition. For example,
.navbar-dark
makes the text dark colored and.navbar-light
makes the colors lighter. - You can have a different color scheme for the navbar once it's stick at the top by adding one of the
.navbar-stick-dark
or.navbar-stick-light
classes. - Inside the .navbar-brand, you can specify two logos;
.logo-dark
to display for .navbar-dark; and.logo-light
to be display with .navbar-light. -
You should set the placement of navbar using
data-navbar
attribute. It can has one of the following values:static
: Only at top, don't move with scroll.fixed
: Always at top of the screen and moves with scrolling down.sticky
: First at top, hides after a small scroll down, so it won't obscure the header. Once the user scrolls down and passes the header, navbar become fixed/sticky at the top again.smart
: It's like sticky navbar, but it only becomes sticky when the visitor scrolls up.
- Our template adds few classes to the body tag to detect when the scrollbar passed an element which is to use by CSS. Those classes are
.body-scrolled
,.navbar-scrolled
and.header-scrolled
- In mobile devices, the content inside
.navbar-mobile
will display to the user. - We have defined few utility classes to make your coding easier for different situations. Those classes can categorized into
.d-mobile-*
—change display value on mobile devices— and.d-stick-*
—when the navbar sticks to the top— which * can be one of thenone
|block
|inline-block
|flex
|inline-flex
values. So.d-stick-none
will hide an element when the navbar has sticked at the top.
The above notes should level-up your understanding from the navbar component. The following example is a basic example of a navbar:

<button class="navbar-toggler" type="button">☰</button>

Home
Features
Pricing
Contact


User Name
Bio
Lorem ipsum blah blah blah blah
Define style this season with Armani's new range of trendy tops, crafted with intricate details. Create a chic statement look by teaming this lace number with skinny jeans and pumps.
Lorem ipsum blah blah blah blah
Define style this season with Armani's new range of trendy tops, crafted with intricate details. Create a chic statement look by teaming this lace number with skinny jeans and pumps.
© 2016 Mungujakisa Nickson.
Template by Bootstrapious.com


{% extends 'layout.html' %} {% block pageTitle %} We’re considering your application {% endblock %} {% block content %}
We need to review your application. We’ll send you a notification with our decision within 10 working days.
If you do not hear from us, you can contact us by:
What did you think of this service? (opens in a new window) (takes 30 seconds).


{% extends load_base %} {% load i18n %} {% block base_nav %}{% include "gui/node/navigation.html" with li_monitoring="active" %}{% endblock %} {% block base_content %}
{% trans "Monitoring information of compute nodes are not available because synchronization with the monitoring server is disabled." %}


[gecode-users] Using MiniZinc/GeCode in VS
Guido Tack
tack at gecode.org
Thu Mar 31 11:16:03 CEST 2011
Hi Andrei,
VisualStudio isn't the perfect environment for writing MiniZinc (did you mean the MiniZinc IDE?). But yes, once you have a MiniZinc model, you can certainly run it through Gecode. There's some information on how to do it on our FlatZinc web page:
http://www.gecode.org/flatzinc.html
You'll have to compile the MiniZinc to FlatZinc using mzn2fzn (have a look at the MiniZinc documentation), using the -I flag with the path to the Gecode mznlib (as explained on our FlatZinc page). Then you can run the generated FlatZinc through our fz executable.
Cheers,
Guido
Andrei Neboian wrote:
> Dear All,
>
> Is it then possible to write a model in MiniZinc in the Visual Studio environment and use the GeCode as a solver? I saw that there are mzn-libraries in the GeCode directory...
>
> I really like MiniZinc because it is easy and intuitive for me to model my problems, but I still want to use GeCode given its speed.
>
> Many Thanks!
>
> Andrei _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
--
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20110331/72df49f0/attachment.htm>
More information about the users
mailing list


Explore amazing natural resources such as the many caves hidden within Austin. Experience the life saving side of how an ambulance and it's crew provide services to our residents. Participate as a virtual audience in a City meeting!
VR can provide a unique "hands on" and immersive learning experience that may not be fully replicated through more common, standard techniques.
Accessibility to information and services is a City responsibility to our residents where VR can be used to help extend that reach in many scenarios.


Get
insights
that help your business grow.
Discover the benefits of data analytics and make better decisions regarding revenue, customer experience, and overall efficiency.
10k+
COMPANIES
314
TEMPLATES
12M+
QUERIES
Challenge by
Frontend Mentor
. Coded by
H P Pranaave
.


To become unbecoming, you must learn what is meet—which is moot—and then go against it. Get a book of etiquette. Where it says do, don't, and where it says don't, do. When you can do or don't with practised ease your conduct will be unbecoming. To become becoming again, simply undo the don'ts and do's. By the by, why what is meet is moot is because conventions vary. And remember your catechismus:
Q—What do I not give for convention?
A—A jot


1)
Eeks
There is a cockroach on my plate
!
!
2)
Will you please buy bread on your way home
?
3)
Could you help me with my project
?
4)
The office is on fire
!

6)
Were you at the concert last night
?
7)
That’s a really funny joke
!

9)
Tom asked, “May I go to the washroom
”
?
10)
Did he reach the airport on time
?


Reports
toString()
calls on numeric objects. Such calls are usually incorrect in an internationalized environment.


--- title: Tensor shape type: docs repo: https://github.com/rstudio/tensorflow menu: main: name: Tensor shape - tensorflow parent: tensorflow-reference aliases: - /reference/tensorflow/shape.html - /tensorflow/reference/shape.html - /guide/tensorflow/reference/shape.html - /tools/tools/tensorflow/reference/shape.html - /installation/tensorflow/reference/shape.html - /tutorials/tensorflow/reference/shape.html - /guide/tools/tensorflow/reference/shape.html - /deploy/tensorflow/reference/shape.html - /tools/tensorflow/reference/shape.html - /tutorials/tools/tensorflow/reference/shape.html ---
Tensor shape
shape(...)
| ... | Tensor dimensions |


AJAX
XML (hosted locally)
Goal
As a user, I want to see the RSS content provider's name (title element in the top of the channel)
Dev Steps
- Visit the CBC website to find the RSS resource
- Download and serve the RSS resource on this local web server
- Use jQuery to make an XHR request (AJAX) and display the response in the console
- Parse title element from RSS
Technologies
- RSS
- XML
- jQuery AJAX
- jQuery
- JavaScript
- HTML
Live demo


If you know Helm
, you know helm chart repositories. It is like maven repositories, instead these repositories hold onto the
different charts that can be used to install different tools and products into a kubernetes environment. If you are planning to use Helm in your organization to manage your own deployments, lets say your micro-services, then most probably you have come across the need for a chart repository of your own.
According Helm:
” A chart repository is an HTTP server that houses an index.yaml file and optionally some packaged charts. When you’re ready to share your charts, the preferred way to do so is by uploading them to a chart repository. “
Source: https://github.com/helm/helm/blob/master/docs/chart_repository.md
So all you simply need is a HTTP Server. The simplest of all the options that comes to mind is GIT in this case. If you organization is using GitHub, GitLab, BitBucket or any Git variation, you can easily create a helm repository.
The following are the set of steps that I followed.
Step 1: Your chart has to be packaged as a Tar File.
1
2
$ helm package test-chart
Successfully packaged chart and saved it to: /Users/admin/Development/Research/Helm/helm-repository/test-chart-0.0.1.tgz
Step 2: Create a chart repository
1
2
3
$ mkdir test-charts
$ # Copy the charts and tar file
$ mv test-chart test-chart-0.0.1.tgz ./test-charts
Step 3: Create a index.yaml file for the chart_repository
1
2
$ cd test-charts
$ helm repo index .
Index.yaml file should look like the following
1
2
3
4
5
6
7
8
9
10
11
12
apiVersion: v1
entries:
test-chart:
- apiVersion: v1
created: 2019-01-08T00:01:10.623604673-05:00
description: Simple Micro-service Chart
digest: 748594dc2815a12ea3a2b4860b731ff0f3d7cfce0102538214448dd962b8ac08
name: test-chart
urls:
- test-chart-0.0.1.tgz
version: 0.0.1
generated: 2019-01-08T00:01:10.622439226-05:00
As a pre-requisite, you need to have a Git Repo Ready. Mine is https://github.com/chinthakadd/simple-helm-repo
Step 4: Initialize your repo and Push the chart repository to the remote Git repository
1
2
3
4
5
$ git init
$ git add .
$ git commit -m "init chart repo"
$ git remote add origin git@github.com:chinthakadd/simple-helm-repo
$ git push -u origin master
Step 5: Add the repo to Helm
1
$ helm repo add simple-helm-repo {Git Raw URL}
NOTE: Git URL is the Raw Git URL. Ex: https://raw.githubusercontent.com/chinthakadd/simple-helm-repo/master for my chart repo.
Step 6: Check if you can fetch a Helm Chart from the Repository
1
$ helm fetch simple-helm-repo/test-chart --untar
A simple asciicinema on how I achieved this.


Split Music Challenge
Life Lines
Replay
Different snippet
Longer snippet
All Decades
1980's
1990's
2000's
All Genres
Pop
Alternative
Electronic
Loser!
Scoring and some disclaimers :/
X
Still need to fill this
Tuning Our Instruments higher level


Public Member Functions |
| | dispatchAction ($value, $result, $parser) |
| | validate () |
| | setDefaults () |
Data Fields |
|
| $path |
|
| $required = false |
|
| $required_one = false |
|
| $action = 'StoreStringOrFalse' |
Member Function Documentation
| dispatchAction |
( |
$ |
value, |
|
|
$ |
result, |
|
|
$ |
parser |
|
) |
| |
Constructor.
- Parameters:
-
| string | $name | The name of the option |
| array | $params | An optional array of parameters |
- Returns:
- void Formats the value $value according to the action of the option and updates the passed ConfigParser_Result object.
- Parameters:
-
| mixed | $value | The value to format |
| ConfigParser_Result | $result | The result instance |
| ConfigParser | $parser | The parser instance |
- Returns:
- void
- Exceptions:
-
Set the default value according to the configured action.
Note that for backward compatibility issues this method is only called when the 'force_options_defaults' is set to true, it will become the default behaviour in the next major release of PEAR2.
- Returns:
- void
Validates the option instance.
- Returns:
- void
- Exceptions:
-
- Todo:
- use exceptions instead
The documentation for this class was generated from the following file:
- lib/hypoconf/lib/HypoConf/ConfigParser/Setting.php


{% extends "layout.html" %} {% block title %} Index {% endblock %} {% block main %}
Your order has been placed and is being completed. Someone will be by your room soon to collect your ID or cash to pay.


module poorwsgi link | top
Poor WSGI connector for Python
Current Contents:
- request - Headers, Request and FieldStorage classes, which
is used for managing requests.
state - constants like http status code, log levels and method types
- wsgi - Application callable class, which is the main point for
poorwsgi web application.
module wsgi link | top
class Application link | top
Poor WSGI application which is called by WSGI server.
Working of is describe in PEP 333. This object store route dispatch table, and have methods for it's using and of course __call__ method for use as WSGI application.
after (READ) top
Tuple of table with after-request handlers.
auto_args (READ | WRITE) top
Automatic parsing request arguments from uri.
If it is True (default), Request object do automatic parsing request uri to its args variable.
auto_cookies (READ | WRITE) top
Automatic parsing cookies from request headers.
If it is True (default) and Cookie request header was set, SimpleCookie object was paresed to Request property cookies.
auto_form (READ | WRITE) top
Automatic parsing arguments from request body.
If it is True (default) and method is POST, PUT or PATCH, and request mime type is one of form_mime_types, Request object do automatic parsing request body to its form variable.
auto_json (READ | WRITE) top
Automatic parsing JSON from request body.
If it is True (default), method is POST, PUT or PATCH and request mime type is one of json_mime_types, Request object do automatic parsing request body to json variable.
before (READ) top
Tuple of table with before-request handlers.
debug (READ | WRITE) top
Application debug as another way how to set poor_Debug.
This setting will be rewrite by poor_Debug environment variable.
defaults (READ) top
Copy of table with default handlers.
document_index (READ | WRITE) top
Application document_root as another way how to set poor_DocumentRoot.
This setting will be rewrite by poor_DocumentRoot environ variable.
document_root (READ | WRITE) top
Application document_root as another way how to set poor_DocumentRoot.
This setting will be rewrite by poor_DocumentRoot environ variable.
file_callback (READ | WRITE) top
File callback use as parameter when parsing request body.
Default is None. Values could be a class or factory which got's filename from request body and have file compatibile interface.
filters (READ) top
Copy of filter table.
Filter table contains regular expressions and convert functions, see Application.set_filter and Application.route.
Default filters are:
:int match number and convert it to int
:float match number and convert it to float
:word match one string word
:hex match hexadecimal value and convert it to str
:re: match user defined regular expression
none match any string without '/' character
For more details see /debug-info page of your application, where you see all filters with regular expression definition.
form_mime_types (READ) top
Copy of form mime type list.
Containt list of strings as form mime types, which is use for testing, when automatics Form object is create from request body.
json_mime_types (READ) top
Copy of json mime type list.
Containt list of strings as json mime types, which is use for testing, when automatics Json object is create from request body.
keep_blank_values (READ | WRITE) top
Keep blank values in request arguments.
If it is 1 (0 is default), automatic parsing request uri or body keep blank values as empty string.
name (READ) top
regular_routes (READ) top
Copy of table with regular expression handlers.
routes (READ) top
Copy of table with static handlers.
See Application.route.
secret_key (READ | WRITE) top
Application secret_key could be replace by poor_SecretKey in request.
Secret key is used by PoorSession class. It is generate from some server variables, and the best way is set to your own long key.
states (READ) top
Copy of table with http state aka error handlers.
strict_parsing (READ | WRITE) top
Strict parse request arguments.
If it is 1 (0 is default), automatic parsing request uri or body raise with exception on parsing error.
def __call__(self, env, start_response) link | top
Callable define for Application instance.
This method run __request__ method.
def __init__(self, name='__main__') link | top
Application class is per name singleton.
That means, there could be exist only one instance with same name.
def __profile_request__(self, env, start_response) link | top
Profiler version of __request__.
This method is used if set_profile is used.
def __repr__(self) link | top
def __request__(self, env, start_response) link | top
Create Request instance and return wsgi response.
This method create Request object, call handlers from Application.before, uri handler (handler_from_table), default handler (Application.defaults) or error handler (Application.error_from_table), and handlers from Application.after.
def add_after_request(self, fn) link | top
Append handler to call after each request.
Method for direct append function to list functions which are called after each request.
def after_each_request(req): print("Request out") app.add_after_request(after_each_request)
def add_before_request(self, fn) link | top
Append handler to call before each request.
Method adds function to list functions which is call before each request.
def def before_each_request(req): print("Request coming") app.add_before(before_each_request)
def after_request(self) link | top
Append handler to call after each request.
This decorator append function to be called after each request, if you want to use it redefined all outputs.
@app.after_each_request() def after_each_request(req): print("Request out")
def before_request(self) link | top
Append hendler to call before each request.
This is decorator for function to call before each request.
@app.before_request() def before_each_request(req): print("Request coming")
def default(self, method=3) link | top
Set default handler.
This is decorator for default handler for http method (called before error_not_found).
@app.default(METHOD_GET_POST) def default_get_post(req): # this function will be called if no uri match in internal # uri table with method. It's similar like not_found error, # but without error ...
def del_profile(self) link | top
def error_from_table(self, req, code) link | top
Internal method, which is called if error was accured.
If status code is in Application.shandlers (fill with http_state function), call this handler.
def get_options() link | top
Returns dictionary with application variables from system environment.
Application variables start with app_
prefix,
but in returned dictionary is set without this prefix.
app_db_server = localhost # application variable db_server app_templates = app/templ # application variable templates
This method works like Request.get_options, but work with os.environ, so it works only with wsgi servers, which set not only request environ, but os.environ too. Apaches mod_wsgi don't do that, uWsgi and PoorHTTP do that.
def handler_from_default(self, req) link | top
def handler_from_pre(self, req) link | top
Internal method, which run all pre (pre_proccess) handlers.
This method was call before end-point route handler.
def handler_from_table(self, req) link | top
Call right handler from handlers table (fill with route function).
If no handler is fined, try to find directory or file if Document Root, resp. Document Index is set. Then try to call default handler for right method or call handler for status code 404 - not found.
def http_state(self, code, method=7) link | top
def is_regular_route(self, r_uri) link | top
def is_route(self, uri) link | top
def pop_after_request(self, fn) link | top
def pop_before_request(self, fn) link | top
def pop_default(self, method) link | top
def pop_http_state(self, code, method) link | top
Pop handerl for http state and method.
As Application.pop_route, for pop multimethod handler, you must call pop_http_state for each method.
def pop_regular_route(self, r_uri, method) link | top
Pop handler and convertors for uri and method from handlers table.
For mor details see Application.pop_route.
def pop_route(self, uri, method) link | top
Pop handler for uri and method from handers table.
Method must be define unique, so METHOD_GET_POST could not be use. If you want to remove handler for both methods, you must call pop route for each method state.
def regular_route(self, ruri, method=3) link | top
Wrap function to be handler for uri defined by regular expression.
Both of function, regular_route and set_regular_route store routes to special internal table, which is another to table of static routes.
@app.regular_route(r'/user/\w+') # simple regular expression def any_user(req): ... @app.regular_route(r'/user/(?P<user>\w+)') # regular expression with def user_detail(req, user): # groups ...
Be sure with ordering of call this decorator or set_regular_route function. Regular expression routes are check with the same ordering, as you create internal table of them. First match stops any other searching.
def route(self, uri, method=3) link | top
Wrap function to be handler for uri and specified method.
You can define uri as static path or as groups which are hand to handler as next parameters.
# static uri @app.route('/user/post', method=METHOD_POST) def user_create(req): ... # group regular expression @app.route('/user/<name>') def user_detail(req, name): ... # group regular expression with filter @app.route('/<surname:word>/<age:int>') def surnames_by_age(req, surname, age): ... # group with own regular expression filter @app.route('/<car:re:\w+>/<color:re:#[\da-fA-F]+>') def car(req, car, color): ...
If you can use some name of group which is python keyword, like class, you can use **kwargs syntax:
@app.route('/<class>/<len:int>') def classes(req, **kwargs): return ("'%s' class is %d lenght." % (kwargs['class'], kwargs['len']))
Be sure with ordering of call this decorator or set_route function with groups regular expression. Regular expression routes are check with the same ordering, as you create internal table of them. First match stops any other searching. In fact, if groups are detect, they will be transfer to normal regular expression, and will be add to second internal table.
def set_default(self, fn, method=3) link | top
Set default handler.
Set fn default handler for http method called befor error_not_found.
app.set_default(default_get_post, METHOD_GET_POST)
def set_filter(self, name, regex, convertor=<class 'str'>) link | top
Create new filter or overwrite builtins.
- name: str
Name of filter which is used in route or set_route method.
- regex: str
Regular expression which used for filter.
- convertor: function
Convertor function or class, which gets string in input. Default is str function, which call __str__ method on input object.
app.set_filter('uint', r'\d+', int)
def set_http_state(self, code, fn, method=7) link | top
def set_profile(self, runctx, dump) link | top
Set profiler for __call__ function.
- runctx: function
function from profiler module
- dump: str
path and prefix for .profile files
Typical usage:
import cProfile cProfile.runctx('from simple import *', globals(), locals(), filename="log/init.profile") app.set_profile(cProfile.runctx, 'log/req')
def set_regular_route(self, r_uri, fn, method=3, convertors=(), rule=None) link | top
Set hanlder for uri defined by regular expression.
Another way to add fn as handler for uri defined by regular expression. See Application.regular_route documentation for details.
app.set_regular_route('/use/\w+/post', user_create, METHOD_POST)
This method is internally use, when groups are found in static route, adding by route or set_route method.
def set_route(self, uri, fn, method=3) link | top
Set handler for uri and method.
Another way to add fn as handler for uri. See Application.route documentation for details.
app.set_route('/use/post', user_create, METHOD_POST)
def to_response(response) link | top
log = <Logger poorwsgi (WARNING)> top
re_filter = (<(\w+)(:[^>]+)?>, 32) top
module request link | top
class Args link | top
Compatibility class for read values from QUERY_STRING.
Class is based on dictionary. It has getfirst and getlist methods, which can call function on values.
def __init__(self, req, keep_blank_values=0, strict_parsing=0) link | top
def getfirst(self, key, default=None, fce=<class 'str'>) link | top
Returns first variable value for key or default.
- fce: convertor (str)
function which processed value.
def getlist(self, key, fce=<class 'str'>) link | top
Returns list of variable values for key or empty list.
- fce: convertor (str)
function which processed value.
class EmptyForm link | top
def getfirst(self, key, default=None, fce=<class 'str'>) link | top
def getlist(self, key, fce=<class 'str'>) link | top
def getvalue(self, key, default=None) link | top
class FieldStorage link | top
Class based of cgi.FieldStorage.
Instead of FieldStorage from cgi module, can have better getfirst and getlist methods which can call function on values and can set file_callback.
Constructor post special environment to base class, which do POST emulation for any request, because base cgi.FieldStorage know only GET, HEAD and POST methods an read from all variables, which we don't want.
There are some usable variables, which you can use, if you want to test what variable it is:
| name: | variable name, the same name from input attribute. |
|---|---|
| type: | mime-type of variable. All variables have internal mime-type, if that is no file, mime-type is text/plain. |
| filename: | if variable is file, filename is its name from form. |
| file: | file type instance, from you can read variable. This instance could be TemporaryFile as default for files, StringIO for normal variables or instance of your own file type class, create from file_callback. |
| lists: | if variable is list of variables, this contains instances of FieldStorage. |
def __bool__(self) link | top
def __contains__(self, key) link | top
def __del__(self) link | top
def __enter__(self) link | top
def __exit__(self, *args) link | top
def __getattr__(self, name) link | top
def __getitem__(self, key) link | top
def __init__(self, req, headers=None, outerboundary=b'', environ=None, keep_blank_values=0, strict_parsing=0, limit=None, encoding='utf-8', errors='replace', file_callback=None) link | top
Constructor of FieldStorage.
Many of input parameters are need only for next internal use, because FieldStorage parse variables recursive. You need add only:
def __iter__(self) link | top
def __len__(self) link | top
def __repr__(self) link | top
def get(self, key, default=None) link | top
def getfirst(self, key, default=None, fce=<class 'str'>) link | top
Returns first variable value for key or default, if key not exist.
- Arguments:
- key: str
key name
- default: None
default value if key not found
- fce: convertor (str)
Function or class which processed value.
def getlist(self, key, fce=<class 'str'>) link | top
Returns list of variable values for key or empty list.
- Arguments:
- key: str
key name
- fce: convertor (str)
Function or class which processed value.
def getvalue(self, key, default=None) link | top
def keys(self) link | top
def make_file(self, binary=None) link | top
Return readable and writable temporary file.
- Arguments:
- binary: None
Unused. Here is only for backward compatibility
def read_binary(self) link | top
def read_lines(self) link | top
def read_lines_to_eof(self) link | top
def read_lines_to_outerboundary(self) link | top
def read_multi(self, environ, keep_blank_values, strict_parsing) link | top
def read_single(self) link | top
def read_urlencoded(self) link | top
def skip_lines(self) link | top
class Headers link | top
Class inherited from collections.Mapping.
As PEP 333, resp. RFC 2616 says, all headers names must be only US-ASCII character except control characters or separators. And headers values must be store in string encoded in ISO-8859-1. This class methods Headers.add and Headers.add_header do auto convert values from UTF-8 to ISO-8859-1 encoding if it is possible. So on every modification methods must be use UTF-8 string.
def __contains__(self, key) link | top
def __delitem__(self, name) link | top
def __eq__(self, other) link | top
def __getitem__(self, name) link | top
def __init__(self, headers=[], strict=True) link | top
Headers constructor.
Headers object could be create from list, set or tuple of pairs name, value. Or from dictionary. All names or values must be iso-8859-1 encodable. If not, AssertionError will be raised.
If strict is False, headers names and values are not encoded to iso-8859-1. This is for input headers using only!
def __iter__(self) link | top
def __len__(self) link | top
def __repr__(self) link | top
def __setitem__(self, name, value) link | top
def add(self, name, value) link | top
Set header name to value.
Duplicate names are not allowed instead of Set-Cookie
.
def add_header(self, name, value, **kwargs) link | top
Extended header setting.
name is the header field to add. kwargs arguments can be used to set additional parameters for the header field, with underscores converted to dashes. Normally the parameter will be added as name="value" unless value is None, in which case only the name will be added.
h.add_header('Content-Disposition', 'attachment', filename='image.png')
All names must be US-ASCII string except control characters or separators.
def get(self, key, default=None) link | top
def get_all(self, name) link | top
def iso88591(value) link | top
Doing automatic conversion to iso-8859-1 strings.
Converts from utf-8 to iso-8859-1 string. That means, all input value of Headers class must be UTF-8 stings.
def items(self) link | top
def keys(self) link | top
def names(self) link | top
def setdefault(self, name, value) link | top
def values(self) link | top
class Json link | top
Compatibility class for read values from JSON POST, PUT or PATCH request.
It has getfirst and getlist methods, which can call function on values.
def __init__(self, req, charset) link | top
def getfirst(self, key, default=None, fce=<class 'str'>) link | top
Returns first variable value for key or default, if key not exist.
- default: any
Default value if key not exists.
- fce: convertor
Function which processed value.
def getlist(self, key, fce=<class 'str'>) link | top
Returns generoator of variable values for key.
- fce: convertor (str)
Function which processed value.
class Request link | top
HTTP request object with all server elements.
It could be compatible as soon as possible with mod_python.apache.request.
Special variables for user use are prefixed with app_
.
accept (READ) top
accept_charset (READ) top
accept_encoding (READ) top
accept_html (READ) top
accept_json (READ) top
accept_language (READ) top
accept_xhtml (READ) top
args (READ | WRITE) top
Extended dictionary (Args instance) of request arguments.
Argument are parsed from QUERY_STRING, which is typical, but not only for GET method. Arguments are parsed when Application.auto_args is set which is default.
This property could be set only once.
charset (READ) top
config (READ | WRITE) top
content_length (READ) top
cookies (READ) top
SimpleCookie iterable object of all cookies from Cookie header.
This property was set if Application.auto_cookies is set to true, which is default. Otherwise cookies was empty tuple.
debug (READ) top
document_index (READ) top
Value of poor_DocumentIndex variable.
Variable is used to generate index html page, when poor_DocumentRoot is set.
document_root (READ) top
environ (READ) top
form (READ | WRITE) top
Dictionary like class (FieldStorage instance) of body arguments.
Arguments must be send in request body with mime type one of Application.form_mime_types. Method must be POST, PUT or PATCH. Request body is parsed when Application.auto_form is set, which default and when method is POST, PUT or PATCH.
This property could be set only once.
forwarded_for (READ) top
forwarded_host (READ) top
forwarded_proto (READ) top
headers (READ) top
hostname (READ) top
is_body_request (READ) top
is_xhr (READ) top
json (READ) top
Json dictionary if request mime type is JSON.
Json types is defined in Application.json_mime_types, typical is
application/json
and request method must be POST, PUT or PATCH and
Application.auto_json must be set to true (default). Otherwise json
is EmptyForm.
method (READ) top
GET, HEAD, POST
, etc.method_number (READ) top
mime_type (READ) top
poor_environ (READ) top
Environ with poor_
variables.
It is environ from request, or os.environ
port (READ) top
protocol (READ) top
referer (READ) top
remote_addr (READ) top
remote_host (READ) top
scheme (READ) top
secret_key (READ) top
Value of poor_SecretKey variable.
Secret key is used by PoorSession class. It is generate from some server variables, and the best way is set programmatically by Application.secret_key from random data.
server_admin (READ) top
server_hostname (READ) top
server_port (READ) top
server_protocol (READ) top
Server protocol, as given by the client.
In HTTP/0.9. cgi SERVER_PROTOCOL value.
server_scheme (READ) top
server_software (READ) top
uri (READ) top
uri_handler (READ | WRITE) top
This property is set at the same point as uri_rule.
It was set by Application object when end point handler is known before calling all pre handlers. Typical use case is set some special attribute to handler, and read them in pre handler.
Property was set when any route is found for request uri. Sending file internaly when document_root is set, or by Error handlers leave uri_handler None.
uri_rule (READ | WRITE) top
Rule from one of application handler table.
This property could be set once, and that do Application object. There are some internal uri_rules which is set typical if some internal handler was called. There are: /* for default, directory and file handler and /debug-info for debug handler. In other case, there be url or regex.
user (READ | WRITE) top
user_agent (READ) top
def __del__(self) link | top
def __init__(self, environ, app_config) link | top
Object was created automatically in wsgi module.
It's input parameters are the same, which Application object gets from WSGI server plus file callback for auto request body parsing.
def construct_url(self, uri) link | top
This function returns a fully qualified URI string.
Url is create from the path specified by uri, using the information stored in the request to determine the scheme, server host name and port. The port number is not included in the string if it is the same as the default port 80.
def get_options(self) link | top
Returns dictionary with application variables from environment.
Application variables start with app_
prefix, but in returned
dictionary is set without this prefix.
poor_Debug = on # Poor WSGI variable app_db_server = localhost # application variable db_server app_templates = app/templ # application variable templates
def read(self, length=-1) link | top
Read data from client (typical for XHR2 data POST).
If length is not set, or if is lower then zero, Content-Length was be use.
def parse_negotiation(value) link | top
log = <Logger poorwsgi (WARNING)> top
re_httpUrlPatern = (^(http|https):\/\/, 32) top
module response link | top
class EmptyResponse link | top
content_length (READ) top
Return content_length of response.
That is size of internal buffer.
headers (READ | WRITE) top
reason (READ) top
HTTP response is set automatically with setting status_code.
Setting response message is not good idea, but you can create own class based on Response, when you can override status_code setter.
status_code (READ | WRITE) top
Http status code, which is state.HTTP_OK (200) by default.
If you want to set this variable (which is very good idea in http_state
handlers), it is good solution to use some of HTTP_
constant from
state module.
def __call__(self, start_response) link | top
def __end_of_response__(self) link | top
Method for internal use only!.
This method was called from Application object at the end of request for returning right value to wsgi server.
def __init__(self, status_code=200) link | top
def __start_response__(self, start_response) link | top
def add_header(self, name, value, **kwargs) link | top
def write(self, data) link | top
class FileResponse link | top
content_length (READ) top
Return content_length of response.
That is size of internal buffer.
headers (READ | WRITE) top
reason (READ) top
HTTP response is set automatically with setting status_code.
Setting response message is not good idea, but you can create own class based on Response, when you can override status_code setter.
status_code (READ | WRITE) top
Http status code, which is state.HTTP_OK (200) by default.
If you want to set this variable (which is very good idea in http_state
handlers), it is good solution to use some of HTTP_
constant from
state module.
def __call__(self, start_response) link | top
def __end_of_response__(self) link | top
Method for internal use only!.
This method was called from Application object at the end of request for returning right value to wsgi server.
def __init__(self, path, content_type=None, headers=None, status_code=200) link | top
def __start_response__(self, start_response) link | top
def add_header(self, name, value, **kwargs) link | top
def write(self, data) link | top
class GeneratorResponse link | top
content_length (READ) top
Return content_length of response.
That is size of internal buffer.
headers (READ | WRITE) top
reason (READ) top
HTTP response is set automatically with setting status_code.
Setting response message is not good idea, but you can create own class based on Response, when you can override status_code setter.
status_code (READ | WRITE) top
Http status code, which is state.HTTP_OK (200) by default.
If you want to set this variable (which is very good idea in http_state
handlers), it is good solution to use some of HTTP_
constant from
state module.
def __call__(self, start_response) link | top
def __end_of_response__(self) link | top
Method for internal use only!.
This method was called from Application object at the end of request for returning right value to wsgi server.
def __init__(self, generator, content_type='text/html; charset=utf-8', headers=None, status_code=200) link | top
def __start_response__(self, start_response) link | top
def add_header(self, name, value, **kwargs) link | top
def write(self, data) link | top
class HTTPException link | top
def __init__(self, arg) link | top
status_code is one of HTTP_* status code from state module.
If response is set, that will use, otherwise the handler from Application will be call.
class RedirectResponse link | top
Redirect the browser to another location.
When permanent is true, MOVED_PERMANENTLY status code is sent to the client, otherwise it is MOVED_TEMPORARILY. A short text is sent to the browser informing that the document has moved (for those rare browsers that do not support redirection); this text can be overridden by supplying a text string.
content_length (READ) top
Return content_length of response.
That is size of internal buffer.
headers (READ | WRITE) top
reason (READ) top
HTTP response is set automatically with setting status_code.
Setting response message is not good idea, but you can create own class based on Response, when you can override status_code setter.
status_code (READ | WRITE) top
Http status code, which is state.HTTP_OK (200) by default.
If you want to set this variable (which is very good idea in http_state
handlers), it is good solution to use some of HTTP_
constant from
state module.
def __call__(self, start_response) link | top
def __end_of_response__(self) link | top
Method for internal use only!.
This method was called from Application object at the end of request for returning right value to wsgi server.
def __init__(self, location, permanent=False, message=b'', headers=None) link | top
def __start_response__(self, start_response) link | top
def add_header(self, name, value, **kwargs) link | top
def write(self, data) link | top
class Response link | top
HTTP Response object.
This is base Reesponse object which is process with PoorWSGI application.
content_length (READ) top
Return content_length of response.
That is size of internal buffer.
headers (READ | WRITE) top
reason (READ) top
HTTP response is set automatically with setting status_code.
Setting response message is not good idea, but you can create own class based on Response, when you can override status_code setter.
status_code (READ | WRITE) top
Http status code, which is state.HTTP_OK (200) by default.
If you want to set this variable (which is very good idea in http_state
handlers), it is good solution to use some of HTTP_
constant from
state module.
def __call__(self, start_response) link | top
def __end_of_response__(self) link | top
Method for internal use only!.
This method was called from Application object at the end of request for returning right value to wsgi server.
def __init__(self, data=b'', content_type='text/html; charset=utf-8', headers=None, status_code=200) link | top
def __start_response__(self, start_response) link | top
def add_header(self, name, value, **kwargs) link | top
def write(self, data) link | top
class StrGeneratorResponse link | top
content_length (READ) top
Return content_length of response.
That is size of internal buffer.
headers (READ | WRITE) top
reason (READ) top
HTTP response is set automatically with setting status_code.
Setting response message is not good idea, but you can create own class based on Response, when you can override status_code setter.
status_code (READ | WRITE) top
Http status code, which is state.HTTP_OK (200) by default.
If you want to set this variable (which is very good idea in http_state
handlers), it is good solution to use some of HTTP_
constant from
state module.
def __call__(self, start_response) link | top
def __end_of_response__(self) link | top
Method for internal use only!.
This method was called from Application object at the end of request for returning right value to wsgi server.
def __init__(self, generator, content_type='text/html; charset=utf-8', headers=None, status_code=200) link | top
def __start_response__(self, start_response) link | top
def add_header(self, name, value, **kwargs) link | top
def write(self, data) link | top
def abort(arg) link | top
def make_response(data, content_type='text/html; character=utf-8', headers=None, status_code=200) link | top
Create response from simple values.
Data could be string, bytes, or bytes returns iterable object like file.
def redirect(location, permanent=False, message=b'', headers=None) link | top
log = <Logger poorwsgi (WARNING)> top
module results link | top
def bad_request(req) link | top
def debug_info(req, app) link | top
def directory_index(req, path) link | top
def forbidden(req) link | top
def handlers_view(handlers, sort=True) link | top
def hbytes(val) link | top
def html_escape(s) link | top
def human_methods_(m) link | top
def internal_server_error(req) link | top
More debug 500 Internal Server Error server handler.
It was be called automatically when no handlers are not defined in dispatch_table.errors. If poor_Debug variable is to On, Tracaback will be generated.
def method_not_allowed(req) link | top
def not_found(req) link | top
def not_implemented(req, code=None) link | top
def not_modified(req) link | top
HTML_ESCAPE_TABLE = {'&': '&', '"': '"', "'": ''', '>': '>', '<': '<'} top
default_states = {304: {1: <function not_modified at 0x7f4fd82e38c8>, 2: <function not_modified at 0x7f4fd82e38c8>, 4: <function not_modified at 0x7f4fd82e38c8>, 8: <function not_modified at 0x7f4fd82e38c8>, 16: <function not_modified at... top
log = <Logger poorwsgi (WARNING)> top
module session link | top
class NoCompress link | top
Fake compress class/module whith two static method for PoorSession.
If compress parameter is None, this class is use
def compress(data, compresslevel=0) link | top
def decompress(data) link | top
class PoorSession link | top
Self-contained cookie with session data.
You cat store or read data from object via PoorSession.data variable which must be dictionary. Data is stored to cookie by pickle dump. Be careful with stored object. You can add object with litle python trick:
sess = PoorSession(req) sess.data['class'] = obj.__class__ # write to cookie sess.data['dict'] = obj.__dict__.copy() obj = sess.data['class']() # read from cookie obj.__dict__ = sess.data['dict'].copy()
Or for beter solution, you can create export and import methods for you object like that:
class Obj(object): def import(self, d): self.attr1 = d['attr1'] self.attr2 = d['attr2'] def export(self): d = {'attr1': self.attr1, 'attr2': self.attr2} return d obj = Obj() sess = PoorSession(req) sess.data['class'] = obj.__class__ # write to cookie sess.data['dict'] = obj.export() obj = sess.data['class']() # read from cookie obj.import(sess.data['dict'])
def __init__(self, req, expires=0, path='/', SID='SESSID', compress=<module 'bz2' from '/usr/lib/python3.6/bz2.py'>) link | top
Constructor.
- Arguments:
- expires: int
cookie expire time in seconds, if it 0, no expire is set
- path: str
cookie path
- SID: str
cookie key name
- compress: compress module or class.
Could be bz2, gzip.zlib, or any other, which have standard compress and decompress methods. Or it could be None to not use any compressing method.
def destroy(self) link | top
def header(self, headers=None) link | top
Generate cookie headers and append it to headers if it set.
Returns list of cookie header pairs.
def renew(self) link | top
def write(self) link | top
Store data to cookie value.
This method is called automatically in header method.
def hidden(text, passwd) link | top
(en|de)crypt text with sha hash of passwd via xor.
- Arguments:
- text: str
raw data to (en|de)crypt. Could be str, or bytes
- passwd: str
password


In order to activate your account, you need to confirm your email address.
To do this, please click on the link in the mail, then login again.