Below some tools you can use for information gathering while performing a penetration test:
Online
googledorks from Hackers for Charity and from the Exploit Database
IP-address: free IP Address Lookup
Netcraft: what is that site running?
SHODAN: search engine for all connected object around the world (even fridges)
Threat Agent: collect informations from open sources (seems to be down?)
Wolfram|Alpha: compute answers and provide knowledge
YouGetSignal: collection of uncomplicated, powerful network tools
*Nix
amap: identify applications running on a port (default or not) with his database signature
apache-users: Apache users enumeration
arachni: audit tools that performs vulnerabilites assessment
Automater: retrieve information of a domain from different web sources (ip, age, geoloc, country, dns)
bed: check daemons for potential buffer overflows
bing-ip2hosts: (try to) retrieve all domain name hosted by an ip or another domain from Bing search engine
BlindElephant: fingerprint web app by comparing static files hash
braa: snmp mass scanner, like snmpwalk or snmpget or snmpcheck but can scan many host in the same time (oid required)
dirb: looks for hidden directories
dirbuster: looks for hidden directories and files
doona: improved bed tool
Burp Suite: java integrated platform for performing security testing of web applications
cdpsnarf: intercepts CDP packets (Cisco Discovery Protocol)
CeWL: create word lists by spidering a website
cisco-torch: cisco router exploitation tools, scans and brute force
dig: DNS lookup utility
discover: aggregator of different information gathering tools, discover generates html report
dmitry: email, subdomain, whois, port scan for a given domain
dnsenum: enumerate subdomains and other domain related information
dnsmap: perform dns enumeration
dnsrecon: perform dns enumeration
dnstracer: follows the chain of a given dns server
dnswalk: perform dns zone transfer
enum4linux: wrapper of samba information gathering tools
Fierce: DNS Enumeration
fimap: local/remote file inclusion exploitation tool
Firewalk: an active reconnaissance network security tool that attempts to determine what layer 4 protocols a given IP forwarding device will pass.
goofile: search filetype of a given domain on Google
GoLismero: perform passive/active scan and vulnerabilities assessment
Halberd: discover web servers behind load balancers
hping: improved ping, traceroute, firewall testing, port scanning, os fingerprinting, send file
host: DNS lookup utility
HTTrack: website copier
intrace: traceroute like
iSMTP: smtp user enumeration
knock: python tool designed to enumerate subdomains
load balancing detector: detects if a given domain uses load balancing
lynis: security auditing tools who performs local configuration tests
Maltego: gather informations about persons, emails, domain, social networks…
masscan: perform port scan like nmap but really faster
Metagoofil: extract metadata of public documents
Metasploit: “world’s most used penetration testing software”
Nessus: vulnerability scanner
NeXpose: vulnerability management solution
nmap: network exploration tool and security / port scanner
nslookup: query Internet name servers interactively
onesixtyone: simple SNMP scanner
openvas-scanner: security auditing tool used for testing remote systems
p0f: identify the players behind tpc/ip communications
Paros: java based HTTP/HTTPS proxy for assessing web application vulnerability
parsero: test robots.txt entries (can even search in Bing)
pdfinfo: PDF information extractor
ping: send packets to network hosts
recon-ng: web reconnaissance framework written in Python
smtp-user-enum: username guessing tool
snmpcheck: snmp service enumeration
snmpenum: powerful Snmp Enumeration tool
SSLScan: SSL port scanner
sslyze: analyze ssl configuration
telnet: interactive communication
theHarvester: gather informations on social networks and search engines results
tlssled: check ssl/tls version (based on sslscan)
traceroute & tcptraceroute: print the route packets trace to network host
URLCrazy: generate domain names based on letter permutation of a given domain name and try to resolve them
WebScarab: java framework for analysing applications who use HTTP and HTTPS
wget: non-interactive network downloader
WhatWeb: web scanner to identify what websites are running
whois: returns domain name informations
Xplico: network tool analyzer
zaproxy: proxy tool used to find vulnerabilities, can perform scans and fuzzing
Windows
FOCA: find metadata and hidden information in the documents its scans
NeoTrace: visual traceroute program
Website Ripper Copier: website downloader software to save website data
Xcode Exploit Scanner: help you to gather the dorks link from Google
to be continued…


{% extends "core/base.html" %} {% block title %}Member Detail{% endblock %} {% block content %}
{% block no_bug_message %}No bug assigned to this member.{% endblock %}
{% endif %}{% block no_project_message %}This member is not part of any project.{% endblock %}
{% endif %}


Democrat
Republican
2000
Map created by DeeDee Kim
Data from: National Archives and Records Administration


Since they are still preserved in the rocks for us to see, they must have been formed quite recently, that is, geologically speaking. What can explain these striations and their common orientation? Did you ever hear about the Great Ice Age or the Pleistocene Epoch? Less than one million years ago, in fact, some 12,000 years ago, an ice sheet many thousands of feet thick rode over Burke Mountain in a southeastward direction.
If you're looking for random paragraphs, you've come to the right place. When a random word or a random sentence isn't quite enough, the next logical step is to find a random paragraph. We created the Random Paragraph Generator with you in mind.
Since they are still preserved in the rocks for us to see, they must have been formed quite recently, that is, geologically speaking. What can explain these striations and their common orientation? Did you ever hear about the Great Ice Age or the Pleistocene Epoch? Less than one million years ago, in fact, some 12,000 years ago, an ice sheet many thousands of feet thick rode over Burke Mountain in a southeastward direction.
While it may not be obvious to everyone, there are a number of reasons creating random paragraphs can be useful. A few examples of how some people use this generator are listed in the following paragraphs.


|
2D Platformer
|
#include <Player.h>
Public Types | |
| enum | m_moveState { m_STOP, m_LEFT, m_RIGHT } |
| enum | m_jumpState { j_STOP, j_JUMP } |
| Public Types inherited from PhysicalThing | |
| enum | CollisionFilter { Player_SENSOR = 1, GREENBOX = 2, Enemy_SENSOR = 4, Colectables = 8, Enemy = 16, PLAYER = 32, BULLET = 64, RADAR_SENSOR = 128, ENEMY_BULLET = 256 } |
| function for destroying a body | |
Public Member Functions | |
| Player (b2World *world, const sf::Vector2f &position, const sf::Vector2f &size, const float orientation, CollisionFilter type, sf::Texture *Headtexture, sf::Texture *Bodytexture, sf::Texture *Armtexture, sf::Texture *Legtexture) | |
| Default Constructor. More... | |
| void | draw (sf::RenderTarget &target, sf::RenderStates states) const |
| void | update (sf::Clock Clock) |
| Update rendering infomation. | |
| void | applyImpulse (b2Vec2 impulse) |
| bool | isStopped () const |
| void | Step () |
| void | Move (bool pw, unsigned char key) |
| void | onAction () |
| void | offAction () |
| void | Transform () |
| sf::Vector2f | getPosition () |
| float | getHandRotation () |
| void | HandRotation (sf::Vector2f xy) |
| void | addCoins (int addCoins) |
| void | Getkeys (bool W, bool S, bool A, bool D) |
| void | HealthLoss (char enemy) |
| void | registerForDeletion () |
| bool | shouldDelete () |
| Public Member Functions inherited from PhysicalThing | |
| void | destroyBody () |
| void | setUserData (void *data) |
Public Attributes | |
| bool | m_delete = false |
| m_moveState | moveState |
| m_jumpState | jumpState |
| sf::Vector2f | ReyVector |
| float | a |
| float | m_HandRotation |
| bool | W |
| bool | S |
| bool | D |
| bool | A |
Private Attributes | |
| int | Coins |
| Coins variable. | |
| bool | m_stopped = false |
| jump variable | |
| sf::RectangleShape | Player_Body |
| Player Body Rectangle Shape. | |
| sf::RectangleShape | Player_Head |
| Player Head Rectangle Shape. | |
| sf::RectangleShape | Player_Hand |
| Player Hand Rectangle Shape. | |
| sf::RectangleShape | Player_lLeg |
| Player lLeg Rectangle Shape. | |
| sf::RectangleShape | Player_rLeg |
| Player rLeg Rectangle Shape. | |
| sf::RectangleShape | Player_Health |
| Player Health Rectangle Shape. | |
| sf::Clock | Clock |
| Clock variable. | |
| float | timestamp |
| timestamp variable | |
| int | Health |
| Health variable. | |
| float | Health100 |
| Health variable. | |
| float | newHealth |
| Health variable. | |
| float | Damage1 |
| Damage variable. | |
| float | Damage2 |
| Damage variable. | |
| float | newHealth100 |
| Health variable. | |
Additional Inherited Members | |
| Protected Attributes inherited from PhysicalThing | |
| b2Body * | m_body = nullptr |
| Box2D body, no need to delete this as BOX2D will look after it. | |
| float | mk_fDensity = 1.0f |
| Density of the material - used to give mass. | |
| float | mk_fFriction = 0.4f |
| Friction - I guess this is only friction from movement, not when static. | |
| float | mk_fRestitution = 0.4f |
| Restitution - bouncyness of stuff. | |
| Player::Player | ( | b2World * | world, |
| const sf::Vector2f & | position, | ||
| const sf::Vector2f & | size, | ||
| const float | orientation, | ||
| CollisionFilter | type, | ||
| sf::Texture * | Headtexture, | ||
| sf::Texture * | Bodytexture, | ||
| sf::Texture * | Armtexture, | ||
| sf::Texture * | Legtexture | ||
| ) |
Default Constructor.
Complete contructor


