Monday 20 November 2017

encoding HTTP request characters & > " < ' &amp; &gt; &quot; &lt; &apos; %22%27%3C%3E%26


Encoded request for """Test msg AMP GT QUOT \r &>"\r"""
POST /test HTTP/1.1
content-type: application/x-www-form-urlencoded
Host: test:8080
Content-Length: 133
various_params=whatever&text=Test+msg+AMP+GT+QUOT+%c3%96r+%26%3e%22%c3%96rHTTP/1.1 200 OK
https://www.url-encode-decode.com/
TEST AMP GT QUOT SLASHR & > " \r
TEST+AMP+GT+QUOT+SLASHR+%26+%3E+%22+%5Cr%0D%0A
INPUT:
TEST AMP GT QUOT SLASHR & > " \r
TEST+AMP+GT+QUOT+SLASHR+%26+%3E+%22+%5Cr%0D%0A
0:    (  2  <  F  P  Z  d   n   x
1:    )  3  =  G  Q  [  e   o   y
2:    *  4  >  H  R  \  f   p   z
3: !  +  5  ?  I  S  ]  g   q   {
4: "  ,  6  @  J  T  ^  h   r   |
5: #  -  7  A  K  U  _  i   s   }
6: $  .  8  B  L  V  `  j   t   ~
7: %  /  9  C  M  W  a  k   u  DEL
8: &  0  :  D  N  X  b  l   v
9: ´  1  ;  E  O  Y  c  m   w

HTTP request encoded OUTPUT:

TEST+AMP+GT+QUOT+SLASHR+%26+%3E+%22+%5Cr%0D%0A
TEST%2BAMP%2BGT%2BQUOT%2BSLASHR%2B%2526%2B%253E%2B%2522%2B%255Cr%250D%250A%0D%0A
0%3A++++%28++2++%3C++F++P++Z++d+++n+++x%0D%0A
1%3A++++%29++3++%3D++G++Q++%5B++e+++o+++y%0D%0A
2%3A++++%2A++4++%3E++H++R++%5C++f+++p+++z%0D%0A
3%3A+%21++%2B++5++%3F++I++S++%5D++g+++q+++%7B%0D%0A
4%3A+%22++%2C++6++%40++J++T++%5E++h+++r+++%7C%0D%0A
5%3A+%23++-++7++A++K++U++_++i+++s+++%7D%0D%0A
6%3A+%24++.++8++B++L++V++%60++j+++t+++%7E%0D%0A
7%3A+%25++%2F++9++C++M++W++a++k+++u++DEL%0D%0A
8%3A+%26++0++%3A++D++N++X++b++l+++v%0D%0A
9%3A+%C2%B4++1++%3B++E++O++Y++c++m+++w%0D%0A

TABLE: (with SPACE chars stripped)

0%3A        %28 2   %3C F P Z   d n x    %0D%0A
1%3A        %29 3   %3D G Q %5B e o y    %0D%0A
2%3A +      %2A 4   %3E H R %5C f p z    %0D%0A
3%3A %21    %2B 5   %3F I S %5D g q %7B  %0D%0A
4%3A %22    %2C 6   %40 J T %5E h r %7C  %0D%0A
5%3A %23    -   7   A   K U _   i s %7D  %0D%0A
6%3A %24    .   8   B   L V %60 j t %7E  %0D%0A
7%3A %25    %2F 9   C   M W a   k u DEL  %0D%0A
8%3A %26    0   %3A D   N X b   l v      %0D%0A
9%3A %C2%B4 1   %3B E   O Y c   m w      %0D%0A
Encoding of SPACE is + or %20. 
Encoding of ' ? %27 or %C2%B4 ?
The ' char from man ascii was not '! But ´. Interesting.
Encoding of ' is %27.



XML escape characters

There are only five:

"   &quot;  %22
'   &apos;  %27
<   &lt;  %3C
>   &gt; %3E
&   &amp; %26

All 5 special characters must not be escaped in comments or CDATA sections or XML processing instructions.




ASCII table from man ascii linux

  30 40 50 60 70 80 90 100 110 120
 ---------------------------------
0:    (  2  <  F  P  Z  d   n   x
1:    )  3  =  G  Q  [  e   o   y
2:    *  4  >  H  R  \  f   p   z
3: !  +  5  ?  I  S  ]  g   q   {
4: "  ,  6  @  J  T  ^  h   r   |
5: #  -  7  A  K  U  _  i   s   }
6: $  .  8  B  L  V  `  j   t   ~
7: %  /  9  C  M  W  a  k   u  DEL
8: &  0  :  D  N  X  b  l   v
9: ´  1  ;  E  O  Y  c  m   w

Tuesday 14 November 2017

Inscribe square within circle. Geometric construction.

From question on Euclidea geometry app. 

Given: circle C1 and points a1 at centre of circle and a2 on circle.
Construct: square inscribed in C1 with one corner at a2.
Must do it using only 7 elementary moves(i.e. draw circle or line)

Question is answered here:
https://math.stackexchange.com/questions/1587861/inscribing-square-in-circle-in-just-seven-compass-and-straightedge-steps#

I found that inscribing hexagon (and it's 6 equilateral triangles) in the big circle helped me to understand how the construction works. 60 degree and 30 degree and 15 degree angle divisions are key.


F

It is still difficult (for me!) to break it down and prove how it works. Anyway. I have tried. It could perhaps be simplified. Given: circle C1 and points a1 at centre of circle and a2 on circle. Construct: square inscribed in C1 with one corner at a2. 1. Draw circle C2 with centre at a2 and a1 on circle (same radius as C1). Call the points where C1 and C2 intersect p1 and p2. line lengths |a1p1| = |p1a2| = |a1a2| = radius of C1,C2 so little triangles a1a2p1 and a1a2p2 (not shown) are equilateral (60 degree angles) 6 of these triangles could be inscribed into C2 giving a smaller hexagon this smaller hexagon gives us point p3 and proves triangle p1p2p3 is equilateral. 2. Draw big circle C3 with centre p1 and passing through p2. We know Tri p1p2p3 is equilateral, we can also construct equilateral triangle p1p2p8 and construct hexagon p2p3p4p6p7p8 This construction also shows that p8 and p3 where big circle C3 intersects C2 and C1 align (vertical in diagram) with a1 and a2. 3. Draw Line a1p1 extended, this gives us points p5 and b where it intersects C3 We want to construct side of square line p8s1(s1 not marked leftmost point on square) at 15 degrees to p8p1


The squares' sides are at angles of 45 degrees from horizontal. Line p8p1 on equilateral triangle is 60 degrees from horizontal. 15 degrees between them.
     Line a1p1 bisects triangle p1p2p8 (as it does also to triangle p1p4p6 and hexagon) as it is side of little triangle a1a2p1 
     so
     
     Consider Triangle p1p5p8
     We can see
     Lines p1p5 = p1p8 = radius of big circle
     so
    So point s1 is on line p8p5 where it intersects C1 
4. Draw Line p5p8 giving square side s1p8
    
     Line p5b is diameter of circle C3
     Angle Thales' theorem
     This means Line p8b extended to p10 is another side of the square.

5. Draw Line p8b extended to p10 where it intersects C1 giving another side of square p8p10

6. Draw side a2p10

7. Draw side a2s1

That's it.

Interesting to note the angles in the circle segments. And the lengths of the circle segments. Circles C1 (and C2) give a sixth of circumference of circle C3.

Interesting also the angles around point a2 (and around p8):
     
     
      360 - 240 - 90 = 360 - 330 = 30 degrees
      So


Monday 13 November 2017

Special interest badge form template for Scouting Ireland

Special interest form templates 
For Scouting Ireland special interest badges.



EMBED .pdf doc from Google Drive:





Inspiration: 
b&w description and simple template at end. Nice.

colour slides describing special interest:
cub samples/examples:
orienteering samples:

Some ideas for special interest project tasks:
 Prepare and run an activity for your scout troop (or younger section) based on your project.
 Create and try out a game for your scout troop (or younger section) on the theme of your project.
 Create and try out a game which will teach some aspect of your project.
   With activities you bring to your troop REVIEW them and see if they can be made better.

one page desc:

template: colourful, nice BUT used it before and confused scouts topic/project/tasks areas unclear/overlap:
"What is your project? Describe what you want to do and the steps to get there"
"What do you hope to achieve doing this badge? How will you know when you are finished?"
I used as base for attached template .odg/B.pdf
GOOD content (CUBS): https://sites.google.com/site/cubsireland/personal-progression/getting-started


where on uniform and how to sew:


NameSectionFurther reading
Map-makerScoutcraftCartography
PioneeringScoutcraftPioneering
SignallingScoutcraftSignalling
CamperCampingCamping
Camp ChefCampingCamping
Campfire LeaderCampingCampfire
QuartermasterCampingQuartermaster
Camp LeaderCamping
HikerAdventureHiking
Hike LeaderAdventure
Hill WalkerAdventure
OrienteerPhysical AbilityOrienteering
CyclistPhysical AbilityCycling
AthletePhysical AbilityAthletics
SportsPhysical AbilitySport
Self DefencePhysical AbilitySelf Defence
ElectricianElectronics
ElectronicsElectronics
RadioElectronics
Computer ApplicationsElectronics
Computer ProgrammerElectronics
Computer SkillsElectronics
Car MechanicSkills
Home ManagerSkills
Metal WorkerSkills
WoodworkerSkills
WoodcarverSkills
BookbinderCrafts
ArtistCrafts
PrinterCrafts
PhotographerCrafts
BasketryCrafts
LeathercraftCrafts
CollectorCrafts
EquestrianNature
Sea FishingNature
Pet KeeperNature
GardenerNature
AnglerNature
ArchaeologistNatural Sciences
GeologistNatural Sciences
FarmerNatural Sciences
NaturalistFaith and Environment
ObserverFaith and Environment
ForesterFaith and Environment
CivicsFaith and Environment
ScriptureFaith and Environment
FaithFaith and Environment
Bell ringerEntertainment
BuglerEntertainment
MusicianEntertainment
EntertainerEntertainment
Irish DancerEntertainment
Fire SafetyPublic Service
EmergencyPublic Service
GuidePublic Service
InterpreterPublic Service
Life SaverPublic Service
Advanced Life SaverPublic Service
Home MaintenancePublic Service
Public HealthPublic Service
Public SpeakingPublic Service
ConsumerPublic Service
SecretaryPublic Service
LibrarianPublic Service
Social AwarenessSocial awareness
World FriendshipSocial awareness
ConservationSocial awareness
GaeilgeLanguagesGaeilge