- www.gideondsouza.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> L4 = [x*x for x in range(10)] #this will evaluate to a list of squares from 1 to 10 | |
>>> L4 | |
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81] | |
>>> #the next comprehension will evaluate to a list of even numbers from 1 to 20 | |
>>> L3 = [x for x in range(20) if x % 2 == 0] | |
>>> L3 | |
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18] | |
>>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Gideon\Coding>python | |
Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AM | |
D64)] on win32 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> L1 = [1,2,3] #this is how you define a plain list | |
>>> L1 #type the variable and... | |
[1, 2, 3] #....this is what it's content looks like | |
>>> L2 = [x for x in range(20)] #now shove a for into a list and you have a dynamic list | |
>>> L2 | |
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Session and log</title> | |
</head> | |
<body> | |
<form action='/login' method='POST'> | |
User Name : <input type='text' name='user'/> | |
Password: <input type='password' name='pass' /> | |
<input type='hidden' name='path' value='[% path %]'/> | |
<input type='submit' value='Login' /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Dancer2; | |
use strict; | |
use warnings; | |
set session => "Simple"; | |
hook before => sub { | |
if (!session('user') && request->dispatch_path !~ m{^/login}) { | |
forward '/login', { requested_path => request->dispatch_path }; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 use Dancer2; | |
2 use strict; | |
3 use warnings; | |
4 | |
5 set session => 'Simple'; | |
6 | |
7 get '/store' => sub { | |
8 session foo => 'Something'; | |
9 return "Stored"; | |
10 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpanm (App::cpanminus) 1.6005 on perl 5.016003 built for MSWin32-x64-multi-thread | |
Work directory is C:\Users\GIDEON~1.CON/.cpanm/work/1378190596.8644 | |
You have make C:\strawberry\c\bin\dmake.exe | |
You have LWP 6.04 | |
Falling back to Archive::Tar 1.90 | |
Searching Dist::Zilla on cpanmetadb ... | |
--> Working on Dist::Zilla | |
Fetching http://www.cpan.org/authors/id/R/RJ/RJBS/Dist-Zilla-4.300037.tar.gz | |
-> OK | |
Unpacking Dist-Zilla-4.300037.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Created by tryperl.com | |
use strict; | |
use warnings; | |
print "Go Ahead and edit me!"; | |
print "Once you are done editing, click SAVE to save changes :D"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Created by tryperl.com | |
use strict; | |
use warnings; | |
print 'Hello World'; | |
#I changed this after forking it :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Created by tryperl.com | |
use strict; | |
use warnings; | |
print 'Hello World'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Created on 26-0-113 at 21 hour(s) | |
use strict; | |
use warnings; | |
print 'Hello World'; | |
#This fie has changes now:) |