procedure Draw(Bitmap: TCustomBitmap32; OutlineColor, FillColor: TColor32; Transformation: TTransformation = nil); overload;
procedure Draw(Bitmap: TCustomBitmap32; OutlineColor: TColor32; FillLineCallback: TFillLineEvent; Transformation: TTransformation = nil); overload;
procedure Draw(Bitmap: TCustomBitmap32; OutlineColor: TColor32; Filler: TCustomPolygonFiller; Transformation: TTransformation = nil); overload;
Fills the polygon and draws the outline transformed by Transformation. This method is a simple combination of DrawFill and DrawEdge methods.


A decorative fence
问题描述 :
Richard just finished building his new house.  He had no idea how to make a wooden fence, so he decided to order one. Somehow he got his hands on the ACME Fence Catalogue 2002, the ultimate resource on cute little wooden fences. After reading its preface he already knew, what makes a little wooden fence cute.
A wooden fence consists of N wooden planks, placed vertically in a row next to each other. A fence looks cute if and only if the following conditions are met:
�The planks have different lengths, namely 1, 2, . . . , N plank length units.
�Each plank with two neighbors is either larger than each of its neighbors or smaller than each of them. (Note that this makes the top of the fence alternately rise and fall.)
It follows, that we may uniquely describe each cute fence with N planks as a permutation a1, . . . , aN of the numbers 1, . . . ,N such that (any i; 1 < i < N) (ai − ai−1)*(ai − ai+1) > 0 and vice versa, each such permutation describes a cute fence.
It is obvious, that there are many dierent cute wooden fences made of N planks. To bring some order into their catalogue, the sales manager of ACME decided to order them in the following way: Fence A (represented by the permutation a1, . . . , aN) is in the catalogue before fence B (represented by b1, . . . , bN) if and only if there exists such i, that (any j < i) aj = bj and (ai < bi). (Also to decide, which of the two fences is earlier in the catalogue, take their corresponding permutations, find the first place on which they differ and compare the values on this place.) All the cute fences with N planks are numbered (starting from 1) in the order they appear in the catalogue. This number is called their catalogue number.
After carefully examining all the cute little wooden fences, Richard decided to order some of them. For each of them he noted the number of its planks and its catalogue number. Later, as he met his friends, he wanted to show them the fences he ordered, but he lost the catalogue somewhere. The only thing he has got are his notes. Please help him find out, how will his fences look like.
A wooden fence consists of N wooden planks, placed vertically in a row next to each other. A fence looks cute if and only if the following conditions are met:
�The planks have different lengths, namely 1, 2, . . . , N plank length units.
�Each plank with two neighbors is either larger than each of its neighbors or smaller than each of them. (Note that this makes the top of the fence alternately rise and fall.)
It follows, that we may uniquely describe each cute fence with N planks as a permutation a1, . . . , aN of the numbers 1, . . . ,N such that (any i; 1 < i < N) (ai − ai−1)*(ai − ai+1) > 0 and vice versa, each such permutation describes a cute fence.
It is obvious, that there are many dierent cute wooden fences made of N planks. To bring some order into their catalogue, the sales manager of ACME decided to order them in the following way: Fence A (represented by the permutation a1, . . . , aN) is in the catalogue before fence B (represented by b1, . . . , bN) if and only if there exists such i, that (any j < i) aj = bj and (ai < bi). (Also to decide, which of the two fences is earlier in the catalogue, take their corresponding permutations, find the first place on which they differ and compare the values on this place.) All the cute fences with N planks are numbered (starting from 1) in the order they appear in the catalogue. This number is called their catalogue number.
After carefully examining all the cute little wooden fences, Richard decided to order some of them. For each of them he noted the number of its planks and its catalogue number. Later, as he met his friends, he wanted to show them the fences he ordered, but he lost the catalogue somewhere. The only thing he has got are his notes. Please help him find out, how will his fences look like.
输入:
The first line of the input file contains the number K (1 <= K <= 100) of input data sets. K lines follow, each of them describes one input data set.
Each of the following K lines contains two integers N and C (1 <= N <= 20), separated by a space. N is the number of planks in the fence, C is the catalogue number of the fence.
You may assume, that the total number of cute little wooden fences with 20 planks fits into a 64-bit signed integer variable (long long in C/C++, int64 in FreePascal). You may also assume that the input is correct, in particular that C is at least 1 and it doesn抰 exceed the number of cute fences with N planks.
Each of the following K lines contains two integers N and C (1 <= N <= 20), separated by a space. N is the number of planks in the fence, C is the catalogue number of the fence.
You may assume, that the total number of cute little wooden fences with 20 planks fits into a 64-bit signed integer variable (long long in C/C++, int64 in FreePascal). You may also assume that the input is correct, in particular that C is at least 1 and it doesn抰 exceed the number of cute fences with N planks.
输出:
For each input data set output one line, describing the C-th fence with N planks in the catalogue. More precisely, if the fence is described by the permutation a1, . . . , aN, then the corresponding line of the output file should contain the numbers ai (in the correct order), separated by single spaces.
样例输入:
2 2 1 3 3
样例输出:
1 2 2 3 1
解题代码:
//* @author: import java.util.*; public class Main{ static final int MAX=21;//最多20根木条 static long w[][];//w型排列的个数 static long m[][];//m型排列的个数，m[x][n]为由n个长度不同的木条组成的栅栏中，以其中第x根木条开始的“M”型排列的个数 private int n;//木条的根数 private long c;//编号 private boolean flag[]; private boolean print; static {//初始化静态变量 w=new long[MAX][MAX]; m=new long[MAX][MAX]; w[1][1] = 1; m[1][1] = 1; w[1][2] = 0; m[1][2] = 1; w[2][2] = 1; m[2][2] = 0; for (int i = 3; i < MAX; i++) for (int j = 1; j < MAX; j++){ for (int k = 1; k < j; k++) w[j][i] += m[k][i - 1]; for (int k = j; k < i; k++) m[j][i] += w[k][i - 1]; } } public Main(int n,long c){ this.n=n; this.c=c; flag=new boolean[MAX]; print=false; } private void fand(int k, int m){ for (int i = 1; i <= m; i++) if (flag[i] && i <= k){ k++; m++; } flag[k] = true; if (print) System.out.print(" "+k); else{ System.out.print(k); print = true; } } private void doIt(){ int k = 1;//从排在最前面的木条找起 print = false; boolean direct = true, first = true; while(n!=0){ if (direct) if (c > w[k][n]){//如果编号大于以第k根木条开始的“w”型排列的个数，说明所求排列在这些排列之后 c -= w[k++][n];//更新编号，同时换一根木条 if (first) {direct = false; k--;}//如果是查找第一根木条，还要试"m"型排列 }else{ fand(k, n--);//找到k,输出并将木条总数减1 first = false; direct = false; k = 1; } else if (c > m[k][n]){//如果编号大于以第k根木条开始的“m”型排列的个数，说明所求排列在这些排列之后 c -= m[k++][n];//更新编号，同时换一根木条 if (first) direct = true;//查找第一根木条结束 }else{ fand(k, n--); first = false; direct = true; } } System.out.println(); } public static void main(String args[]){ Scanner sc=new Scanner(System.in); int t, n; long c; t=sc.nextInt();; while((t--)!=0){ n=sc.nextInt(); c=sc.nextLong(); Main m=new Main(n,c); m.doIt(); } } }
(adsbygoogle = window.adsbygoogle || []).push({});
http://www.realoj.com/problem/7如果楼主不介意，以可以在这个oj上做下，按照你的代码是错的。。。直接复制粘贴你的也是错。。不懂错在哪。
helpful！！ mark
递归还真是一门学问，学习了
不错，值得借鉴
修改一下吧 …
通不过。
第二种解法如果数组有重复元素 就不正确
已更新
补充：此算法求出的不一定是最优解，之前理解错了
通不过。
问题3中，GetRightPosition()和GetLeftPosition()与STL中的upper_bound()和lower_boune()的代码实现一样吗？
学习了
bottes vernies blanches
I appreciate the efforts you men and women place in to share blogs on such sort of matters, it was certainly useful. Keep Posting!
居然是机试，还和13年重复。题目不难


