Recently I learned about the existence of what is known as Google
Foobar also known as “Google secret recruiting
program” or “How much bunnies can you rescue before wanting to kill someone” and
being the stubborn me that I am, I decided to force my way in and try the
challenges!
…
I didn’t expected to be able to get in but it seems I did, so I guess I’m
indebted to do a writeup or something? Oh well, I won’t cry over easy and
interesting content for my blog.
So as you can see, Foobar is basically a website which contains a unix-like
shell, based on “jQuery Terminal”, which does have some standard unix commands,
including some which aren’t listed in the help
command, namely mount
or
cat
.
When you can finally access foobar they’re prompting you to use the help command
to see the standard set of commands one would use, and to use the command
request
whenever you’re ready, sending a POST request to
https://foobar.withgoogle.com/api/v1/commands/request/
and adding a folder
into your home directory(https://foobar.withgoogle.com/api/v1/files/
).
This folder always contains 4 files: solution.py
,
solution.java
, constraints.txt
and readme.txt
which you can read using the
less command(listed in help) or cat(not listed but super handy to copy stuff,
since i never got less to honour linefeeds for some reason).
The solution files are supposed to contain, well, your solutions, constraints
tells you the stuff like “python 2.7 only basic libs” and readme the problem.
You always have to write a function answer
which answers (how surprising) the
problem, either in java or in python. Foobar tests those by using a test VM
which, in the case of python, is isolated by nsjail and interacts with the file
descriptor 3 outside of the VM since it virtually have no other access to
outside data, but more onto that much later. They test it to up to 10 test
cases(can be as low as 5 though, ie the combinatorics problem I’m talking about
below, and you can then submit your problem to be able to request a new one et
cetera. A little thing to note is that, however, all those challenges are
timed(the first being 2days and the last being 22 iirc) and that once you
submitted a challenge it is removed from your home folder. For this reason
I’d like to thank very much the creator of UNIX to have put timestamps in files,
so that I know which challenges I did in which order, all hail ls -latr
!
Foobar is also organized per “levels”, which contains a different number of
challenges each time, my session had 1 for level 2, 2 for level 2, 3 for level
3, four 2 for level 4 and 1 for level 5, all of which are organized in a
chronological order below.
But all this talk is boring for those interested in actual problems so I’ll zap
over the intelligence I gathered and begin on the actual challenges!
Solar Doomsday
Before talking about the challenges directly I’d like to note that my codestyle habits evolved when doing those challenges because of a. one reason I’ll explain at the bottom and b. I went to “aww those challenges are easy” to “how was I even supposed to think about this??", but enough with my rants, let’s get it on with the first challenge.
This problem is pretty easy(and hopefully, knowing it is the first one): they ask you to decompose a number in squares and only put the largest squares you can in it. Solving it is pretty simple too: you get the biggest square that doesn’t overflow your number, you remove the square from the number, repeat, nothing really hard there.
def get_biggest_square(max_number):
n=1
while(n*n < max_number+1):
n=n+1
return n-1
def answer(area):
if(area > 1000000 or area < 1):
raise ValueError('Area is outside of bounds')
array=[]
while(area != 0):
res=get_biggest_square(area)
array.append(res*res)
area-=res*res
return array
Oh yeah, last thing before we move on: Those versions are uncommented versions of the algorithms because this article is way too large already, I’ll add a git repository at the end which keeps them as is to when I submitted them. Also sorry for making you miss the fun of the original questions but not only did I not saved them but this article would be huge if I had to embded them into it, so if one problem interests you, look it up!
Ion Flux Relabelling
This one is pretty annoying to explain without technical talks about trees so here, take this from the original probmlem question I looked up online because I saved none of them!
7
3 6
1 2 4 5
Write a function answer(h, q) - where h is the height of the perfect tree of
converters and q is a list of positive integers representing different flux
converters - which returns a list of integers p where each element in p is the
label of the converter that sits on top of the respective converter in q, or -1
if there is no such converter. For example, answer(3, [1, 4, 7]) would return
the converters above the converters at indexes 1, 4, and 7 in a perfect binary
tree of height 3, which is [3, 6, -1].
Now that the problem make(at least some) sense I can say that this problem wasn’t much harder than the last one but used some basics of CS theory, trees in that case, but could totally be solved without its knowledge. In this case we get the biggest element that can find a top(ie top-1) and if our number is between this and 0 it will have a number above it. We then do a recursive check; if the item is equal or inferior to the top of the left node then it is in the left node, otherwise proceed with the right with the same logic until we find the number as either the left node or right node, making it on top of those.
def find_item(item,cur,dif):
right_node=cur-1
left_node=right_node-dif//2
if(right_node==item or left_node==item):
return cur
else:
if(item<=left_node):
return find_item(item,left_node,dif//2)
else:
return find_item(item,right_node,dif//2)
def answer(h, q):
if(h > 30 or h < 1):
raise ValueError('Height is outside of bounds')
if(len(q) > 10000 or len(q) < 1):
raise ValueError('Flux converters list is outside of bounds')
items=(2**h)-1
array=[]
for i in range(len(q)):
if (q[i]<items and q[i]>0):
array.append(find_item(q[i],items,items-1))
else:
array.append(-1)
return array
En Route Salute
I’d say this one was easier than the last one when you figured out how to do it, as it required no real formal knowledge, but problems at this point are still pretty easy anyways so classifying them by difficulty makes little sense. In this case we were given a string containing <, > or - and we had to know the number of arrows that crossed, knowing that they all move one step at a time. To figure this out you just had to save the position of each arrow and figure out their distance: if a right arrow was on the left of a left arrow then they’ll obviously cross.
def answer(s):
if(len(s) > 100 or len(s) < 1):
raise ValueError('Height is outside of bounds')
s = list(s.replace("-",""))
left = []
right = []
res=0
for i in range(0,len(s)):
if s[i] == '<':
left.append(i)
if s[i] == '>':
right.append(i)
for i in right:
for y in left:
if i < y:
res+=1
for i in left:
for y in right:
if y < i:
res+=1
return res
Fuel Injection Perfection
And the easy part stops here, this is where Foobar becomes really tricky and
focus on what it likes most: tricky math questions! Unfortunately it seems more
than a few share of people got this challenge and I ended up having the solution
almost handed out to me when looking at stackoverflow(when someone tells you
they’re working on a “challenge” and the reduced test case looks about the same
there isn’t much doubt about it…). For some context you can do fairly easily
the \(n^2\) way but the time limit is not really helping our case there.
I also removed my asserts from this point forward for a reason I’ll explain at
the bottom of this article.
It was still quite fun to understand though!
The problem is that given a number, and given 3 operations: add, remove, or
divide per 2 only if the number is even, you have to find the quickest way to
reduce this number to 1.
If you can divide per 2, the answer is obvious: you do because that’s the
fastest way to cut down the number, but then the finicky part is: should you add or remove to the
number to get to the result ASAP? Ie you can do 3->4->2->1 or you can do
3->4->1, and the time limit doesn’t allow us to try both for each given number.
The answer to that happens to lie in binary: we calculate how to get the maximum
of 000 in the rightmost bits, which in turn make us prefer to add when we are in
a situation where we have 111, making us push to 000 and making the division per
2 easier.
Kind of a letdown to get spoiled but eh, we’re getting in the territory of the
“if you don’t know that you’re screwed”.
def answer(n):
n=int(n)
res = 0
while(n!=1):
if(n%2==0):
n=n/2
elif((n==3) or ((n+1)&n) > ((n-1)&(n-2))):
n-=1
else:
n+=1
res+=1
return res
Queue To Do
Remember the problem before that one? Look up “XOR Reduction” and you have the same result for this one! This problem was about XORing reduction, as you could do it easily without the time/memory limit. See the cube of numbers below?
0 1 2 /
3 4 / 5
6 / 7 8
Great, so this is a cube starting by 0, length of 3, the / are included to help with the problem. The point is to XOR all the numbers on the left side of the slash aka 0^1^2^3^4^6. The basic idea is to just xor everything in a loop and reduce by one each time the numbers to XOR, but for huge cubes this can take a long time and thus we had to figure out some XOR reduction for long lists like that. I tried my best to figure it out by myself but then again you can find plenty of XOR reduction resources on the net, so believe me as you wish I guess. For the theory basically XOR repeats itself when XORing lists of following numbers(the thing we’re trying to reduce), so we can reduce a ton of XOR operations into an \(O(1)\) one, helping a lot, given a rotation noted below, differing for even and odd numbers.
def xor(a, b):
if(a%2==0):
xor_rotation = [b, 1, b+1, 0]
else:
xor_rotation= [a, a^b, a-1, (a-1)^b]
return xor_rotation[(b-a)%4]
def answer(start, length):
res=0
for i in range(0, length):
res ^= xor(start+(length*i), start+(length*i)+(length-i)-1)
return res
Find the access code
Look up “lucky triples” on stackoverflow, first result. I’m not even kidding. With that even the people trying to figure it out themselves would cheat without wanting to, aaaaaaaaaargh. Either way the goal was to find lucky triples in a list, basically one number that divides another in a small-to-big order. Solving that even without looking it up is trivial though, you see if two numbers divide themselves, then you see if this other number divides another and boom you solved it.
def answer(l):
triples = 0
pairs = [0]*len(l)
for i in range(1, len(l)-1):
for j in range(i):
if(l[i]%l[j]==0):
pairs[i]+=1
for i in range(2, len(l)):
for j in range(1, i):
if(l[i]%l[j]==0):
triples += pairs[j]
return triples
Distract the Guards
Ok so take back all I said about level 3 challenges and the copypasta fest it was, we are entering level 4, where challenges finally get interesting. I mean guard betting bananas on thumb wrestling kind of way, but still! Well then the problem is that we have a list of bananas, and we know guards pairing up in banana fights
- always bets the amount of the guy who have less bananas
- the guy who have less bananas always win.
There is a catch though, when both gets an equal number of bananas they stop
thumb wrestling. And we don’t want that. Because we want them to keep being busy
or something, guess their peripheral vision isn’t quite as developped as animals
yet.
Anyways the first part of the problem is about combinatorics maths: knowing when
the guard loops:
Let \(k\) be the largest positive integer such that \(a > (2^k - 1)b\).
If \(a = b(2^k - 2^{m-1} - 1)\) or \(a = b(2^{k+1} - 2^m - 1)\) then we are in
an infinite loop. We can deduce from that that if \(a+b\) is a power of two,
for \(a+b\) being divided by their common divisor, then we are in a loop.
The second part is quite easy actually: you want to pair up the maximal amount
in an infinite loop, so you find the infinite loops, pair the
lowest-numbers-of-infinite-loop guard to the next-lowest-numbers-of-infinite-loop
and you can find the maximum amount that can be paired!
While the problem looks quite easy explained like that(I mean excepted the
maths) I still began to switch to pen and paper from that point forward, as it
was getting pretty theoric.
from fractions import gcd
def loops(x, y):
res = (x+y)/gcd(x,y)
return bool(res & (res - 1))
def remove(guards, ref):
for i in range(len(guards)):
j = 0
while j < len(guards[i]):
if(guards[i][j]==ref):
guards[i].pop(j)
j+=1
guards[ref]=[-1]
def answer(banana_list):
guards= [[] for i in range(len(banana_list))]
bad=0
for i in range(len(guards)):
for j in range(len(guards)):
if(loops(banana_list[i], banana_list[j])):
guards[i].append(j)
to_process=len(banana_list)
while(to_process>0):
min_num=0
for i in range(len(guards)):
if(i!=0 and (len(guards[i])<len(guards[min_num]) or guards[min_num]
== [-1]) and guards[i]!=[-1]):
min_num=i
if((len(guards[min_num])) == 0 or (len(guards[min_num])==1 and
guards[min_num][0] == guards[min_num]) and guards[min_num] !=
[-1]):
remove(guards, min_num)
to_process-=1
bad+=1
else:
min_node=guards[min_num][0]
for i in range(len(guards[min_num])):
if(i!=0 and guards[min_num][i]!=min_num and len(guards[guards[min_num][i]])<len(guards[min_node])):
min_node=guards[min_num][i]
if(guards[min_node]!=[-1]):
remove(guards, min_num)
remove(guards, min_node)
to_process-=2
return bad
Bringing a Gun to a Guard Fight
THIS ONE WAS WILD. SERIOUSLY. It have to be the one problem a raytracing engineer faced one day in his life and never forgot. Gosh it took me so much time to figure this one out, easily the hardest for me in this whole set of challenges. Basically you are in a room of given dimension and can shoot a laser beam that reflects on walls and you need to figure out exactly in which directions you can shoot so that it gets to your ennemy, given a max distance and your position. For that one problem I made a huge essay on how it works in the comments which I’m going to post below:
The first thing you had to realize in order to solve this challenge is that you
could simply mirror the room and check if the beam gets where you want. Let me
show you:
In our case let us make a room of dimension [3,2], with the position of the
target at [1,2]. For the sake of simplicity let us imagine the beam is shot at
[1,2] and so we are trying to shot ourselves. We get something like this:
-----
|*xx|
|xxx|
-----
If we shoot with a vector of [1,0], aka straight ahead, we will get this result:
-----
|*~~|
|xxx|
-----
We can see that the beam gets back to you directly, thanks to the reflection,
and that the goal is achieved! But there is another way to do that:
----- -----
|*~~| |~~*|
|xxx| |xxx|
----- -----
We can here realize that, by putting a mirror version of the room where the beam
gets, we can make a straight line instead of calculating the reflection and see
that it gets to our original target, [1,2], being ourselves!
The good thing with that is that it also allows us to determine the distance
needed by the beam to get through, and thus we can mirror the rooms up to the
maximum distance easily.
The next thing to realize was that room mirrors in a pattern, see the below
diagram:
-----
|*xx|
|xxx|
-----
[...] ----- [...]
|xxx|
|*xx|
-----
----- ----- ----- ----- -----
|*xx| |xx*| |*xx| |xx*| |*xx|
|xxx| |xxx| |xxx| |xxx| |xxx|
----- ----- ----- ----- -----
-----
|xxx|
|*xx|
-----
[...] ----- [...]
|*xx|
|xxx|
-----
x always repeats in the same way, and so does y
Thus we need to figure out how to calculate how to mirror one room twice and we
can make an entire atlas of mirrored rooms!
In our case though the function below only calculates the mirrors of the point
of coordinates node across an atlas of length (distance*2)^2
Sooo the hard part about this was figuring out about the mirroring of the room. I was talking with a friend and when I told him about a specific thing that the problem stated on the rooms, that if you shoot in the corner it reflects perfectly we both had an Eureka moment: “Wait, isn’t the room reflection symmetric to itself?” and then I looked up some 2D plane mirroring(which leaded to a ton of maths I didn’t need actually and so I had to figure out a 1D transform on my own) and then just verify the angles and ensure the distance of the guard is before yourself.
def mirror_atlas(node, dimensions, distance):
node_mirrored=[]
for i in range(len(node)):
points=[]
for j in range(-(distance//dimensions[i])-1, (distance//dimensions[i]+2)):
points.append(get_mirror(j, node[i], dimensions[i]))
node_mirrored.append(points)
return node_mirrored
def get_mirror(mirror, coordinates, dimensions):
res=coordinates
mirror_rotation=[2*coordinates, 2*(dimensions-coordinates)]
if(mirror<0):
for i in range(mirror, 0):
res-=mirror_rotation[(i+1)%2]
else:
for i in range(mirror, 0, -1):
res+=mirror_rotation[i%2]
return res
def answer(dimensions, your_position, guard_position, distance):
mirrored = [mirror_atlas(your_position, dimensions,
distance),mirror_atlas(guard_position, dimensions, distance)]
res=set()
angles_dist={}
for i in range(0, len(mirrored)):
for j in mirrored[i][0]:
for k in mirrored[i][1]:
beam=atan2((your_position[1]-k), (your_position[0]-j))
l=sqrt((your_position[0]-j)**2 + (your_position[1]-k)**2)
if [j,k] != your_position and distance >= l:
if((beam in angles_dist and angles_dist[beam] > l) or beam not in angles_dist):
if i == 0:
angles_dist[beam] = l
else:
angles_dist[beam] = l
res.add(beam)
return len(res)
Expanding Nebula
Clearly the second hardest problem of this set, right after the banana thumb
wrestling one.
You were given a 2D grid(matrix) of booleans and needed to figure out the number of
possible permutations before it, knowing that a boolean is true if it had only
one true neighbor(including itself, right, bottom and bottom right) and false otherwise.
Since some cells cannot be calculated the grid loses one dimension in both axis
at each step.
The hard part of this is akin to the XOR Reduction problem, again: how the hell
do we not go over the time limit?? For this we just setup an index for each cell
of coordinates a,b given the last row + current move history to figure out if we
already had a similar situation to avoid recursion, not really complicated but
way harder to figure out than it looks(thanks Internet for that one).
def answer(state, a=0, b=0, past=0, solutions=0, history=0):
if(past==0):
past=[[True] * (len(state[0])+1) for i in range(len(state)+1)]
solutions = {}
history = []
if(b==len(state[0])+1):
return True
res=0
index=((a,b), tuple(history[-(len(state)+2):]))
if index in solutions:
return solutions[index]
for cell in [True, False]:
if (not a or not b) or len(set([((past[a][b-1] + past[a-1][b]
+ past[a-1][b-1] + cell)==1), state[a-1][b-1]]))==1:
history.append(cell)
past[a][b] = cell
res+=answer(state, a=(a+1)%(len(state)+1),
b=b+(a+1)//(len(state)+1), past=past,
solutions=solutions, history=history)
history.pop()
solutions[index]=res
return res
End and hack stuff
Here we are, we finished all the challenges, we can use recruitme
whenever to
spam employers with our wits, and we even have a nice cipher to end this game
on!
So I see the ending = sign, must be base64, also…wait… “HEYGA”. Oh no it
can’t be…
import base64
encrypted="HEYGAwIKCxQSUlZbSUkAExAXFU5CR0YWGQ0FCwYGABNGSVRHRhAFFQwLCgQRUU1JSQIHExkTHR1AQU9WRgAABBMQEggLAgJGWVZGCA0PCBAABAQLCRVSVltJSRIPGRkCAgsDRllWRhsPBQMcAhJOTl1BUgUADwtATVVRBwYBQEFPVkYeBwlAUgs="
my_eyes=str.encode("gauvain")
decoded=base64.b64decode(encrypted)
decrypted=""
for i in range(0,len(decoded)):
decrypted+=chr((my_eyes[i%len(my_eyes)] ^ decoded[i]))
print(decrypted)
➜ foobar python end.py
{'success' : 'great', 'colleague' : 'esteemed', 'efforts' : 'incredible', 'achievement' : 'unlocked', 'rabbits' : 'safe', 'foo' : 'win!'}
And thus Foobar concluded…or did it? Actually there’s a thing I haven’t told you and I spent most of my time on during Expanding nebula: remember when I told you I stopped using asserts at some points? Yeah no I’m not gaslighting you I actually wrote it between the lines of this incomprehensible tech mombo jumbo, well there was a simple reason for that:
When using asserts in Foobar in my answers questions, I right away saw that they removed the custom text you put there and only keep type and line of the exceptions, like this:
foobar:~/expanding_nebula gauvain$ verify solution.py
Verifying solution...
MemoryError [line 13]
But then later I misindented some of my foobar asserts, running in the global scope and I realized I somehow had the text printed this time…? At this point I decided to drop off the asserts and wait for the final challenge to have more time to understand if I could take advantage of that, and I did!
I had full read access to the VM. Time to dump everything!
It took me something like one hour of painfully editing stupid dumping scripts
just to dump one file because of the 1mb memory limit, also had a limit on how
much files were opened and time limit so I had to edit by hand my dumping
scripts but eventually…
➜ ~ file ~/Documents/PROJECTS/PROGRAMMING/SOFTWARES/foobar/hack/dump/export/pypy/bin/pypy
/home/arnab1saha/Documents/PROJECTS/PROGRAMMING/SOFTWARES/foobar/hack/dump/export/pypy/bin/pypy: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.26, BuildID[sha1]=a4cfb928b3d0a034b2b94b0c2b19b89ef75369cc, stripped
Woop, full dump! So now time to study foobar test VM: it contains 2 folders, /tmp and /pypy, with one file, /main.py, which executes our code. In a nutshell this one does read from the file descriptor 3 the source code, the function, try to locate if it exists and then execute it for each test case given by the file descriptor 3, writing each time the result to this mystery 3 again. From this point forward we have pretty much got code execution into Foobar but that is laaaame, the pypy binary is kinda old, 2016 to be exact, so let’s get some RCE, will we? To be honest though this was really unecessary as no real checks are in place to lock down our code, as the VM is ALREADY locked down: no network, time limited, read-only, not fun, and we could still interact with the file descriptor without getting an RCE to leak the test data. And that’s pretty much where I stand by now: the VM is locked down by nsjail through the intel I got, which while having a fairly small codebase(5k) it relies on concepts I am not super familiar with and core Linux namespaces, which seems pretty solid, so so far no dice for me, otherwise I’d have written a more clickbait article on “How I hacked google” and would be in a bunch of random hacking articles. I guess. Or I would’ve totally been forgotten and just have bragging rights nobody cares about, that works too. Either way I am dead set on getting a sandbox escape from nsjail one day, but I haven’t been able to do much so far, sorry to end on something so anti-climatic but hey, what did you expected? I’m still 19.
Conclusion
And we made it, gosh finally. I hope I haven’t skipped too much for your
understanding or that my regular writing style didn’t took too much of an hit
from that(don’t worry I’m still silly) but I had 9 challenges to talk about and
a hacking part…so I tried to condense a bit this article. Either way there
wasn’t a lot to talk about on how I figured out the problems, up to level 2(3
first challenges) it was basically “just code and think later”, level 3 was
“how good can you be at looking up stuff on the internet”, but level 4 and level
5 were more intricate. For example when first looking up the levl 4 stuff I had
written a test case of all the numbers that loops and tried to pair them in a
simple fashion in the best way possible, which ended up being lesser used node A
to lesser used node B.
So yeah, I had way too much things I wished to talk about but couldn’t, if you
wanted to know more about foobar aesthetics I guess you should look it up online
too, or just get this js and css and do a basic webpage from that ;)
The CSS
and the JS
They’re archived directly from the domain using the Web Archive, so it’s pretty
much guarenteed that I haven’t edited them myself.
As for foobar itself, was it the hardest challenge I ever faced? Hell no, have
you even seen the 34c3 CTF for example? That was wild, moreso if you were there.
It was still fairly funny but I feel like too much challenges relied on stuff
you could just look up fairly quickly on the net and not on actual logic, which
is what you’d want to test someone on I guess, unless your point was to know if
they could absorb infos to improve or something, but then I have no idea how
you’ll tell legit from fakes. Oh wait you most likely don’t since it’s invite
only, well this explains that I guess.
There’s one thing I can say about foobar that I think is really neat though: I
finished the 9 challenges of foobar in less than 200 lines of code and I’m sure
I could’ve done better, so this seems pretty accurate of the code quality that
someone can produce(or if he just calculates a bunch of predefined answers like
I almost did for Expanding Nebula…seriously that thing was some hell).
Ah yeah for the people wanting to do Foobar without using Google or just
spamming ranodm keywords there(trust me I tried), there is more than one way to
get in. Seriously just keep looking, you’ll find a way through eventually.
Anyways I hoped you liked this article as much as I liked writing it, the challenge was really fun, albeit a bitoverhyped.  But yeah, Google Foobar is really just a glorified month-spanning interview for Google, no new Cicada 3301 lying under the lines(I should actually look at the Liber Primus one day by the way, sounds like a fun way to waste time trying to decrypt garbage). On my side I successfully hacked something else while working on Foobar, which I have no idea if I’m going to even talk about it because of its sensitive nature buuut that really helped me getting back into CS after this Linux work and me not understanding a thing about some parts of the kernel. So I guess we’ll see if I’ll make an article about it!
Meanwhile as promised my code is available in full there, if this wall of text actually inspired you or something.


Gmail
Home
Messages
Inbox
Sent
Outbox
Drafts
Starred
Important
Spam
Trash
HOME
Notify
Aspiring Minds Govt jobs
Drafts
Empty
Starred
info
Important
empty
Spam
Aspiring minds
Trash
empty


| Name: | Md.kamrul Hassan |
|---|---|
| Date of birth: | 12-10-1997 |
| Address: | Thana-Road,Dhamrai,Dhaka |
| Email: |<EMAIL_ADDRESS>|
| Phone: |<PHONE_NUMBER>1 |
If you want any website, development & fackebook page boost, After that you can contact me.
Download CVI Develop Dynamic Responsive Website, E-Commerce Stores, Different Kinds Of Web Portal And Other Web Application Admin Panel.
Graphic With Perfect Architecture, Aesthetic Look And Feel Including User Experience Give The UI/UX That You Dream.
Facebook Marketing ( Social Engineering ) Email Marketing ( Using our own database of leads) SMS marketing
I am Web Design & Developer For Your It Care. I am Very Friendly And More Talented Member Are Working Toward. In This Company Every Member Are Successful In Their Academic Life And Processional Career. And All The Member Are Fresher But All Of Us Are More Skillful Then Other. Here I Can Find More Complexity.
Read moreLorem ipsum dolor sit amet consectetur adipisicing elit.
Lorem ipsum dolor sit amet consectetur adipisicing elit.
Lorem ipsum dolor sit amet consectetur adipisicing elit.
Lorem ipsum dolor sit amet consectetur adipisicing elit.
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Dignissimos harum corporis fuga corrupti. Doloribus quis soluta nesciunt veritatis vitae nobis?


Preview the web widget, prefilled buttons, and prefilled iframes with specific API keys and associated parameters. Submitting will redirect to either the white labeled profile or external form page as noted on an Organization's widget_redirect
field.


Introduction¶
[Demo Video] | [User API] | [Github] | [Discord] | [Twitter]
Neural MMO is a computationally accessible research platform that simulates populations of agents in procedurally generated virtual worlds. Users select from a set of provided game systems to create environments for their specific research problems – with support for up to a thousand agents and one square kilometer maps over several thousand time steps. The platform provides a Python API for scripting agents, [RLlib] integration for reinforcement learning approaches, an evaluation suite for comparing and interpreting agent policies, and an interactive 3D client packed with visualization tools. The guides below contain everything you need to get started. We also run a community [Discord] for support, discussion, and dev updates. This is the best place to contact me.
Abstract: Progress in multiagent intelligence research is fundamentally limited by the complexity of environments available for study. Neural MMO is a massively multiagent AI research environment inspired by Massively Multiplayer Online (MMO) role playing games – self-contained worlds featuring thousands of agents per persistent macrocosm, diverse skilling systems, local and global economies, complex emergent social structures, and ad-hoc high-stakes single and team based conflict. Our goal is not to simulate the near-infinite physical processes of life on Earth but instead to construct an efficient facsimile that incentivizes the emergence of high-level social and general artificial intelligence. To this end, we consider MMOs the best proxy for the real world among human games.
Installation¶
Tested on Ubuntu 20.04, Windows 10 + WSL, and MacOS
git clone https://gitlab.aicrowd.com/neural-mmo/neural-mmo-starter-kit
pip install neural-mmo
git clone --single-branch --depth=1 --branch master https://github.com/jsuarez5341/neural-mmo
cd neural-mmo && bash scripts/setup.sh
git clone --single-branch --depth=1 --branch v1.5.1 https://github.com/jsuarez5341/neural-mmo-client
#If not on WSL:
mv neural-mmo-client neural-mmo/forge/embyr
- Troubleshooting:
Post installation errors in #support on the [Discord]
If you are training on GPU and get an IndexError error on self.device, set gpu_ids=[0] in ray/rllib/policy/torch_policy.py:150 (typically in ~/anaconda3/lib/python3.8/site-packages)
Most compatibility issues with the client and unsupported operating systems can be resolved by opening the project in the Unity Editor
If you want full commit history, clone without
--depth=1
(including in scripts/setup.sh for the client). This flag is only included to cut down on download timeThe master branch will always contain the latest stable version. Each previous version release is archived in a separate branch. Dev branches are not nightly builds and may be flammable.
CLI¶
Forge is the main file for the included demo and starter project (/projekt). It includes commands for map generation, training, evaluation, visualization, and rendering. To view documentation:
python Forge.py --help
NAME
python Forge.py --help - Neural MMO CLI powered by Google Fire
SYNOPSIS
python Forge.py --help - GROUP | COMMAND
DESCRIPTION
Main file for the RLlib demo included with Neural MMO.
Usage:
python Forge.py <COMMAND> --config=<CONFIG> --ARG1=<ARG1> ...
The User API documents core env flags. Additional config options specific
to this demo are available in projekt/config.py.
The --config flag may be used to load an entire group of options at once.
The Debug, SmallMaps, and LargeMaps options are included in this demo with
the latter being the default -- or write your own in projekt/config.py
GROUPS
GROUP is one of the following:
config
Large scale Neural MMO training setting
COMMANDS
COMMAND is one of the following:
evaluate
Evaluate a model on --EVAL_MAPS maps from the training set
generalize
Evaluate a model on --EVAL_MAPS maps not seen during training
generate
Generate game maps for the current --config setting
render
Start a WebSocket server that autoconnects to the 3D Unity client
train
Train a model starting with the current value of --MODEL
visualize
Web dashboard for the latest evaluation/generalization results
Generate Environments¶
Configuration¶
We recommend that new users start with one of the default configurations provided with the environment. Similarly, competition participants should start with the configuration provided for the current round.
Experienced users can create custom environments that are better suited to their specific research interests. We further recommend reviewing the game wiki’s description of the vanilla mechanics before heavily modifying them. Enable a specific set of game systems by inheriting from their respective configs, in addition to the base class. For example:
class ExampleSelectGameSystemsConfig(SmallMaps, config.Resource, config.Progression):
pass
Customize each game system by overriding exposed config properties:
class ExampleCustomizeGameSystemsConfig(SmallMaps, config.Resource, config.Progression):
# Example core config customization
NMOB = 512
NENT = 128
# Example terrain generation customization
TERRAIN_CENTER = 512
TERRAIN_WATER = 0.40
TERRAIN_GRASS = 0.55
# Example progression system customization
PROGRESSION_BASE_XP_SCALE = 10
PROGRESSION_CONSTITUTION_XP_SCALE = 2
A full list of config properties is available here:
Procedural Terrain¶
Once you have selected or written a config, you will need to generate maps for training and/or evaluation. Generating image previews of each map can be useful in certain circumstances, but note that this will take additional space and time. The previews for max sized maps are huge, so we’ll only generate PNGs for smaller ones.
python Forge.py generate --config=SmallMaps --TERRAIN_RENDER
python Forge.py generate --config=LargeMaps
Generating 256 training and 64 evaluation maps:
100%|████████████████████████████████████████████████| 320/320 [01:35<00:00, 3.34it/s]
Generating 256 training and 64 evaluation maps:
100%|████████████████████████████████████████████████| 320/320 [09:53<00:00, 1.85s/it]
Generating small maps without rendering takes 5-10 seconds on a modern CPU.
Terrain generation is controlled by a number of parameters prefixed with TERRAIN_. The config documentation details them all, and you can experiment with larger modifications to the procedural generation source in neural_mmo/forgeblade/core/terrain.py.
Create Policies¶
Scripted API¶
Neural MMO provides compact tensor observations that are difficult to integrate with scripted policies and change from version to version. We therefore provide a simple wrapper class that enables users to extract named attributes without direct dependence on the underlying structure of observations, documented here:
We will occasionally modify the set of available attributes. In these instances, we will publish upgrade scripts where possible and lists of larger changes requiring individual attention where needed.
Each Neural MMO release will include a set of [scripted baselines]. You may find these useful as references for creating your own models. You are also free to leverage any of the utility classes included with these baselines, but do note that these are not part of the official API and may change from version to version.
RLlib Integration¶
The baseline model and associated training and evaluation code in projekt/rllib_wrapper.py demonstrate how to use RLlib with Neural MMO. Note that RLlib is not a hard dependency of the platform: Neural MMO provides an otherwise-standard Gym interface extended for multiagent. That said, all of our trained baselines rely on RLlib, and we strongly suggest using it unless you fancy writing your own segmented trajectory collectors, hierarchical observation/action processing, variable agent population batching, etc.
Evaluating on canonical configs will load the associated pretrained baseline by default. To reproduce our baselines by training from scratch:
python Forge.py train --config=SmallMultimodalSkills --LOAD=False
python Forge.py --config=LargeMultimodalSkills --LOAD=False
___ ___ ___ ___
/__/\ /__/\ /__/\ / /\
\ \:\ | |::\ | |::\ / /::\ An open source
\ \:\ | |:|:\ | |:|:\ / /:/\:\ project originally
_____\__\:\ __|__|:|\:\ __|__|:|\:\ / /:/ \:\ founded by Joseph Suarez
/__/::::::::\ /__/::::| \:\ /__/::::| \:\ /__/:/ \__\:\ and formalized at OpenAI
\ \:\~~\~~\/ \ \:\~~\__\/ \ \:\~~\__\/ \ \:\ / /:/
\ \:\ ~~~ \ \:\ \ \:\ \ \:\ /:/ Now developed and
\ \:\ \ \:\ \ \:\ \ \:\/:/ maintained at MIT in
\ \:\ \ \:\ \ \:\ \ \::/ Phillip Isola's lab
\__\/ \__\/ \__\/ \__\/
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
▏Epoch: 16▕▏Sample: 8923.8/s (64.0s)▕▏Train: 35.4/s (235.2s)▕
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
▏Population ▕▏Min: 1.0▕▏Max: 103.0▕▏Mean: 51.6▕▏Std: 21.9▕
▏Lifetime ▕▏Min: 0.0▕▏Max: 998.0▕▏Mean: 50.8▕▏Std: 69.9▕
▏Skilling ▕▏Min: 10.0▕▏Max: 46.5▕▏Mean: 14.3▕▏Std: 4.9▕
▏Combat ▕▏Min: 3.0▕▏Max: 10.0▕▏Mean: 3.2▕▏Std: 0.5▕
▏Equipment ▕▏Min: 0.0▕▏Max: 8.0▕▏Mean: 0.0▕▏Std: 0.1▕
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
▏Epoch: 17▕▏Sample: 8910.2/s (62.2s)▕▏Train: 33.7/s (227.8s)▕
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
▏Population ▕▏Min: 1.0▕▏Max: 103.0▕▏Mean: 51.6▕▏Std: 21.9▕
▏Lifetime ▕▏Min: 0.0▕▏Max: 998.0▕▏Mean: 50.8▕▏Std: 69.9▕
▏Skilling ▕▏Min: 10.0▕▏Max: 46.5▕▏Mean: 14.3▕▏Std: 4.9▕
▏Combat ▕▏Min: 3.0▕▏Max: 10.0▕▏Mean: 3.2▕▏Std: 0.5▕
▏Equipment ▕▏Min: 0.0▕▏Max: 8.0▕▏Mean: 0.0▕▏Std: 0.1▕
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
▏Epoch: 18▕▏Sample: 8885.9/s (59.5s)▕▏Train: 32.4/s (217.2s)▕
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
▏Population ▕▏Min: 1.0▕▏Max: 103.0▕▏Mean: 51.6▕▏Std: 21.9▕
▏Lifetime ▕▏Min: 0.0▕▏Max: 998.0▕▏Mean: 50.8▕▏Std: 69.9▕
▏Skilling ▕▏Min: 10.0▕▏Max: 46.5▕▏Mean: 14.3▕▏Std: 4.9▕
▏Combat ▕▏Min: 3.0▕▏Max: 10.0▕▏Mean: 3.2▕▏Std: 0.5▕
▏Equipment ▕▏Min: 0.0▕▏Max: 8.0▕▏Mean: 0.0▕▏Std: 0.1▕
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
▏Neural MMO v1.5▕▏Epochs: 18.0▕▏kSamples: 236.8▕▏Sample Time: 1022.2▕▏Learn Time: 3797.6▕
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The training monitor above summarizes wall-clock time spent on sampling vs training and displays performance for the last three epochs. You can train reasonably good small-map models in a few hours and decent large-map models overnight on a single desktop with one GPU. See Baselines for exact training times and performances of our models.
- Note:
Training from scratch will overwrite the baseline models. Override the MODEL property or create a copy of the config to avoid this.
The training monitor receives performance updates when environments reset, which is independent of epoch boundaries. As such, multiple contiguous epochs may have identical summary statistics.
Evaluate Agents¶
Evaluation in open-ended massively multiagent settings is akin to that in the real world. Unlike in most single-agent and some multiagent environments, there is no absolute metric of performance. We therefore provide two evaluation options: tournaments, which measure relative performance against various opponents, and self-contained simulations, which measure qualitative behaviors.
Tournaments¶
This evaluation mode is new as of v1.5.1 and is being used in the current competition. Instead of evaluating agents against many copies of themselves, tournament mode places one (or a few) of the user’s agent(s) into an environment with opponents that have different policies. We currently use relatively simple scripted baselines for this but will begin using other users’ submissions as we receive them. You can download a local tournament evaluation toolkit from the competition page and submit agents for evaluation against other users. After the competition, we will integrate these tools into the main repository, along with additional users’ bots (provided we are able to obtain permission to do so).
Self-Contained¶
This is the classic evaluation setup used in older versions of Neural MMO. It suffers from a lack of ability to compare policies directly, but it is still well-suited to artificial life work targeting emergent behaviors in large populations. To collect statistics over the course of a simulation:
python Forge.py evaluate --config=SmallMultimodalSkills --EVAL_MAPS=1
python Forge.py evaluate --config=SmallMultimodalSkills --EVAL_MAPS=1 --SCRIPTED=Combat
Number of evaluation maps: 1
100%|██████████████████████████████████████████████| 1000/1000 [00:32<00:00, 31.10it/s]
Number of evaluation maps: 1
100%|██████████████████████████████████████████████| 1000/1000 [01:01<00:00, 16.17it/s]
We will cover how to visualize the results in the Visualization section below. Note that we have used a single evaluation map here to keep runtime short – our baselines average over several maps, and you should follow the protocol detailed in Baselines in formal comparisons.
Evaluation Distribution¶
Neural MMO provides three sets of evaluation settings:
Training Maps: Evaluate on the same maps used for training. This is standard practice in reinforcement learning. Enable by setting the GENERALIZE flag to False
Evaluation Maps: Evaluate on a set of held-out maps drawn from the training map distribution generated using different random seeds. This is the default setting
Transfer Maps: Evaluate large-map models on small maps (hard) or small-map models on large maps (very hard). Enable by setting the appropriate –config
Visualization Results¶
Dashboard and Statistics¶
The “visualize” command creates summary tables and figures using the results of training and evaluation
python Forge.py visualize --config=SmallMultimodalSkills
python Forge.py visualize --config=SmallMultimodalSkills SCRIPTED=CombatTribrid
Metric |
Min |
Max |
Mean |
Std |
|---|---|---|---|---|
Population |
18.00 |
57.00 |
45.95 |
4.09 |
Lifetime |
0.00 |
1000.00 |
46.49 |
110.78 |
Skilling |
10.00 |
50.50 |
14.06 |
5.92 |
Combat |
3.00 |
28.00 |
4.64 |
3.06 |
Equipment |
0.00 |
18.00 |
0.22 |
1.36 |
Exploration |
0.00 |
73.00 |
8.23 |
6.34 |
Metric |
Min |
Max |
Mean |
Std |
|---|---|---|---|---|
Population |
27.00 |
62.00 |
49.50 |
4.43 |
Lifetime |
0.00 |
994.00 |
50.92 |
74.27 |
Skilling |
10.00 |
53.00 |
15.04 |
5.54 |
Combat |
3.00 |
33.00 |
4.35 |
2.77 |
Equipment |
0.00 |
26.00 |
0.10 |
1.04 |
Exploration |
0.00 |
101.00 |
14.94 |
10.80 |
Your results may vary slightly from ours, which were obtained using a slightly larger evaluation for stability. From the summary stats, the models look pretty comparable. Since the scripted baseline performs an exact min-max search using a ton of hand-coded domain knowledge, this is actually quite a good result. But it would be nice to have finer-grained insights – both to aid in future development and for the paper. The “visualize” command also loads a browser-based interactive dashboard:
Each row of the dashboard contains multiple visualization styles for one row of the summary table. In this particular instance, the Skill Level bar chart is most illuminating – notice how the scripted model uses only Ranged combat whereas the pretrained model uses a mix of Ranged and Mage. I set the scripted model to only use range combat because I thought it was probably stronger overall, but apparently Range and Mage are somewhat balanced. The pretrained model avoids Melee even though it does the most damage, probably because the current movement system makes it difficult to close distance to an opponent – perhaps I should consider changing the movement system in a future update.
So, why do we need 15 plots when only one turned out to be important? First of all, we didn’t know which plot would highlight an interesting difference ahead of time. Second, there are some smaller observations we can make, such as the pretrained model obtaining significantly more equipment pickups while the scripted model obtained fewer and better pickups (Equipment scatter plots). Or that the pretrained model has a slightly heavier Lifetime right tail, as seen in the Lifetime Gantt plot. Many of our most successful experiments (and worst bug fixes) were motivated by an unusual disparity in the dashboard.
And before you ask, yes: there’s a boring publication theme: specify –VIS_THEME=publication. In fact, you can create custom logging with a highly configurable dashboard to go with it in only a few lines of code – just override the log method of neural_mmo/forgetrinity/env.py to specify your own data tracks and plot styles.
Rendering and Overlays¶
Rendering the environment requires launching both a server and a client. To launch the server:
python Forge.py render --config=SmallMultimodalSkills
The server will take a few seconds to load the pretrained policy and connect to the client.
The on-screen instructions demonstrate how to pan and zoom in the environment. You can also click on agents to examine their skill levels. The in-game console (which you can toggle with the tilde key) give you access to a number of overlays. Note that the LargeMaps config requires a good workstation to render and you should avoid zooming all the way out.
The counts (exploration) overlay is computed by splatting the agent’s current position to a counts map. Most other overlays are computed analogously. However, you can also do more impressive things with a bit more compute. For example, the tileValues and entityValues overlays simulate an agent on every tile and computes the value function with respect to local tiles/entities. Note that some overlays, such as counts and skills, are well-defined for all models. Others, such as value function and attention, do not exist for scripted baselines.
Writing your own overlays is simple. You can find the source code for general overlays (those computable by scripted baselines) in neural_mmo/forgetrinity/overlay.py. RLlib-specific overlays that require access to the trainer/model are included in projekt/rllib_wrapper.py. Details are also included in the User API.


High-level replicated data types that are designed to work correctly in the presence of concurrent updates and partial failures.
Traditional ACID transactions were built for single-machine deployments. It is expensive to implement ACID transactions in distributed deployments. On the other hand, highly-available transactions (HAT) provide strong consistency within a data center, but still perform well in geo-replicated deployments.
Designed to run on multiple servers in locations distributed world-wide. It provides continuous functioning even when there are failures or network partition.


\[ ~ \] \[ ~ \] \[ ~ \]
$ ~~ $
\[ ~ \] \[ ~ \] *Presenter
1 {-# OPTIONS_GHC -fplugin ThoralfPlugin.Plugin #-}
2
3 data Vec :: Nat -> Type -> Type where
4 VNil :: Vec 0 a
5 (:>) :: a -> Vec n a -> Vec (1+n) a
6 infixr 5 :>
7
8 concatVec :: Vec n a -> Vec m a -> Vec (n+m) a
9 concatVec VNil ys = ys
10 concatVec (x :> xs) ys = x :> (concatVec xs ys)
1 * Could not deduce: (1 + (n1 + m)) ~ (n + m)
2 from the context: n ~ (1 + n1)
3 Expected type: Vec (n + m) a
4 Actual type: Vec (1 + (n1 + m)) a
\[ ~ \]
GOAL: Make the right type errors dissapear.
1 {-# OPTIONS_GHC -fplugin ThoralfPlugin.Plugin #-}
2
3 data Vec :: Nat -> Type -> Type where
4 VNil :: Vec 0 a
5 (:>) :: a -> Vec n a -> Vec (1+n) a
6 infixr 5 :>
7
8 concatVec :: Vec n a -> Vec m a -> Vec (n+m) a
9 concatVec VNil ys = ys
10 concatVec (x :> xs) ys = x :> (concatVec xs ys)
11
12 fancyLookup :: In n keys => FancyMap keys Nat Bool -> SNat n -> Bool
1 type family (n :: Nat) + (m :: Nat) :: Nat where
2 Z + m = Z
3 (S n) + m = S (n + m)
Issues: complicated instances, tedious proofs
1 * Could not deduce: (1 + (n1 + m)) ~ (n + m)
2 from the context: n ~ (1 + n1)
3 Expected type: Vec (n + m) a
4 Actual type: Vec (1 + (n1 + m)) a
Call it the equational deduction problem, EDP
1 * Could not deduce: (1 + (n1 + m)) ~ (n + m)
2 from the context: n ~ (1 + n1)
3 Expected type: Vec (n + m) a
4 Actual type: Vec (1 + (n1 + m)) a
What does it mean to assume $n \sim (1 + n_1)~$?
When do we deduce the wanted equality?
$\texttt{Fm} ::= \texttt{Nil } \vert \texttt{ Alter } fm ~ k ~ v ~\vert \texttt{ Delete } fm ~ k$
1 * Could not deduce: m1 ~ (Alter m1 "price" Int)
2 from the context: m ~ (Alter m1 field val)
3 or m ~ Alter m "price" Int
4 or from DisEquality "price" field
$$\frac{\texttt{k} \sim \texttt{k'}}{\texttt{Alter (Alter fm k v1) k' v2} \sim \texttt{Alter fm k v2}}$$
$\texttt{Fm} ::= \texttt{Nil } \vert \texttt{ Alter } fm ~ k ~ v ~\vert \texttt{ Delete } fm ~ k$
1 * Could not deduce: m1 ~ (Alter m1 "price" Int)
2 from the context: m = (Alter m1 field val)
3 or m = Alter m "price" Int
4 or from "price" != field
$$\frac{\texttt{k} \sim \texttt{k'}}{\texttt{Alter (Alter fm k v1) k' v2} \sim \texttt{Alter fm k v2}}$$
$ G \Rightarrow W $ iff all (closing) substitutions that satisfy $G$ neccesarily satisfy $W$
Note: users define "satisfy" (via the literal equality relation)
1 (declare-const n Int)
2 (declare-const m Int)
3 (declare-const n1 Int)
4
5 ; Assert all givens.
6 (assert (= n (+ 1 n1)))
7 (assert (= n1 (+ 1 n)))
8 (check-sat) // unsat
1 ; Assert at least one wanted is false.
2 (assert (= n (+ 1 n1)))
3 (assert (not (= n m)))
4 (check-sat)
1 * Could not deduce: (n2 - n1) ~ (m - n)
2 from the context: n ~ (1 + n1)
3 or from: m ~ (1 + n2)
1 (declare-const n Int)
2 (declare-const m Int)
3 (declare-const n1 Int)
4 (declare-const n2 Int)
5
6 ; Assert all givens.
7 (assert (= n (+ 1 n1)))
8 (assert (= m (+ 1 n2)))
9 (check-sat) ; check if givens are consistent
10
11 ; Assert at least one wanted is false.
12 (assert (not (= (- n2 n1) (- m n))))
13 (check-sat) ; we want "unsat"
1 from the context: n ~ (1 + n1)
2 or from: m ~ (1 + n2)
1 (declare-const n Int)
2 (declare-const m Int)
3 (declare-const n1 Int)
4 (declare-const n2 Int)
5
6 ; Assert all givens.
7 (assert (= n (+ 1 n1)))
8 (assert (= m (+ 1 n2)))
9 (check-sat) ; check if givens are consistent
1 * Could not deduce: m1 ~ (Alter m1 "price" Int)
2 from the context: m ~ (Alter m1 field val)
3 or m ~ Alter m "price" Int
4 or from DisEquality "price" field
1 (declare-datatypes (T)
2 ((Maybe nothing (just (fromJust T)))))
3
4 (declare-const m (Array String (Maybe String)))
5 (declare-const m1 (Array String (Maybe String)))
6 (declare-const field String)
7 (declare-const val String)
8
9 ; Assert Givens
10 (assert (not (= "price" field)))
11 (assert (= m (store m "price" (just "Int"))))
12 (assert (= m (store m1 field (just val))))
13 (check-sat)
14
15 ; Assert at least one wanted is false.
16 (assert (not (= m1 (store m1 "price" (just "Int")))))
17 (check-sat)
1 * Could not deduce: m1 ~ (Alter m1 "price" Int)
2 from the context: m ~ (Alter m1 field val)
3 or m ~ Alter m "price" Int
4 or from DisEquality "price" field
$\varphi(m) \sim \varphi(\texttt{Alter } ~~~m_1 ~~~field ~~~val )\texttt{)}$
$f(\varphi(m)) \cong f( \varphi(\texttt{Alter } ~~~m_1 ~~~field ~~~val ))\texttt{)}$
$f(\varphi(m)) \cong f(\texttt{Alter } ~~~\varphi(m_1) ~~~\varphi(field) ~~~((\varphi(val))\texttt{)}$
$f(\varphi(m)) \cong \texttt{(store } ~~~(f(\varphi(m_1))) ~~~(f(\varphi(field))) ~~~(f(\varphi(val)))\texttt{)}$
From this, proving our algorithm meets our specification of EDP is easy.
For the encoding function $f : \texttt{GHC-TYPE} \rightarrow \texttt{SMT-SORT}$,
$$ t \sim t' \iff f(t) \cong f(t')$$
1 type Has fm key val = (Alter fm key val ~ fm)
2
3 someFn :: SomeTy (Alter fm "a" 5) -> Int
4
5 otherFn :: Has fm "a" 5 => SomeTy fm -> Int
\[ ~ \] \[ ~ \]
$ ~~ $
\[ ~ \]
*Presenter
| Table of Contents | t |
|---|---|
| Exposé | ESC |
| Full screen slides | e |
| Presenter View | p |
| Source Files | s |
| Slide Numbers | n |
| Toggle screen blanking | b |
| Show/hide slide context | c |
| Notes | 2 |
| Help | h |


(comment: As originally posted on the OUBS Blog)
The course has started. The course starts with an introduction book, something I will cover shortly here. Most of the things will be common knowledge but I will add the most important functions here for later reference.

I’ll start with the second chapter (Algebra, graphs and calculus). Here are some basics:

a0 = 0
a1 = a
a + b = b + a
ab = ba
a(b+c) = ab + ac
a+(b+c) = (a+b)+c
a(bc) = (ab)*c

Moving on to solving equations, one thing can be said: whatever you do on one side of an equation, you do on the other too (like adding 2 or multiplying x), then you are just fine. You should also take the unknown to one side of the equation. All in all, always follow that system. Multiply, add, substract, remove brackets, whatever, just get the unknown on one side so that the result is something like X = 2. It might takesome time but you’ll get there. If you have two variables, just take one of them on one side and the other on the other side.

Next on our list are logarithms. For me, these buggers are hard to wrap my head arround. Somehow, x*y seems fully natural but log(x) doesn’t, while it should. So here are some rules:

Log (xy) = Log x + Log y
Log (x/y) = Log x - Log y
Log (xn) = n Log x
Log (x(1/n)) = (1/n) Log x
Log (x-n) = -n Log x

The same can be done for natural logarithms, which are written "ln" and are in relation to powers based on "e". Never mind what it all means, just that "e" is, as weird as it sounds, a very special number that will come up in lots of cases.

Next the book looks at graphs and how to find the function behind them. In general, the folloing terms are useful:

Rise / Run = y height climed / x distance travelled = change in y value / change in x value = slope. This is probably more interesting to somebody without english as his native language, like me ;)

Now this slope brings us to the first derivative though, because the first derivative is the slope of a graph. In a sense it is:

Change in y / Change in x

When we go into minute changes in both x and y, then we are doing a differentiation. Here we need some rules which I still remember all too well from physics studies.

dy/dx = na x(n-1) is the differentiation of y = axn

Implied in this is that you will have a low or highpoint in a graph if the differentiation is 0. A high point would be present if the second derivative is negative (the y values going down with increasing x values after the point), a lot point if it is positive (y going up). Remember that you can also do partial differentiation, meaning that you differentiate only for one variable.

Statistical techniques is next. Everything starts with averages and here you have three:
- The arithmetic mean, being the sum of all values devided by the number of values. That the average evryone knows.
- The mode is the data that occurs most frequently
- The median is the middle data, when all data is arranged in order of magnitude.

You can calculate all three with Excel or other spreadsheets. Another mean is the geometric mean which is calculated my multiplying the different values and taking the nth root of the product. This is used when there is some kind of compounding in the data series.

Another important item in statistics is teh range = x(max) - x(min). It will help us find the spread of data arround the middle. Here the standard deviation is useful.

The variance is the square of the standard deviation (V = S2)

Next up is the normal distribution, which is kind of the shape of the data or graph in question. The normal distribution is the typical bell shape. For any normal distribution there are a few facts:
- 68.26% of readings occure within +/- 1S
- 95.45% within +/- 2S
- 99.74% within +/- 3S

In general, a sample of n>30 will suffice to use standard deviation. The sample mean will possibly be a number of standard errors arround the true population mean, but due to being normally distributed, 95% will be within +/- 1.96 SE and 99% within +/- 2.58 SE, where SE = (population standard deviation) / (route of sample size). Therefore, if we want to find the range of true means within the population with a 99% certainty, then we need to calculate the sample size mean +/- 1,96SE.

Next up, correlation and covariance. We can have positive or negative correlation in relation to whether one variable reacts the same way or adverse to another variable. Correlation analysis is done to find links between different sets of data. A first thing to do this is to draw a scatter diagram, simply putting all your data points into a chart and then seeing if they have something in common. The correlation formula is the following:

Regression analysis is used to find a relationship between two sets of data. If you estimate within your range of data you are doing an interpolation, where an extrapolation would be about making estimates for values outside your observed range.

In general, you will find the following:

This part of the book finishes off with time series analysis. Here you take, for example, your quarterly data, add 4 quarters up, device them by 4 and you get your 4-quarter moving average. Averaging two 4-quarter moving averages will give you the centered 4-quarter moving average, allowing you to compare this average with the real value, giving you seasonal variation. Then you can forecast sales and take into account seasonable variations.


Thirteen rocket launchers seized in Habiganj forest
by bdnews24.comAs many as 13 rocket launchers have been recovered in a drive deep into Satchhari National Park in Habiganj.
The Rapid Action Battalion and the army conducted the joint operation in the forest on Friday night, RAB-7 commander Lt Col Moshiur Rahman Jewel said on Saturday.
Some explosives were also found in the drive. Further details would be revealed later, Rahman said.
The RAB on Feb 3 seized 10 anti-tank rockets in a drive on the forest. It found 14 sacks of ammunition in a bunker at a home of a tribal village in the forest in 2014.
Chunarughat police could not find out who stashed the arms and ammunition, according to probe reports.


Photos by Brian Forrest.
A. Quicy Jones: Building for Better Living was the first museum exhibition dedicated to the work of the pioneering mid-century architect.
I designed graphics and branding for this exhibition, working in collaboration with Chu + Gooding Architects. Exhibition materials included brochures, educational materials, a special Family Day event, merchandise, and more.
The project also included an interactive gallery guide, which can be seen here.


Welcome To Viron Infotech
Put Your Querry Here
No ninjas!
08:41
The first rule of being a ninja is, 'Do no harm.'
08:55
Knowing when to leave requires training.
10:13


Intro text here.
Governance
Chemicals
Thesaurus
Enter search terms or a module, class or function name.


Struct Result
Represents the result value of parsing operations.
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: System.Text.Patterns
Assembly: Stringier.Patterns.dll
Syntax
public struct Result
Remarks
In very simple terms, there are two main components. The first is a Boolean representing success of the operation. The second is the captured string during the operation. This type can be used as if it is either individual type.
In more technicaly terms, this type only appears to be those, and may actually be implemented using complete different means.
Properties
| Improve this Doc View SourceLength
The length of the captured text
Declaration
public int Length { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
| Improve this Doc View SourceThrowException()
Throw a ParserException based on the error that occured, if any
Declaration
public void ThrowException()
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A string that represents the current object. |
Overrides
System.ValueType.ToString()
Operators
| Improve this Doc View SourceImplicit(Result to Boolean)
Declaration
public static implicit operator bool (Result Result)
Parameters
| Type | Name | Description |
|---|---|---|
| Result | Result |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Implicit(Result to String)
Declaration
public static implicit operator string (Result Result)
Parameters
| Type | Name | Description |
|---|---|---|
| Result | Result |
Returns
| Type | Description |
|---|---|
| System.String |


Publish & subscribe
to streams of data like a messaging system
Learn more »Process
streams of data efficiently and in real time
Learn more »Store
streams of data safely in a distributed replicated cluster
Learn more »Kafka™ is used for building real-time data pipelines and streaming apps. It is horizontally scalable, fault-tolerant, wicked fast, and runs in production in thousands of companies.
Learn more


Company Profile
Show of your logo! Upload and edit your company name and logo here.
- - Recomended size for image is 200px*200px
- - Max. file size of 5MB
- - File format must be in jpg, jpeg, png or gif
{% if company_logo %}
{% else %}
{% endif %}
{% if company_logo %}
{% endif %}
Change Logo
Company Name


The United Kingdom of Great Britain and Northern Ireland, commonly known as the United Kingdom (UK) and Britain, is a sovereign state located off the north-western coast of continental Europe. The country includes the island of Great Britain, the north-eastern part of the island of Ireland and many smaller islands. Northern Ireland is the only part of the UK that shares a land border with another state—the Republic of Ireland. Apart from this land border, the UK is surrounded by the Atlantic Ocean in the west and north, the North Sea in the east, the English Channel in the south and the Irish Sea in the west.
|
|
|
|
|
|
|
|
|
|
|
Andrew Philip |
Born on December 25, 1954, in Spokane, Washington. Philip graduated from Texas University in 1978. He started his career as a teacher. Later he started business with his friend Paul. They both spent more time together working on business. They earned enough money and spent that for poor and social welfares. Later they together started an organization for children welfare.
|
|
|
|
|
|
|
UI, reporting and business intelligence on any .NET platform, all from one vendor.
No royalties, run-time, or server-deployment fees means no surprises.
An almost brutal QA process makes our products truly enterprise-quality.
Our team is in-house, accessible, and fast. The online forum, knowledge base, and Direct-Trac support system provide 24/7 access.


你好，我的朋友。
Welcome to my world.
ようこそ、私の世界へ。
About
I'm Hongyi. Chinese.
My Japanese nickname is Kazumi.
currently a graduate student at University of Tokyo. Formerly an undergraduate of Waseda University.
Studying in Engineering Dept. Majored in Architecture design.
This website aims to display some writtings & posts which created by me.
Please feel free to send me email if you find some problems or interests.
嗨！我是Kazumi。欢迎光临我的主页。
ようこそ、Kazumiのワールドへ。
きになった内容があれば、気軽にメールをください。
何卒。


{% extends "registration/proxy.html" %} {% block title %}Password reset complete{% endblock %} {% block pagetitle %}Password reset complete{% endblock %} {% block content %}
Your password has been successfully reset. You may go ahead and work farther as a logged in user.
{% endblock %}


EconomySim
This is the documentation for the EconomySim model...
The documentation for "economySim.ModelInitializer" can be found
here
.


Video: “Bangang, Bodoh…” Two Umno MPs Have Shouting Match With Each Other In Parliament Lobby
by Veronica ElankovanTap to listen to this article instead: 🔊 Listen to Post
We all know that verbal brawls are very common inside the parliament but it looks like these arguments can also extend outside parliament meetings. Malaysiakini wrote that two Umno ministers – Kuala Krau MP Ismail Mohamed Said and Pasir Salak MP Tajuddin Abdul Rahman – had a verbal fight over Ismail’s daughter’s pictures, which was circulated by Tajuddin all over the internet.
Ismail said that Tajuddin had implied that he (Ismail) organised a get-together to show support for “another leader”. But, in reality, it was just Ismail’s friends visiting his daughter who was ill. In the video which was posted by Oriental Daily News, both MPs can be seen shouting derogatory words at each other.
At one point, the security got in the middle of the fight as they held Ismail back to keep him from getting physical.  – Why are you pretending to be fierce?
Tajuddin was later swarmed by reporters asking what had actually happened, and he answered that it was just a “misunderstanding between friends”. And, when asked to elaborate on the fight, he merely said that there was nothing to elaborate. Well, if you say so.
You can watch the fight between the two Umno MPs below and let us know what you think in the comments below:
Source: Facebook
Also read: “Tell Me the Time and Place,” Said MP Willie Replying to Bung Moktar’s Fist Fight Challenge


Restrict command-line access to shared environments.
Restrict SSH access from an instance
Launch a new EC2 instance.
When choosing a security group, choose a group that has no inbound access.
Using CloudFormation, you can give instance limited resource-level SSH access to perform deployment, but restrict users from SSH or authenticating against the instance.


Louis C.K. Accuser Says: ‘What C.K. Did Was Not Done With Consent’
by Shakiel MahjouriA Louis C.K. accuser insists the controversial comedian’s actions were not consensual.
Julia Wolov, one half of the comedy duo Dana & Julia, challenged C.K. in a new piece for Canadian Jewish News titled “Counterpoint: I Didn’t Consent to Louis C.K. Masturbating in Front of Me.” The op-ed was written in response to a C.K. defense piece from Toronto comedy-club owner Mark Breslin titled, “Why I Brought Louis C.K. Back From the Dead,”
“Contrary to Breslin’s accounting, what C.K. did was not done with consent,” Wolov wrote. “We never agreed nor asked him to take all his clothes off and masturbate to completion in front of us. But it didn’t matter because the exciting part for him was the fear on our faces.”
“Since Breslin seems to take pride in his Judaism, he should know that four of the five women from the Times article are Jewish,” she continued. “The author’s attempt to convince himself and the Jewish community of the validity of supporting C.K. by saying he is part Jewish is shameful.”
Wolov argued comedians like her deserve just as much respect as a famous presence like C.K.
“We too work in comedy. We will probably never make tens of millions of dollars to lose. Louis C.K. is still very wealthy,” Wolov exclaimed. “Although we may never have the stature to perform at Yuk Yuk’s, we will continue to navigate our careers the best we can.”
“When you pat yourself on the back for Louis C.K.’s career resurgence and helping your business thrive,” she concluded. “Maybe think about the human beings encumbered in this story.”


Google Earth Enterprise Documentation Home | GEE Server administration
Example Search plug-in Python code sample
The ExampleSearch
search plug-in for GEE Server provides the interface to query a SQL database of San Francisco neighborhoods via a search tab in Google Earth EC or a browser. The following description captures the overall mechanism of the plug-in but we recommend that you take a look at the code directly.
You can find the two Python files for the ExampleSearch
plug-in in the following location:
/opt/google/gehttpd/wsgi-bin/search/plug-in/example_search_app.py
/opt/google/gehttpd/wsgi-bin/search/plug-in/example_search_handler.py
In Google Earth Enterprise, a search plug-in Python-based framework relies on the Python Web Server Gateway Interface (WSGI), a Python API that acts as an interface between web servers and web applications. The web application or framework, example_search_app.py
search plug-in, is represented to the server as a Python callable method, __call__
to start the application. The callable method must include two arguments:
environ
object—a list that contains the WSGI environment informationstart_response
callable, which performs an example search and returns the KML/JSONP format output back in the HTTP response.
A request returns a response_body
, the search results that are sent back to the requesting client wrapped in a list.
The handler, example_search_handler.py
, is the actual plug-in code. It defines a class, ExampleSearch
, which demonstrates how to construct and query a spatial database based on a URL search string, extract geometries from the result, associate various styles with them and return the response back to the client. The query definition, RunExampleSearch
, performs a query search on the san_francisco_neighborhoods
SQL table, with a response type of KML for Google Earth EC, or JSONP for a browser client, and returning the results as a list.
JSON object and response structure
The JSON object defined in example_search_handler.py
, and the JSON response returned from the query, follow the default map structure that is bundled with GEE. If you want to create your own map application using a custom search response, you can structure the JSON to take advantage of Google Maps Javascript API functionality.
For example, if you have GeoJSON
data, a standard for geospatial data on the internet, the google.maps.Data
class allows you to add GeoJSON data to your map. The Data
class follows the structure of GeoJSON
in its data representation and makes it easy to import GeoJSON
data and display points, line-strings and polygons. For more information about the Data Layer of Google Maps Javascript API, see https://developers.google.com/maps/documentation/javascript/datalayer.
SQL query settings
The query that example_search_handler.py
runs is hard-coded to the database scheme of the san_francisco_neighborhoods
SQL table so if you have different schema, you’ll need to change the query. The search query is standard SQL available at: /opt/google/gehttpd/wsgi-bin/search/common/geconstants.py
. For example, the following snippet shows the SQL query used to return the polygon perimeters of the neighborhoods listed in the “san_francisco_neighborhoods” SQL table:
self.example_query = ( "SELECT ${FUNC}(ST_Force_3DZ(the_geom)) AS the_geom,Area(the_geom)," "Perimeter(the_geom),sfar_distr,nbrhood, " "GeometryType(the_geom) AS geom_type " "FROM san_francisco_neighborhoods " "WHERE " "lower(nbrhood) like %s" )
As the /opt/google/gehttpd/wsgi-bin/search/common/geconstants.py
file includes the queries for all the system search plug-ins provided with Google Earth Enterprise, you can check out the various constructs to help you build your plug-in. We recommend that you keep your SQL query in the handler of your plug-in.
KML Geometric types supported
The ExampleSearch plug-in returns polygons, but all KML geometric types are supported.