Seaborgium is a product of laboratory research, neither the element nor it's compounds are of any practical importance.


#include <Octree.h>
◆ Point() [1/3]
◆ Point() [2/3]
template<class N>
| Octree< N >::Point::Point |
( |
float |
in_x, |
|
|
float |
in_y, |
|
|
float |
in_z |
|
) |
| |
|
inline |
◆ Point() [3/3]
template<class N>
| Octree< N >::Point::Point |
( |
const float |
p2[3] | ) |
|
|
inline |
◆ operator const float *()
template<class N>
| Octree< N >::Point::operator const float * |
( |
| ) |
const |
|
inline |
◆ operator float *()
template<class N>
| Octree< N >::Point::operator float * |
( |
| ) |
|
|
inline |
◆ operator*()
◆ operator+()
◆ operator-()
◆ operator<()
template<class N>
| bool Octree< N >::Point::operator< |
( |
const Point & |
p2 | ) |
const |
|
inline |
◆ operator=()
◆ operator>=()
template<class N>
| bool Octree< N >::Point::operator>= |
( |
const Point & |
p2 | ) |
const |
|
inline |
The documentation for this struct was generated from the following file:


You decide to travel with the priest and end up at a town. The priest says his goodbyes and thanks you agin for saving him and then leaves.
You are happy to see real faces for you have been traveling on the road for many weeks
What should you do first?


| |
Methods defined here:
- __init__(self)
- Initialize self. See help(type(self)) for accurate signature.
- parse_details(self, sheet, job, service, document_id)
- Parses the details tab which has information about the report
Args:
sheet (google sheet): The google sheet to process
job (SRGJob): the pointer to the job object to hold all the results
service (google sheets service): the google sheets api service
document_id (str): the google sheets document id to fetch and process
- parse_document(self, service, document_id)
- The main function that opens the document, parses the data into a jobs
object and returns the resulting job with all the calculated values
Args:
service (google sheets service): the googlse sheets api service
document_id (str): the google sheets document id to fetch and process
Returns:
job (SRGJob): the job object containing all the job information
and calculated results from the data
- parse_sample(self, sheet, job, service, document_id)
- Parses each tab in the sheet as a separate sample.
Args:
sheet (google sheet): The google sheet to process
job (SRGJob): the pointer to the job object to hold all the results
service (google sheets service): the google sheets api service
document_id (str): the google sheets document id to fetch and process
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|


A simple app to calculate your mortgage
Loan: $
Principal And Interest: $
Tax: $
Insurance: $
Total: $


Testing from min to max. Running iterations tests.
M.randint()
Ad Hoc: Math.round(Math.random() * (max - min) + min) note: Notice the values "fall-off" near the limits of the range.
Ceil: Math.ceil(Math.random() * (max - min + 1) + min - 1) note: There is a minute possibility that this function will return (min-1). This is why floor is a better choice.


Dynamic Progress Bar with %
Centered label:
27%
20%
27%
progress1
progress2
progress3
+10
+38
-13
-18


5-MeO-DiPT can be surprisingly potent.  Please note that the dosages given below have been measured with an electronic scale with 2mg accuracy; however I can not entirely rule out the possibility of human error or a malfunction of the scale.
I had read the trip disaster stories from Erowid, but most were with very large doses so I wasn't afraid. I started my experiments with 15mg (quite high), as my tolerance for almost all drugs (tryptamines included) seems to be higher than the average. Fitting the picture, I got only what I in retrospect would say were threshold effects. Next try was 10mg insufflated, which also produced threshold effects.
I then decided to up the dose a lot to find out if 5-MeO-DiPT had anything to offer me (I was quite sceptical after the initial experiences). I ingested 26mg (a strong dose for most people, I think) of the substance, and as expected, got very nice effects. Not as psychedelic as LSD, but heightened senses and a nice body feeling coupled with some psychedelic ideation and a few visuals. Very nice :) Later I took 22mg once at home and once at a party, and had good, mellow, subtle experiences. So I thought I knew what 5-MeO-DiPT was all about: a nice little tryptamine with euphoric body feelings, not at all intense on the mental side, perfect for a social setting for instance.
One weekend I was taken by surprise by an urge to trip. I hadn't prepared at all (I usually do prepare a little) and I had just had the most intense psychedelic experience of my life some time ago (with LSD), so I wasn't looking for a full-blown trip. I decided to take some 5-MeO-DiPT for a mellow evening of listening to music etc. I decided to take a tiny bit more than I had taken before, and settled for a 30mg dose (again, a hefty dose for someone with a normal tolerance). I was pretty certain that the trip would be very light on the psyche, as 26mg had not been intense at all.
What followed was an experience that was as intense, in part even more intense, than the LSD trip that I had taken some time ago. I would say it was level 4 on Graeme Carl's scale. I would roughly estimate that the intensity was comparable with 3-5 hits of european acid, which would AFAIK probably translate to at least 6-10 hits of US acid. All in all the trip was _very_ similar to the LSD trip; I might have some trouble telling LSD and 5-MeO-DiPT apart at those doses. Visuals were almost identical with LSD visuals, and the psychedelic ideation also very much resembled that of LSD. The experience also had something that reminded me of 5-MeO-DMT, although obviously it was not _that_ intense.
5-MeO-DiPT would appear to be a pretty promising candidate for an LSD replacement for me. The only negative differences were strong nausea (which quickly passed) and muscle tremors. Also, any possible (neuro)toxicity is of course a big question mark. Anyway, where I had previously considered 5-MeO-DiPT a 'light' psychedelic for social and recreational use, I now consider it to be more of a 'serious' psychedelic that has similar potential as LSD in self-analysis and other 'serious' uses for psychedelic drugs.
I would urge anyone experimenting with 5-MeO-DiPT to use an accurate method of measuring doses in the milligram scale AND to keep in mind that the dose-response-curve seems to be extremely steep. I don't know what would've happened had I taken for example 40mg.. or the 30mg at a party or a similar setting, instead of at home. The experience was very intense even with 30mg and I had some trouble figuring out what was happening. I tried to communicate with a friend on IRC, but all efforts failed miserably :) At times I felt compelled to sit still or lie on the floor with my eyes closed to shut out visual input. Some of the trouble adapting to the experienced was likely caused by surprise at the intensity of the effects.
The time frame of the trip was comparable to LSD, except that it took 1,5 hours to come up. At +12h I was able to fall asleep, but the effects were still noticeable.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Your Language Word
Word's Translation
Hide & Random
Answer Translation
Hide Me
Random Vocabulary
CHECK
Contact Me


Doug's Gym in Dallas: a five-decade workout – in pictures
Doug Eidd opened his gym in 1962 in downtown Dallas, and over the years collected an eclectic membership. Photographer Norm Diamond photographed the last months of the gym, capturing the daily life and decay before its closure in 2018. Doug’s Gym: The Last of Its Kind is published by Kehrer
The exterior of the gym in downtown Dallas
87-year-old Doug in the gym he owned for 55 years
Gabe, a high-school student, was the youngest member of the gym
Kim, the owner of two bars in Dallas taking lessons from the boxing coach, Jeremy
Ancient lockers filled with unclaimed items
Doug worked out regularly but also took time out for quick naps on the exercise tables
Inspirational cut-outs on the hallway leading to the first-floor gym
Doug works out with Sauro, a DJ and model who came to the gym almost every day
The punchbag hangs from a traditional tin plate ceiling
Susan, a writer, straps her hand for protection before a boxing lesson
Leroy, who used to work as a parking attendant nearby, still visits occasionally
After the gym closed, Doug relocated most of the equipment to his backyard, where long-term members drop by to catch up and work out


|
|
The following styles of setup are available based on the expected usage needs.
To use the existing U3D Sample Software without recompiling it, this distribution includes a root Include and Lib directory that should be added to your project and/or compiler configuration. The precompiled binaries are provided in the Bin directory. Additional details are described on the Usage page.
The header files in the root Include directory are currently just duplicated from Source\RTL\Component\Include , Source\RTL\Kernel\Include and Source\RTL\Platform\Include . No serious attempt to reduce the headers to only those needed by clients has been made yet.
If planning to include IFXRenderingInterfaces.h , IFXDirectX7.h , IFXDirectX8.h and/or IFXOpenGL.h , it will be necessary to have the Microsoft* DirectX* 8.1 SDK headers or those from a newer version, and the SGI* OpenGL* header glext.h in the available include paths.
- To find the available versions of the DirectX* SDK visit the DirectX* section of the Microsoft* Download Center and search using "SDK" as the keyword and "DirectX" as the Product/Technology.
- A version of the SGI* OpenGL* header
glext.h is provided in the Source\RTL\Dependencies\OpenGL\Include directory.
This step is required if Universal 3D dynamic libraries are to be compiled. Before compilation, the build system configuration should be set. The default values for configuration parameters are: U3D_PLATFORM = Win32
U3D_COMPILER = cl
U3D_LINKER = link
U3D_OUTPUT = Build/U3D These values are stored in file Source\Config\u3d .conf . They should be adjusted according to user configuration. This can be done by either editing file u3d .conf or by using script Tools\BuildSystem\config .pl .
Example 1: This command changes U3D_COMPILER value to icl .
Example 2: perl config.pl Lin32 gcc ar This command changes U3D_PLATFORM value to Lin32 , U3D_COMPILER value to gcc , U3D_LINKER value to ar . This script without parameters produces help screen.
 Possible value is any path inside
$U3D_SOURCE .
To recompile the U3D Sample Software on a Microsoft* Win32 platform, it is necessary to perform the following additional steps after unzipping the U3D package:
- Start setting up the U3D build system by downloading and installing the Small Cygwin* Package (SCP) build tool. It is a small, easy-to-setup distribution of Red Hat* Cygwin* 2.416. The package is zipped and is minimal, including just those portions of Cygwin* required by the U3D build system, such as the Bash shell and Perl. This SCP package also contains Larry Wall and Clark Cooper's XML::Parser 2.34, and Grant McLean's XML::Simple 2.09 that are needed by the U3D build system and are not included with any known Cygwin* distribution.
- CygWin_2.416_Minimal.zip can be obtained from the U3D Sample Software project website on Source Forge* (http://sourceforge.net/projects/u3d/) in the files area.
- Source code used for this minimal Cygwin* distribution can also be obtained from the project website on Source Forge* (http://sourceforge.net/projects/u3d/) in the files area. These are named:
- CygWin_2.416_Source.zip
- XML-Parser-2.34.tar.gz
- XML-Simple-2.09.tar.gz
- To learn more about Cygwin* or to obtain the complete distribution visit http://www.cygwin.com/. After a complete distribution of Cygwin* is setup, make sure to install and test both XML::Parser and XML::Simple using Cygwin*. Do this by typing in the following commands from the directory that both packages were placed in:
tar xvzf XML-Parser-2.34.tar.gz
cd XML-Parser-2.34
perl Makefile.PL
make test
make install
perl -MXML::Parser -e 1; echo $?;
cd ..
tar xvzf XML-Simple-2.09.tar.gz
cd XML-Simple-2.09
perl Makefile.PL
make test
make install
perl -MXML::Simple -e 1; echo $?; There should be no error messages. The above Perl* steps will display zero if the installation was successful.
- Add the Cygwin*
Bin directory's complete path to your system's PATH environment variable. If you installed it in the typical location, this would be C:\Cygwin\Bin . - Create a new user environment variable called
U3D_SOURCE . Set it to the location of the U3D Source folder.
- Make sure to specify the complete path including the root and drive letter, as well as terminating the path with a trailing backslash. For example,
C:\SDK\U3D\Source\ . - The path specified should NOT contain any spaces due to the current build system scripts.
- In the initial build configuration, it is necessary to copy the Microsoft* DirectX* 8.1 SDK header files or those from a newer version, into the
Source\RTL\Dependencies\DirectX\Include directory.
- To find the available versions of the DirectX* SDK visit the DirectX* section of the Microsoft* Download Center and search using "SDK" as the keyword and "DirectX" as the Product/Technology.
- The projects that depend upon these SDK header files include the DirectX* 7 and 8 renderers. These are defined by the
IFXRenderingDirectX7.xml and IFXRenderingDirectX8.xml build system configuration files.
- If building the example IDTF exporter plug-in for Discreet* 3ds max* 7 is desired, the following new user environment variables need to be created to identify various directories:
MAX_SDK must contain the path to the Discreet* 3ds max* 7 SDK without a trailing backslash. For example, C:\3dsmax7\maxsdk .MAX_ROOT must contain the path to the Discreet* 3ds max* directory where it was installed without a trailing backslash. This is used for placing a copy of the IDTF exporter plugin .dle file in the plugins subdirectory. For example, C:\3dsmax7 .
To recompile the U3D Sample Software on a Linux* platform, it is necessary to perform the following additional steps after unzipping the U3D package:
- Install and test XML::Parser and XML::Simple. See above.
- Create and export environment variables:
U3D_SOURCE . Set to the location of the U3D Source directory. Include trailing slash.U3D_LIBDIR . Set to ${U3D_SOURCE}Build/U3D .- Add
U3D_LIBDIR to PATH and LD_LIBRARY_PATH variables.
Proceed to Build Procedure.
© 1999 - 2006 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.
|
|


Ask a question:
Which
is ranked
by
Answer: Putnam, Justin B.
Or, explore the full data below. Use the filter to find individual courses or instructors.
Plots of ratings over time, predictions of workload for your schedule, and more. Stay tuned!


Hi. I'm Rafael Malave.
And this is a little about what I did on this project.
And this is a little about what I did on this project.
Added a bouncing ball to the canvas.
Render a table scoreboard that shows highest scores.
Added sound effects for ball collisions and bounce effects.
Worked on adding local storage for names and scores.
Added styles to the game and scoreboard.
Worked on ball collisions with the paddles and canvas.
Ornare nulla proin odio consequat sapien vestibulum ipsum sed lorem.


Rumors that our CEO @just_artak has disappeared are false and represent attacks on Beaxy. He simply missed a panel due to family emergency. He has addressed our community directly already and will continue giving updates. We’ve been hard at work on features & liquidity y...


Paul Czarkowski /<EMAIL_ADDRESS>/ @pczarkowski
A log is a human readable, machine parsable representation of an event.
LOG = TIMESTAMP + DATA
Jan 19 13:01:13 paulcz-laptop anacron[7712]: Normal exit (0 jobs run)
120607 14:07:00 InnoDB: Starting an apply batch of log records to the database...
[1225306053] SERVICE ALERT: FTPSERVER;FTP SERVICE;OK;SOFT;2;FTP OK - 0.029 second response time on port 21 [220 ProFTPD 1.3.1 Server ready.]
[Sat Jan 19 01:04:25 2013] [error] [client <IP_ADDRESS>] File does not exist: /opt/www/vhosts/crappywebsite/html/robots.txt
<IP_ADDRESS> - - [13/Jan/2013:04:28:55 -0500] "GET /robots.txt HTTP/1.1"
301 303 "-" "Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com)"
A human readable, machine parsable representation of an event.
But they're machine parsable right?
<IP_ADDRESS> - - [13/Jan/2013:04:28:55 -0500] "GET /robots.txt HTTP/1.1"
301 303 "-" "Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com)"
Actual Regex to parse apache logs.
Actual Regex to parse apache logs.
<IP_ADDRESS> - - [13/Jan/2013:04:28:55 -0500] "GET /robots.txt HTTP/1.1"
301 303 "-" "Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com)"
<IP_ADDRESS> - - [13/Jan/2013:04:28:55 -0500] "GET /robots.txt HTTP/1.1"
301 303 "-" "Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com)"
{
"client address": "<IP_ADDRESS>",
"user": null,
"timestamp": "2013-01-13T04:28:55-0500",
"verb": "GET",
"path": "/robots.txt",
"query": null,
"http version": 1.1,
"response code": 301,
"bytes": 303,
"referrer": null
"user agent": "Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com)"
}
cat chain.plugins | grep together | sed 's/like/unix/' > pipeline
Let's talk briefly about two filters that are
very important to making our logs useful
takes a timestamp and makes it ISO 8601 Compliant
Turns this:
13/Jan/2013:04:28:55 -0500
Into this:
2013-01-13T04:28:55-0500
Grok parses arbitrary text and structures it.
Makes complex regex patterns simple.
USERNAME [a-zA-Z0-9_-]+
USER %{USERNAME}
INT (?:[+-]?(?:[0-9]+))
MONTH \b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\b
DAY (?:Mon(?:day)?|Tue(?:sday)?|Wed(?:nesday)?|Thu(?:rsday)?|Fri(?:day)?|Sat(?:urday)?|Sun(?:day)?)
COMBINEDAPACHELOG %{IPORHOST:clientip} %{USER:ident} %{USER:auth}
\[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}
(?: HTTP/%{NUMBER:httpversion})?|-)" %{NUMBER:response}
(?:%{NUMBER:bytes}|-) %{QS:referrer} %{QS:agent}
Remember our apache log from earlier?
Define Inputs and Filters.
input {
file {
type => "apache"
path => ["/var/log/httpd/httpd.log"]
}
}
filter {
grok {
type => "apache"
pattern => "%{COMBINEDAPACHELOG}"
}
date {
type => "apache"
}
geoip {
type => "apache"
}
}
Define some outputs.
output {
statsd {
type => "apache"
increment => "apache.response.%{response}"
# Count one hit every event by response
}
elasticsearch {
type => "apache"
}
}
input {
twitter {
type => "twitter"
keywords => ["bieber","beiber"]
user => "username"
password => "*******"
}
}
output {
elasticsearch {
type => "twitter"
}
}
input {
file {
type => "syslog"
path => ["/data/rsyslog/**/*.log"]
}
}
filter {
### a bunch of groks, a date, and other filters
}
output {
type => "elasticsearch"
}
input {
tcp {
type => "syslog"
port => "514"
}
udp {
type => "syslog"
port => "514"
}
}
filter {
### a bunch of groks, a date, and other filters
}
output {
type => "elasticsearch"
}
Use an encrypted Transport
Logstash Agent
input { file { ... } }
output {
lumberjack {
hosts => ["logstash-indexer1", "logstash-indexer2"]
ssl_certificate => "/etc/ssl/logstash.crt"
}
}
Logstash Indexer
input {
lumberjack {
ssl_certificate => "/etc/ssl/logstash.crt"
ssl_key => "/etc/ssl/logstash.key"
}
}
output { elasticsearch {} }
input { exec { type => "system-loadavg" command => "cat /proc/loadavg | awk '{print $1,$2,$3}'" interval => 30 } } filter { grok { type => "system-loadavg" pattern => "%{NUMBER:load_avg_1m} %{NUMBER:load_avg_5m} %{NUMBER:load_avg_15m}" named_captures_only => true } } output { graphite { host => "<IP_ADDRESS>" port => 2003 type => "system-loadavg" metrics => [<EMAIL_ADDRESS>"%{load_avg_1m}"<EMAIL_ADDRESS>"%{load_avg_5m}"<EMAIL_ADDRESS>"%{load_avg_15m}" ] } }
write a logstash module!
Can do powerful things with [ boilerplate + ] a few lines of ruby
Local log dir on clients = cheap queue
Paul Czarkowski /<EMAIL_ADDRESS>/ @pczarkowski


Global Functions in Namespace cppu
in Sourcefile factory.hxx
- createFactoryProxy
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > createFactoryProxy(
| const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & |
rServiceManager, |
| const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > & |
rFactory ) throw(); |
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
NO |
NO |
- D E P R E C A T E D
- Description
Deprecated. Creates a factory wrapping another one.
This means the methods of the interfaces XServiceProvider, XServiceInfo and
XSingleServiceFactory are forwarded.
- ATTENTION!
The XComponent interface is not supported!
- Parameters
| rServiceManager |
the service manager used by the implementation.
|
| xSingleServiceFactory |
the wrapped service factory.
|
- Return
a factory that support the interfaces XServiceProvider, XServiceInfo
XSingleServiceFactory.
- See Also
- createSingleFactory
- createOneInstanceComponentFactory
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleComponentFactory > createOneInstanceComponentFactory(
| ComponentFactoryFunc |
fptr, |
| const ::rtl::OUString & |
rImplementationName, |
| const ::com::sun::star::uno::Sequence< ::rtl::OUString > & |
rServiceNames, |
| rtl_ModuleCount * |
pModCount = 0 ) throw(); |
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
NO |
NO |
- Summary
Creates a single service factory which holds the instance created only once.
- Parameters
| fptr |
function pointer for instanciating the object
|
| rImplementationName |
implementation name of service
|
| rServiceNames |
supported services
|
| pModCount |
for future extension (library unloading concept).
|
- See Also
- createSingleComponentFactory
- createOneInstanceFactory
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > createOneInstanceFactory(
| const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & |
rServiceManager, |
| const ::rtl::OUString & |
rComponentName, |
| ComponentInstantiation |
pCreateFunction, |
| const ::com::sun::star::uno::Sequence< ::rtl::OUString > & |
rServiceNames, |
| rtl_ModuleCount * |
pModCount = 0 ) throw(); |
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
NO |
NO |
- D E P R E C A T E D
- Summary
Deprecated. Creates a single service factory which holds the instance created only once.
- Parameters
| rServiceManager |
the service manager used by the implementation.
|
| rImplementationName |
the implementation name. An empty string is possible.
|
| ComponentInstantiation |
the function pointer to create an object.
|
| rServiceNames |
the service supported by the implementation.
|
| pModCount |
for future extension (library unloading concept).
|
- Return
a factory that support the interfaces XServiceProvider, XServiceInfo
XSingleServiceFactory and XComponent.
- See Also
- createSingleFactory
- createOneInstanceRegistryFactory
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > createOneInstanceRegistryFactory(
| const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & |
rServiceManager, |
| const ::rtl::OUString & |
rComponentName, |
| const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > & |
rImplementationKey ) throw(); |
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
NO |
NO |
- D E P R E C A T E D
- Summary
Deprecated. Creates a single service factory which holds the instance created only once
based on a registry.
- Parameters
| rServiceManager |
the service manager used by the implementation.
|
| rImplementationName |
the implementation name. An empty string is possible.
|
| rImplementationKey |
the registry key of the implementation section.
|
- Return
a factory that support the interfaces XServiceProvider, XServiceInfo
XSingleServiceFactory and XComponent.
- See Also
- createSingleRegistryFactory
- createSingleComponentFactory
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleComponentFactory > createSingleComponentFactory(
| ComponentFactoryFunc |
fptr, |
| const ::rtl::OUString & |
rImplementationName, |
| const ::com::sun::star::uno::Sequence< ::rtl::OUString > & |
rServiceNames, |
| rtl_ModuleCount * |
pModCount = 0 ) throw(); |
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
NO |
NO |
- Summary
Creates a single component factory supporting the XSingleComponentFactory interface.
- Parameters
| fptr |
function pointer for instanciating the object
|
| rImplementationName |
implementation name of service
|
| rServiceNames |
supported services
|
| pModCount |
for future extension (library unloading concept).
|
- createSingleFactory
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > createSingleFactory(
| const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & |
rServiceManager, |
| const ::rtl::OUString & |
rImplementationName, |
| ComponentInstantiation |
pCreateFunction, |
| const ::com::sun::star::uno::Sequence< ::rtl::OUString > & |
rServiceNames, |
| rtl_ModuleCount * |
pModCount = 0 ) throw(); |
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
NO |
NO |
- D E P R E C A T E D
- Summary
Deprecated. Creates a single service factory.
- Parameters
| rServiceManager |
the service manager used by the implementation.
|
| rImplementationName |
the implementation name. An empty string is possible.
|
| ComponentInstantiation |
the function pointer to create an object.
|
| rServiceNames |
the service supported by the implementation.
|
| pModCount |
for future extension (library unloading concept).
|
- Return
a factory that support the interfaces XServiceProvider, XServiceInfo
XSingleServiceFactory and XComponent.
- See Also
- createOneInstanceFactory
- createSingleRegistryFactory
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > createSingleRegistryFactory(
| const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & |
rServiceManager, |
| const ::rtl::OUString & |
rImplementationName, |
| const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > & |
rImplementationKey ) throw(); |
| virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
| NO |
NO |
NO |
NO |
NO |
NO |
NO |
NO |
- D E P R E C A T E D
- Summary
Deprecated. Creates a single service factory based on a registry.
- Parameters
| rServiceManager |
the service manager used by the implementation.
|
| rImplementationName |
the implementation name. An empty string is possible.
|
| rImplementationKey |
the registry key of the implementation section.
|
- Return
a factory that support the interfaces XServiceProvider, XServiceInfo
XSingleServiceFactory and XComponent.
Top of Page
Copyright © 2012, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


Mutation and selection in B cells
Erick Matsen
Thanks to Sarah Cobey for some of the slides
Structure of a B cell receptor
VDJ recombination
VDJ loci
Somatic hypermutation is AID + repair
The mutations have peculiar biases
The mutations have peculiar biases
Phylogenetics is not straightforward
Incorporating context sensitivity helps performance
What about natural selection?
Remember goal: get per-site selection inferences,
- \(\omega > 1\) indicates positive selection (“invites change”)
- \(\omega < 1\) indicates negative selection (“does not tolerate change”)
Natural selection inferences are also not straightforward
Natural selection inferences are also not straightforward
Natural selection inferences are also not straightforward
Context-sensitive mutation can confound
natural selection inference for B cells.
Correct for mutation rate variation
- \(\lambda_l^{(N-I)}\): nonsynonymous in-frame rate for site \(l\)
- \(\lambda_l^{(N-N)}\): nonsynonymous neutral rate for site \(l\)
- \(\lambda_l^{(S-I)}\): synonymous in-frame rate for site \(l\)
- \(\lambda_l^{(S-N)}\): synonymous neutral rate for site \(l\)
\[
\omega_l = \frac{\lambda_l^{(N-I)} / \lambda_l^{(N-N)}}{\lambda_l^{(S-I)} / \lambda_l^{(S-N)}}
\]
How do we get neutral per-site substitution rate?
Productive vs. out-of-frame receptors
Out-of-frame reads can be used to infer neutral mutation rate.
One can also use passenger alleles
- Yeap, Hwang, Du, Meyers, …, Alt, F. W. Cell, 2015
- Cui, Di Niro, Vander Heiden, Briggs, … , Kleinstein J Immunol, 2016.
and fit a mutation model.
One would like to quantify these biases
Classic work by Kleinstein group
- Yaari, Vander Heiden, Uduman, Gadala-Maria, Gupta, Stern, Kleinstein, Front Immunol, 2013.
- Cui, Di Niro, Vander Heiden, Briggs, … , Kleinstein J Immunol, 2016.
Have extended this framework
We can add overlapping motifs.
Now the \(\theta\) entry for a 5-mer answers the question:
what is this 5-mer telling me that the inner 3-mer did not?
These get automatically zeroed out if not informative.
Feng, Shaw, Minin, Simon, & M, arXiv, in revision for Ann. Applied Stat.
Inferring natural selection
- BASELINe infers overall selection: Yaari, Uduman, Kleinstein Nucleic Acids Research, 2012 [DOI]
- Infer whole-repertoire per-base selection: McCoy, Bedford, M Phil. Trans. Royal Soc. London, 2015 [DOI]
- IgPhyML infers selection in a phylogenetic context: Hoehn, Lunter, & Pybus Genetics, 2017. [DOI]
Motivation
Goal:
Accurate tree inference using not-very-diverged sequences
which are sampled with meaningful counts
A simple infinite-type branching process model
- \(p\): probability of division
- \(q\): probability of mutation
“GCTree” likelihood
Incorporating model likelihood
- Given sequence data, construct maximum parsimony trees
(there are lots, typically)
- Pick the tree with the highest model likelihood
Validation:
- Simulate tree using a more complex model (arbitrary offspring distribution, finite sampling time, incomplete sampling)
- Simulate sequences down tree (context-sensitive mutation)
- Run inference; compare to simulation
GCtree works in simulation
GCtree finds more common IgH and IgL trees


I found myself nodding along with each feature introduced. Tuples: check. Named Parameters: check. Default Parameters: check. Protocols: check. Functions: check.
I realized it wasn’t just because Swift has unsurprising features, but because I’m familiar enough with enough other languages
that I’ve experienced or used those features before. Although I write mainly in Ruby and JavaScript at work, I have a lot of
experience with Java and C, and had my head was in Scala for quite a while a few years ago.
Although the forms of Swift’s various features differ from their analogs in other languages, conceptually, they are the same: the
generic type system is similar to Java’s, and the tuples are close enough to Scala’s that all I need to do is understand the
syntax.
If all you know are dynamic languages like Ruby or JavaScript1, or you are only familiar with Java or C#, you are increasingly at
a disadvantage when trying to acquire new skills. Learning something like Swift (or Scala, or Elixir, or whatever) requires not
just understanding the syntax of the language, but the very concepts that underpin its features (some of which can be mind-bending).
Particularly JavaScript. It has probably the least features of any modern programming language. If you’ve never experienced a truly powerful and expressive language, you will be more and more behind as the industry moves on. JavaScript won’t go away, but it’s becoming assembly language. You don’t want to be an assembly programmer. ↩
To the surprise of just about everyone, Apple announced a new programming language, Swift, at WWDC this Monday.
This is a rare event for us programmers, as we don’t often get to see what the biggest technology company on the planet (who
owns one of the biggest platforms on the planet) thinks about programming language design.
Swift embodies two major themes in programming language design that have come to the forefront in the last several years:
functions as first-class values (a given, these days), and, more surprisingly, static typing.
While Rails doesn’t prevent you from creating a well-architected application, it certainly doesn’t
give you everything you need. This is not so bad if your application is incredibly simple, but for anything of moderate
complexity (and I would argue that any app someone is paying you to produce is going to be moderately complex), Rails leaves a
lot of architectural decisions to you.
By yours truly, on the GrowingDevs blog, giving you some more reasons and help on using Bower instead of RubyGems
for managing your front-end assets in Rails:
Rails 4.0.4 depends on version 2.2.x of the jquery-rails gem which in turn bundles 1.9.1 of JQuery. Does that make any sense? The latest official release of angular-ui-bootstrap-rails is 0.9.0, which is at least a version behind the current release of the Angular UI bootstrap directives. When will it be updated? chosen-rails version 1.1.0 bundles an old version of chosen-jquery that has never been officially released. What?
The state of front-end assets in RubyGems is almost comical. Please start using Bower.
I’ve been doing a bit of AngularJS at work, and getting it all working with Rails, the asset pipeline, testing, and deployment was quite a
challenge. It wasn’t so much difficult to do, but difficult to uncover the right information. So, I decided to compile it all in a nice tutorial and post it as a free mini-ebook, in web form, also known as a website1.
Rails isn’t the only part of your application where design decisions are made. The developers of Rails aren’t the only developers whose past experience can be used to make design decisions. You have experience, too. And it’s that experience that must drive your design process.
Had a discussion with another developer at a meetup about testing Rails controllers. I test controllers a lot. In fact, I start most new features with a controller test. I also use ivars as the means of passing data from controller to view. Ex-colleague Adam Keys recently wrote a good piece about not using ivars:
If you stick with ivars long enough, you’re going to end up with two kinds of misadventures.
Most commonly, you’ll wonder why @user is nil for some view or edge case…
This leads to the second misadventure: where did this @user thing come from2?
He then goes onto propose creating methods, since it makes testing and experimentation easier.
Personally, I would find this far more confusing. Ruby’s tagline could be “where did that come from?”. You can’t write Ruby
without grepping. A lot. And the string “@user” is going to be a lot easier to grep for than “current_user”.
Finding “@user =” moreso.
But this is all beside the point. Fighting controllers and avoiding ivars unnecessarily adds complexity to Rails to solve a problem that is created not by Rails but by bad programming practices. Hiding those practices behind methods, helpers, and objects is just that - hiding. If want to avoid sloppy controllers and views, don’t fight Rails, instead do this:
Adjust your mindset about what Controllers are.
Adhere to three simple practices when writing controllers and views.
What Rails Controllers Really Are
Stop thinking of controllers as regular objects/classes in the traditional Ruby sense. The way they are written, tested, and
used gives no indication that they are conventional. Instead, think of controllers as
namespaces for functions, each having a single input—params—whose purpose is to render a view given some data:
As Rails is a DSL for making web applications, it uses the “specialness” of a controller to abstract away boilerplate so that all
we need to write is what’s specific to our application.
First, there’s no need to have params passed in explicitly:
Finally, we can condense the passing of values to mere assignment:
123
defshow@user=User.find(params[:id])end
1
<EMAIL_ADDRESS>This description of what controllers really are is borne out in a canonical controller test:
12345678
# Setup our test datauser=User.create!(name:'Dave')# call our function, giving it a value for `params`get:show,id:user.id# assert something about the assigned valuesassert_equaluser,assigns(:user)
If you are comfortable using let to assign values in RSpec, you should be totally OK with this.
Because a controller isn’t a conventional object or class, but is instead a namespace for functions, it has no need of ivars.
Knowing this, Rails co-opts the ivar mechanism to make our lives easier and our code easier to read and write.
That you can declare an ivar anywhere in a controller and that doing so causes
confusion is your problelm, not Rails. Avoiding ivars in favor of a custom mechanism seems more difficult in the long run than
just making a commitment to just three simple practices.
Three Practices to Keep Your Controllers and Views Clean
When you take care with your views and controllers, the Rails Way results in code that is easy to read and modify.
Assign ivars only in controller actions or, if you must, filters.
Since your controller methods should be short, as should your filters, you can easily see all ivars assigned by a controller in one screenful of text. Yes, you can assign ivars anywhere you want. Don’t do that. You wouldn’t do that in any other class in your system, so why does the ability to do it in controllers necessitate a deviation from Rails idioms?
Assign as few ivars as possible.
Ideally, you have a single type describing the contract between controller action and
view and that value is always expected to have a value. If that “type” isn’t a database-backed ActiveRecord model, you know what: spend 60 seconds making a class. If it takes you longer to create a model describing what your view expects, sharpen your tools.
But, there’s a reason I didn’t say “Assign one ivar”. Sometimes you need orthogonal data, such as reference data for select
boxes, and assigning it in the controller as a second ivar can end up being much simpler that either putting it into your
model object or as a helper.
Do not use ivars in partials.
This is usually the source of a lot of confusion and problems in Rails views. It’s not the fault of Rails, but it’s another bad
programming practice. Using ivars in partials is akin to this Ruby code:
Treat calls to render partial: as a method call and pass in arguments that that partial needs to work. Design that partial to
require (and document) what should be passed in. Inside a view, think of ivars as global data. We don’t use global data to pass
arguments to methods.
It may seem braindead to write render partial:'form', locals: { user: @user }, but you will thank yourself later
for spending 5 seconds being explicit. The partial can now be moved around and re-used easily, because its contract is explicit.
Don’t Fear ivars - Fear Bad Coding Practices
These rules are incredibly simple to follow, and make your code easy to write, read, and maintain. Your controller tests are
easy to write, and your partials can be easily extracted if needed.
You see time and time again that Rails conventions are designed around making readable and maintainable code in the context of
good programming practices. Rails was never intended to make it hard to write bad code, but to make us productive. If we are
comfortable making a mess and ignoring years of lessons learned about programming, Rails isn’t going to help us.
The ability to quickly create and deploy an application is crucial to avoiding a monolithic architecture…Rails provides a handy feature called application templates that allows you to script the creation of a new applications with whatever boilerplate you need.
I posted another blog entry at the Stitch Fix tech blog, this one on using simple structs instead of delegation for adapting your
data for web views:
This is another way of saying that we get better, simpler code, without almost the same effort, if we just create a basic class instead of using delegation.


Your goto place whether you are just starting or an expert on all things OCN
Overcast Network is a Minecraft PvP server started in December by MonsieurApple and Anxuiz. The server runs on the Bukkit API and is powered by many custom plugins, mainly PGM. Overcast also has a website where you can check your stats, socialize with your friends on the forums or just check the revisions for the latest changes to plugins or the website. You can also go to this blog to keep up with the latest news about Overcast Network


What's parsemylegacy
?
parsemylegacy
is a simple java 8 parser for positional files.
Examples
Flat file:
WALTER WHITE
JESSE PINKMAN
SAUL GOODMAN
Pojo:
@Line
public class Person {
@Column(from = 1, to = 30)
public String firstname;
@Column(from = 31, to = 60)
public String lastname;
}
Parse example:
InputStream input = ParserTest.class.getResourceAsStream("/people.txt");
List<Person> people = parser().from(input).parse(Person.class);
Authors and Contributors
You can @mention a GitHub username to generate a link to their profile. The resulting <a>
element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.
Support or Contact
Having trouble with Pages? Check out the documentation at http://help.github.com/pages or contact<EMAIL_ADDRESS>and we’ll help you sort it out.


Trader Sonia:
I can only make essence after you find
forty Mandragora Roots
.
If you bring
40 White Mandragora Roots
instead of red, I can make a clear essence that is richer and stronger in taste.


--- layout: page title: Podcast Player w/ Transcript description: Testing some things. background: '' ---


Class AbstractActivateProduction
java.lang.Object
it.polimi.ingsw.client.clientstates.AbstractClientState
it.polimi.ingsw.client.clientstates.AbstractActivateProduction
- Direct Known Subclasses:
ActivateProductionCLI
,ActivateProductionGUI
public abstract class AbstractActivateProduction extends AbstractClientState
This abstract class deals with main action of the game consisting in activate productions and provides some
methods to make consistency checks.
-
Field Summary
Fields Modifier and Type Field Description protected ActivateProductionMessage
messageToSend
The message to send to the server containing how to perform the action.protected ActiveProductions
requiredProduction
The mask representing which of the available productions the client wants to active.Fields inherited from class it.polimi.ingsw.client.clientstates.AbstractClientState
client
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractActivateProduction(Client client)
-
Method Summary
Modifier and Type Method Description boolean
areValidRequestedProductions()
Utility method used to check whether the required productions are valid.java.util.Map<ResourceType,java.lang.Integer>
calculateInputResources()
Computes the overall resources needed in input in order to activate the required productions.boolean
canActivateSlot(int index)
Checks whether the slot on the given index isn't empty.boolean
checkRequiredResources()
Checks whether the player has enough resources to activate the requested productions.void
clearBasicChoices()
Resets the basic production inputs and output chosen.ResourceType
getExtraProductionType(int leaderCardIndex)
Gets theResourceType
associated with the extra production leader card on the given index.boolean
isBasicProduction()
boolean
isBasicSettingDone()
Utility method used to check whether the player has set basic production inputs and output.java.util.List<LeaderEffect>
listExtraProductionEffect()
Utility method used to retrieve all the active extra production effects for the player.private java.util.Map<ResourceType,java.lang.Integer>
retrieveCardInputResources(ReducedPersonalBoard playerBoard, int slotIndex)
Utility method used to retrieve the input resources needed to activate the card on top of the given slot.private ResourceType
retrieveInputExtra(ReducedPersonalBoard playerBoard, int extraSlot)
Utility method called when the player has requested the extra production on the given index, to find which ResourceType has to be taken in input.void
setBasicSlot()
Method used to setup the message to send with the basic production when the player requested it.void
setExtra(int extraIndex)
Method used to setup the message to send with the requested extra productions.void
setInput(int basicInputIndex, ResourceType resource)
Method used to setup the message to send with the input of the basic production chosen by the player.void
setOutput(java.lang.String outputType, int outputIndex, ResourceType resource)
Method used to setup the message to send with the output of the productions chosen by the player.void
setPaymentInstructions(java.util.Map<ResourceSource,java.util.EnumMap<ResourceType,java.lang.Integer>> requiredResources)
Method used to setup the message to send to the server with the instructions on how to take resources needed to activate the requested productions.void
setSlot(int index, boolean status)
Method used to setup the message to send with the requested productions.Methods inherited from class it.polimi.ingsw.client.clientstates.AbstractClientState
manageUserInteraction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
messageToSend
The message to send to the server containing how to perform the action. -
requiredProduction
The mask representing which of the available productions the client wants to active.
-
-
Constructor Details
-
AbstractActivateProduction
-
-
Method Details
-
areValidRequestedProductions
public boolean areValidRequestedProductions()Utility method used to check whether the required productions are valid.- Returns:
- the check validity.
-
canActivateSlot
public boolean canActivateSlot(int index)Checks whether the slot on the given index isn't empty.- Parameters:
index
- the index of the slot to check.- Returns:
- the check validity.
-
listExtraProductionEffect
Utility method used to retrieve all the active extra production effects for the player.- Returns:
- the list of active extra production effects.
-
getExtraProductionType
Gets theResourceType
associated with the extra production leader card on the given index.- Parameters:
leaderCardIndex
- the index of the leader card to retrieve.- Returns:
- the resource type associated with the card.
-
calculateInputResources
Computes the overall resources needed in input in order to activate the required productions.- Returns:
- the overall resources needed in input.
-
retrieveCardInputResources
private java.util.Map<ResourceType,java.lang.Integer> retrieveCardInputResources(ReducedPersonalBoard playerBoard, int slotIndex)Utility method used to retrieve the input resources needed to activate the card on top of the given slot.- Parameters:
playerBoard
- the player's board instance.slotIndex
- the index of the slot where the development card to active is located.- Returns:
- the input resources computed.
-
retrieveInputExtra
Utility method called when the player has requested the extra production on the given index, to find which ResourceType has to be taken in input.- Parameters:
playerBoard
- the player's board instance.extraSlot
- the index of the extra production to activate.- Returns:
- the input
ResourceType
needed to activate the selected production.
-
checkRequiredResources
public boolean checkRequiredResources()Checks whether the player has enough resources to activate the requested productions.- Returns:
- the check validity.
-
setSlot
public void setSlot(int index, boolean status)Method used to setup the message to send with the requested productions.- Parameters:
index
- the index of the slot to set.status
- whether the client wants to activate the card on top of the specified index.
-
setExtra
public void setExtra(int extraIndex)Method used to setup the message to send with the requested extra productions.- Parameters:
extraIndex
- the index of the extra production to set.
-
setBasicSlot
public void setBasicSlot()Method used to setup the message to send with the basic production when the player requested it. -
setInput
Method used to setup the message to send with the input of the basic production chosen by the player.- Parameters:
basicInputIndex
- the index of the input of the basic production associated with the given resource.resource
- the resource the player wants as input.
-
setOutput
Method used to setup the message to send with the output of the productions chosen by the player.- Parameters:
outputType
- the type of production whose output has to be set.outputIndex
- the index of the output to be set.resource
- theResourceType
to set as output.
-
isBasicSettingDone
public boolean isBasicSettingDone()Utility method used to check whether the player has set basic production inputs and output.- Returns:
- the check validity.
-
clearBasicChoices
public void clearBasicChoices()Resets the basic production inputs and output chosen. -
isBasicProduction
public boolean isBasicProduction()- Returns:
- whether the player has required basic production.
-
setPaymentInstructions
public void setPaymentInstructions(java.util.Map<ResourceSource,java.util.EnumMap<ResourceType,java.lang.Integer>> requiredResources)Method used to setup the message to send to the server with the instructions on how to take resources needed to activate the requested productions.- Parameters:
requiredResources
- the instructions on how to take resources.
-