Mushrooms - P. cubensis
To begin this experience report, let me start off by saying I was unhealthy and unprepared to ingest mushrooms(in a bad mindstate). Thursday night I spent the night at a friends house, I'll call him N. Me and N planned on staying up all night doing meth(.25 grams each), playing video games, then going to work(UPS) at 11:00am in the morning. Well we did the meth, N didnt goto Work, I ended up not going until my mom called N's house saying my supervisor called and they are highly upset, stating I could be fired if I didnt showup. Well I showed up an hour late. Worked for about 4 hours, called N to pick me up, chilled at his house all day, acquired the shrooms (note that I havent ate nothing all night thursday and friday)
-----------------------------------------------------
The Trip:
7:00 - Setting: At a friends house, ill refer to him as T. Me and T split two 1/8ths, each 4.5grams of p. cubensis (im guessing on this, blueish purple tent on and inside the stems.. orangeish gold caps mostly in a ball form)
7:15 - Ingested my mushrooms. T will wait to eat his after he hops in the shower.
7:30 - Outside, me and N are hanging out on the porch, T is in the shower. The Shrooms have allready begun to take effect!! (fastest developing shroom-trip ive ever experienced). I can feel my brain patterns changing, it feels like my body is going underwater, a heavy-stone like feeling takes effect. I am amazed at the bright green grass and flowers growing, and looking at tree leafs, they tend to blend in together. I go inside to tell T the shrooms are good. T ate his shrooms around 7:45.
8:00 - The sun eventually goes down, at this point things tend to get a little evil-like. We plan for a walk outside to N's house (he lives on the next street over). During the walk, I remember for a little bit that my surroundings would not change no matter how far I walked, like I was frozen in time but could still move. This freaked me out, I started running, still the same frozen-like effect. I ended up running out into the street when N and T yelled for me to come back.
8:30 - After arriving at N's house, N changed clothes into an all black suit (at the time he called it his funeral suit. this made me freak out even more while I was tripping, also T had on a red and black ecko shirt, was this evil-theme night or what). I was thirsty and T handed me his cup of water, the all-ready red cup turned into a darker shade of red, and it seemed like the cup handle grew 'edges', I immediateley threw the water down.  We went back outside, most of the time everything just was evil-like in appearance, and mind-state wise. When N took off and went riding I made him turn into T's driveway and told them to stay there, afraid I was going to die on the road for some odd reason. When at T's, a friend named S made an appearance. When he pulled in to the driveway, I was walking back and forth, sitting down, just thinking the craziest thoughts.
Things got even more crazy - It was as if time sped up 5 times normal, N, and T raced to S's car, they where moving there arms fast, and talking at a fast pace, I couldnt keep up with things. It eventually went back to normal, S left and we went inside. While inside everything felt artifical, the water I was drinking, to living in general, and a evil-theme would sit in and last for 30 second periods. I thought I had died while running out to the road and would be stuck with the Evil T, and N for eternity. The T.V. even had evil characters. I remember T playing the video game Tenchu - Heavens Wrath.. I thought to myself, 'So this is heavens wrath... man I'm in hell'
9:11 - I looked at the clock and stared for what seemed an hour(severe time-delay during this trip), and the time just stood at '9:11' - I freaked out and just wanted to see my mom ( I feel stupid saying this now, but at this time its all I could think of). After trying to dial the number several times on my cell-phone I got through, I told her I ate shrooms. within minutes(hours to me) she arrived to Ts house worried and terrified. To sum things up: I went to my house when the ambulance , fire department, and police arrived.
9:45 - While the ambulance was putting me on the stretcher I was still tripping and having evil thoughts(I kept yelling 'are they going to save me mom' lol). They tied me to the stretcher but for some reason I was thinking they were trying to seperate me from my mother and have me stay on the stretcher for a very long time. I continuosly removed the oxygen from my nose, thinking they were trying to strangle me, eventually I calmed down a bit. When the ambulance took off it was like it went off in the air, like we were flying.
10:00 - At the hospital they put me in this room with my parents, most of the staff workers(but not all) had evil like apperances to them. But the guy who was the one telling the information had a futuristic look to him, he had on a silver watch with a triangle in it, his facial expressions just seemed futurstic. But when my parents brought me a cup of black liquid that I had to drink I thought I was for sure dead and living a hell. I had to drink the stuff with a straw (I later found out it was called liquid charcoal, thick as mud and it had the nastiest taste).
11:00 - Well most of my trip had subsided besides having the thought that I was transformed into the future and living a futurstic life. (I kept hearing martian like voices and sentences coming from the office). Also while drinking the black liquid it made me gag and dry-heave about 3 times, and on the 3rd time I had the thought that all my sins were removed. At this time there were babies crying in the other rooms next to me (rebirth experience?). To make things short, they kept me over night til 3:00pm the next day, when my mom and dad came to pick me up. When entering the 80degree outdoors I felt peaceful with the universe, and was felt changed. There was alot I left out from the actual trip experience, I just put in the vital details.
-Note that I was a heavy ecstacy user, I did X roughly ~3-7 times a week and had my share of meth , coke, and other substances. Til' this day I havent touched a single drug (besides a little alcohol and nicotine). I will more than likeley start using drugs again but will not do as much, and will definateley make sure im in the right mood when taking powerful hallicinogens. So what happened to be a bad-trip as some may call, ended up being a Good beneficial trip.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


src/controller/email/email.controller.ts
email
the email controller is responsible for handling all kinds of requests concerning client email in the api.
operations include password reset functionality and confirmation
Methods |
|
| Async resetLink | ||||||||||||||||
resetLink(id: string, token: string, res: Response)
|
||||||||||||||||
Decorators :
@Get('link/:id/:token')
|
||||||||||||||||
|
Defined in src/controller/email/email.controller.ts:49
|
||||||||||||||||
|
After the user clicks the link sent to their email, user is validated then a page where they can input their new passord details is displayed
Parameters :
Returns :
{}
|
| Async sendEmail | ||||||||
sendEmail(mail: EmailResetDto)
|
||||||||
Decorators :
@Post()
|
||||||||
|
Defined in src/controller/email/email.controller.ts:29
|
||||||||
|
retrieves the email sent by the client, validates it then sends a password reset link to the client's mail
Parameters :
Returns :
{}
|
| Async updatePassword | ||||||||
updatePassword(body: PassResPageDto)
|
||||||||
Decorators :
@Post('reset')
|
||||||||
|
Defined in src/controller/email/email.controller.ts:69
|
||||||||
|
this endpoint is called immediately after the user submits his/her new passord details
Parameters :
Returns :
{}
|
import { Controller, Get, Post, Body, Res, NotFoundException, Param } from '@nestjs/common';
import { Response } from 'express';
import { EmailResetDto, PassResPageDto } from './../../dto/interface.dto';
import { EmailService } from './email.service';
import { ApiUseTags, ApiOkResponse, ApiForbiddenResponse, ApiNotFoundResponse, ApiCreatedResponse } from '@nestjs/swagger';
/**
* the email controller is responsible for handling all kinds of requests
* concerning client email in the api.
*
* operations include password reset functionality and confirmation
*/
@ApiUseTags('email')
@Controller('email')
export class EmailController {
constructor(
private readonly emailService: EmailService,
) { }
/**
* retrieves the email sent by the client, validates it
* then sends a password reset link to the client's mail
* @param mail user email
*/
@Post()
@ApiCreatedResponse({description: 'The resource has successfully been created'})
@ApiForbiddenResponse({description: 'forbidden'})
@ApiNotFoundResponse({description: 'not found'})
async sendEmail(@Body() mail: EmailResetDto) {
try {
return await this.emailService.sendPasswordResetEmail(mail.email);
} catch (error) {
throw new NotFoundException(error);
}
}
/**
* After the user clicks the link sent to their email,
* user is validated then a page where they can input their new
* passord details is displayed
* @param res response body
* @param id user id
* @param token user unique token for authentication
*/
@Get('link/:id/:token')
@ApiOkResponse({description: 'The resource has been succesfully returned'})
@ApiForbiddenResponse({description: 'forbidden'})
@ApiNotFoundResponse({description: 'not found'})
async resetLink(@Param('id') id: string, @Param('token') token: string, @Res() res: Response) {
try {
const authenticate = await this.emailService.isUserIdValid(id, token);
if (authenticate) {
return res.render('reset-password', {id, token});
}
} catch (error) {
return res.render('404');
}
}
/**
* this endpoint is called immediately after the user submits
* his/her new passord details
* @param body json data containing user id, token and new password
*/
@Post('reset')
@ApiCreatedResponse({description: 'The resource has successfully been created'})
@ApiForbiddenResponse({description: 'forbidden'})
@ApiNotFoundResponse({description: 'not found'})
async updatePassword(@Body() body: PassResPageDto) {
try {
return await this.emailService.receiveNewPassword(body);
} catch (error) {
throw new NotFoundException(error);
}
}
}


Tag: {{tag}}
Question: {{question}}
Hint: {{hint}}
Answer: {{answer}}
Did you get the answer correct?


Cheat sheet: Prince Andrew, Jeffrey Epstein, and that train wreck interview
by Alice Webb-LiddallPrince Andrew has spoken for the first time in public about his friendship with the late sex offender Jeffrey Epstein. What did he say to create such a media storm, and how did he get into this mess in the first place?
First thing’s first: who is Prince Andrew?
Prince Andrew, Duke of York, is the third child of Queen Elizabeth II and the Duke of Edinburgh. He’s the father of Princess Beatrice and Princess Eugenie, the ex-husband of Sarah Ferguson, and a friend of convicted sex offender Jeffrey Epstein, who killed himself in August in the New York cell where he was being held on new charges of sex trafficking.
So he’s not the one married to Camilla who’s in New Zealand currently?
No, that’s Prince Charles. Charles is the first in line to the throne and his list of scandals includes the time he said he wanted to be Camilla’s tampon and the very awkward first engagement interview when he proposed to Diana and wouldn’t confirm he was in love with her.
Glad that’s cleared up. So Prince Andrew was friends with a convicted sex offender?
Yep, and he made no secret of it. Prince Andrew and Epstein were friends since the 90s when they met through Epstein’s then-girlfriend, Ghislaine Maxwell. It was a rollercoaster relationship between the two men, with Prince Andrew claiming he ended the friendship in 2010 after Epstein got out of prison for soliciting sex from an underage girl.
So why is this all coming back into the spotlight now?
On Saturday night in the UK, BBC’s Newsnight programme aired an extended interview with Andrew, in which the prince aimed to address his friendship with Epstein and the allegations made against him. He was asked by journalist Emily Maitlis why he continued to meet up with Epstein after he got out of prison for sexual offending in 2010.
His response?
He suggested that “my judgement was probably coloured by my tendency to be too honourable.”
What else?
He was asked whether he remembered meeting Virginia Roberts Guiffre, the woman who says Epstein forced her to have sex with the prince. He “categorically” denied having sex with her, said he couldn’t recall even meeting her, and raised doubts about the authenticity of a photo in which he is pictured with his arm around her.
How did the interview go?
Reviews are bad.
How bad?
Very. Tabloid front pages called it a “car crash”. Doubts have been raised about Andrew’s accounts of many of the instances when he met Epstein. The prince reportedly regarded the interview as a “success”.
One of the biggest criticisms was that Andrew showed no apparent remorse for the women who have described their appalling treatment at the hands of Epstein. The Daily Mail reported the prince later told his friends that he “regretted” not expressing sympathy in the interview.
Did he seem to regret his friendship with Epstein?
At one point the prince actually said the opposite. He defended his friendship to Epstein, saying it “had some seriously beneficial outcomes in areas that have nothing to do with what I’m describing and what we’re talking about today”.
Did Prince Andrew know anything about the sex trafficking?
He says he didn’t. Prince Andrew actually said because of his patronage of the NSPCC’s “Full Stop” campaign (a charity preventing cruelty to children) he would have noticed if there was anything going on when he visited Epstein’s houses in the US.
“I was close up with what was going on at that time about getting rid of abuse to children… I knew what the things were to look for but I never saw them,” he explained.
Anything else?
Jaws dropped around the world at hearing the alibi Prince Andrew gave for one of the nights he was accused of taking part in sexual acts with then-17-year-old Roberts Guiffre: he was at a chain restaurant in a London commuter town.
“I’d taken Beatrice to a Pizza Express in Woking for a party at I suppose sort of four or five in the afternoon,” he explained. “Going to Pizza Express in Woking is an unusual thing for me to do, a very unusual thing for me to do. I’ve never been … I’ve only been to Woking a couple of times and I remember it weirdly distinctly. As soon as somebody reminded me of it, I went, ‘Oh yes, I remember that’.”
Extraordinary.
Not as extraordinary as his response to one of Roberts Guiffre’s recollections: that Prince Andrew was “sweating profusely” on the night they danced together in a nightclub before they allegedly had sex. Impossible, he said: he wasn’t able to produce sweat. According to the prince, a temporary medical condition brought on by an adrenaline overdose during the Falklands conflict meant he couldn’t perspire, so the allegation could not be true.
A medical expert told the UK Express that an overdose of adrenaline would likely make a person sweat more.
Join us and get a free copy
of the Spinoff’s first book!Find Out More
What has the reaction been to all of this?
The editor of the Royal Central website, Charlie Proctor, summed it up nicely when he tweeted: “I expected a train wreck. That was a plane crashing into an oil tanker, causing a tsunami, triggering a nuclear explosion-level bad.”
Read more:
Prince Andrew’s cock-up is colossal. All his family really do is image and spin


wb_sunny toggle dark mode help how to use
Visually compare two versions of a website with side-by-side matching, or overlay using opacity (onion), swipe and color blending modes.
diffsite makes it easy to compare two versions of a website. It uses two iframes, where the pages chosen via the first and second URL are loaded into, and allows to switch between comparison and overlay modes quickly to check for differences between both pages.
diffsite itself is able to work offline. Simply reload the page twice to store all diffsite assets, and you are good to go using the tool offline. This does not work for URLs loaded within the iframes, so make sure these are available offline, too (e.g. when testing locally on localhost/dev environment).
diffsite builds all comparison modes up on embedding the given URLs within iframes. This allows to include the full page provided within an adjustable view, and have all interactive elements in place to test differences in interactivity.
Unfortunately, this solution brings limitations in some situations and for some websites:
Basically, HTTP and HTTPS URLs are supported. You may also compare websites that are running locally, e.g. using a URL on localhost.
Between the URL inputs, there is a toggle labeled 'vs.' which can be used to detect AMP pages (or their canonical counterpart) when only one URL is provided. This fills in the second URL with the AMP/canonical counterpart and instantly loads it into the comparison view.
Whenever a valid URL is provided, the diffsite URL is updated, so you can share the diffsite tool URL with others and the URLs will be automatically prefilled and loaded into the comparison views.
Optionally, you can provide just one URL that either is or has an AMP page, and let diffsite auto-detect the AMP
or canonical page for you. To trigger auto-detection, add a parameter &getamp=1
to the diffsite
tool URL.
In viewport width dropdown, a device can be selected from which the screen width will be set for the iframes. A selection of reference devices used worldwide is provided to set the width of the iframes where the web pages are loaded into for comparison. The selection is based on to those devices available in Chrome DevTools by default.
Optionally, an above-the-fold line can be displayed as an indicator for the device's screen size (see advanced settings).
There are two modes available to display the two websites for comparison: side-by-side and overlay. The toggle allows quick switching between both modes, as both have their advantages for the comparison process.
Both pages are displayed next to each other in non-scrolling iframes. This way both pages can be scrolled simultaneously within the diffsite tool, and compared in a side-by-side view.
Since the URLs are embedded within iframes, both pages are fully interactive. For example, to compare an expandable mobile menu on both pages, expand the menu in side-by-side mode, and then switch to overlay mode to start the visual comparsion.
The overlay comparison stacks both iframes/pages and allows to choose between several overlay modes to support spotting differences between both pages.
In overlay comparison, all click/pointer events on the iframes are disabled, since the focus is on visual comparison, not interaction.
The overlay modes are only available when comparison mode is set to overlay.
In swipe mode, a vertical control handle (line) is shown that allows to set the portion displayed of each page by dragging it to left or right. The left side shows the part of the first URL, the right side shows the second URL. This allows to find differences by swiping the handle back and forth and observing visual differences.
Opacity is disabled for this overlay mode, as it does not make sense being applied when both pages are displayed side-by-side.
The blend overlay mode sets all pixels to black that are identical between the first and the second page, and highlights pixels that are different. This makes it easy to spot differences on pages that are almost identical.
By using the shift controls next to the comparison views, small pixel shifts can be easily detected in this mode – e.g. when elements are only a few pixels off.
Technically, it works by using a color filter on the second page in CSS (mix-blend-mode: difference). So there is unfortunately no way to display a percentage value that indicates how identical both pages are, using this implementation.
In onion mode, both pages are stacked and no filters or special controls are applied as in the other overlay modes. Use the opacity control to set transparency of the second page. In this mode, you can spot differences by playing around with the opacity and observing changes in the onion view.
Opacity controls the transparency for the second page in some of the overlay modes. It is automatically disabled when leaving overlay mode and restored with its previous value when re-entering a mode that supports opacity.
All properties set over advanced settings are stored locally in your browser, and will be restored when reloading diffsite.
This line shows the size of the device screen, as selected in viewport width dropdown. It refers to the term above-the-fold, which is used for the first visible part of newspapers when folded.
Be aware that this only refers to the full screen size of the device, and does not take other elements into account that may be on the screen: OS-specific controls, status bar and browser UI usually take up some of the space.
Using the shift controls on the left and right sides of the comparison area, you can move each of the pages up/down relative to the other page. This helps to compensate minimal pixel shifts in the layout, to be able to compare the rest of the page without being impacted by a pixel shift at the top of the page.
Using the arrows, the page can be shifted up and down in 1-pixel steps. The input inbetween the fields can be used to enter any positive or negative value to directly shift the page by that pixel distance.


|
Adolf HitlerRecorded in the annals of history are plenty of genocidal dictators with comparable blood on their hands (e.g. Stalin, Mao, Pol Pot) but only the name Adolf Hitler has become synonymous with Evil.Universally hated since World War II, Hitler is our best evidence for the infeasibility of time travel. The obvious killer app for a working time machine would be to murder this guy before he could set the Third Reich in motion. [Handy tip for would-be chronoassassins: Don't bother trying to infiltrate the fortified bunker; instead, plan on catching him asleep in that Viennese flophouse during the homeless years.] Hitler's most pernicious impact on everyday life (aside from providing an endless supply of source material for the History Channel) has been in the domain of rhetoric. His fiery brand of speechmaking has all but disappeared, but his name is invoked in arguments all the time as a form of litmus test. In any debate, Hitler's opinion on the subject is automatically the evil one, so it had better be contrary to the side you're arguing. Conversely, you can attack an opponent simply by declaring his position to be consistent with Hitler's. This tactic has long been a fixture of the Usenet newsgroups, which eventually prompted Godwin to formulate his famous Law of Nazi Analogies:
As an online discussion grows longer, the probability of a comparison involving Nazis or Hitler approaches one. In case you deem it necessary to play the Hitler card pre-emptively, here's a handy chart for quick reference:
But truth be told, he wasn't actually much of a vegetarian... or at least, not a principled one. Hitler promoted the myth that he was following a healthy regimen, insisting that the ideal man did not consume meat. But this was probably just a rationalization, as he himself could not digest meat without suffering from excruciating stomach cramps and embarrassing flatulence. Nevertheless Hitler's diet included the occasional serving of Bavarian sausage, liver dumpling, caviar, ham, or wild game. For that matter, he wasn't really religious either, except insofar as it provided a theological justification for his racial policies. That way, even the Fuhrer would have the option of claiming that he was only following orders. Hitler viewed Christianity first and foremost as a repudiation of Judaism. He even posited Aryan ancestry for Jesus Christ (aka "King of the Jews"). Although little Adolf had been raised Catholic and even served as an altar boy, later in his adult years he had no enthusiasm for the God stuff. He might even have been an atheist, depending which sources you believe. It probably would have amused him to know that he would later be inducted posthumously into the Mormon church in 1993. One subject for which he felt genuine zeal was the fight against cigarettes. Hitler was a diehard anti-smoking crusader. The Reichstadt imposed the world's most comprehensive suite of tobacco regulations, which included bans on cigarette smoking in workplaces, public buildings, and transit systems. In March 1942, Hitler went so far as to attribute his success to nonsmoking:
"I am convinced that if I had been a smoker, I never would have been able to bear the cares and anxieties which have been a burden to me for so long. Perhaps the German people owe its salvation to that fact." But his true passion, of course, had always been Jew-baiting. Hitler didn't invent anti-semitism, but it certainly never had a more ardent supporter. And no one else in modern history had ever found themselves in such an ideal position to pursue those beliefs. The Jews served as his inexhaustible scapegoat. They were the ultimate source of crime, disease, and immorality. Without having the international cabal of Jewry to blame for everything, Hitler's career would have been a total nonstarter. Not to mention his personal fortune; the success of Mein Kampf had made him a multimillionaire. The bestselling book was a relentless assault on the Jews, second only in ferocity to the Protocols of the Learned Elders of Zion (the authenticity of which Hitler wholeheartedly championed). In the same way that everything Hitler liked has now become tainted by his association, he felt the same way about Jews. Any policy, idea, or invention which had sprung forth from a Jewish mind was deemed to be part of a conspiracy to bolster Jewish totalitarianism. Thus, even the theory of relativity was dismissed as "Jewish physics" simply because it was the brainchild of somebody named Einstein. For his rigid inflexibility on issues of race, Adolf was the hero of antisemites the world over, including the United States.  It was the Grand Cross of the Order of the German Eagle, the highest honor the Reich could bestow on a noncitizen. Also in 1938, American hero Charles Lindbergh traveled to Germany to accept the Service Cross of the German Eagle, the second highest honor available to foreigners. By 1942 Hitler had become a regular methamphetamine user, receiving daily injections of Pervitid from his personal physician. This was in addition to narcotic pills for sleeping and anti-flatulence pills containing strychnine and belladonna. At one point, Hitler was taking as many as 28 separate medications. No one can be sure what effect the drug cocktail had on the man, whose increasingly erratic behavior was causing his staff serious concern. A competing theory was that the Fuhrer was suffering from syphilis. Hitler had a long if somewhat murky history of womanizing. It's unclear which women in his past he had actually fucked, and which were just close admirers.  Maybe. Film actress Renate Muller? Perhaps. Or how about his 19-year-old niece, Geli Raubal?  Then she would have to squat over his face where he could examine her at close range and this made him very excited. When the excitement reached its peak, he demanded that she urinate on him and that gave him real sexual pleasure. Regardless what had bent him originally, Hitler was definitely getting even weirder. He suffered from chronic insomnia and became twitchy. He was constantly irritable, and had a tendency to fly into rages. Hitler also had a habit of breaking things. There were stories of him tearing up curtains and throwing himself to the floor when he became apoplectic. These tales prompted subordinates to give him the nickname "Carpet Biter." In the end, of course, things did not go well for the Reich. The tide of the war turned, and Allied troops made their way inexorably toward Berlin. True to form, Hitler continued blaming his misfortunes on the Jews, right up to the very end. In his suicide memo, he even pointed the finger at them for causing the war:
"It was wanted and provoked solely by international statesmen either of Jewish origin or working for Jewish interests. [...] the sole responsibility for the massacre must be borne by the true culprits: the Jews." According to legend, during the fall of Berlin the Soviet army came upon a man's body having only one testicle. The Russians conducted an autopsy and somehow identified the monorchid corpse as Hitler's. They classified the report and secretly buried the body in a secluded bomb crater. Some years later, fearing that the site would be discovered, Hitler's body was exhumed and cremated. The Russians had been concerned that neo-Nazis would make a shrine out of Hitler's final resting place. They wanted to avoid an endless parade of Nazi pilgrims. Which is perfectly understandable when you look at something like Jim Morrison's crypt in Paris. Those fans have no sense of propriety. See also Francisco Franco, Hitler Diaries. |


Dashboard
Feedback
Event Manager
Event participants
New event
Edit event
Add event video
Check Code
Analytics
Map Analysis
My Account
Time Spent
Ad campaign
Log out


---
layout: post
title: preparatory sketch for atoleiros battle animatics
date: '2014-01-31T07:30:44+01:00'
categories:
- Sketches
- Atoleiros Battle
picture_url: https://film-Storyboards.tumblr.com/post/75147711199/preparatory-sketch-for-atoleiros-battle-animatics
---
Preparatory sketch for Atoleiros battle animatics.


Welcome!
Hello my name is Caroline!
Some more info.
I am a student at Girls Who Code
My Favorite Singers
Adele
Bruno Mars
Maroon 5


Unlock
Lock
Didn't submit anything yet!
Grade Weight:
{{assignment.type === 'assignment' ? 'Deadline:' : 'Date:'}}
Status:
{{assignment.note}}
{{answer.teacher_id.first_name}} {{answer.teacher_id.last_name}} Feedback
Your Grade:
Effect on GPA:


In the nightly version of Firefox OS (currently 1.4) support for capturing video stream using getUserMedia has landed. This article is about how to make a basic demo that does that and how you can debug your app.
The code for getting access to the phone camera is very straight forward, we'll get to that in a minute. First you should know that you cannot get access without providing an App Manifest file.
An App Manifest is a JSON file that tells the browser how to interact with the web application. An example can be found here in the MDN with more documentation, or (a more complex one) you can grab the one provided in the boilerplate Firefox OS app. This should include the following:
....
"video-capture": {
"description": "get video"
}
....
Now that we have that out of the way, the code that allows us to access the camera:
navigator.mozGetUserMedia({audio: true, video: true}, function(stream) {
video.src = window.URL.createObjectURL(stream);
}, function(err) {
console.log(err);
});
As you can see the code is very straight forward (notice the moz prefix) and this gets you very far.
We get a live stream into the browser from our camera! Awesome! Current build of Firefox OS 1.4 has a bug that makes the video stream to be rotated 90deg. We can easily fix that with CSS.
video {
-moz-transform:rotate(90deg);
transform:rotate(90deg);
}
Fixed! Great. As you can see I've also included a capture button that takes a snapshot of the current frame in a <canvas>
element. This also includes a fix to rotate the image. You can see the entire code in this gist .
Debugging your Firefox OS application is really easy once you have everything set up.
/etc/udev/rules.d/51-android.rules
with the following contentSUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="plugdev"
Where idVendor is a device specific code, 05c6
is the code for the Keon deviec
The App manager allows you to load applications in the browser and the send them to your device or to the Firefox OS simulator.
To access the App manager type in about:app-manager
or go to Tool > Web Developer > App Manager. Here you can load you application manifest which you could serve using a local server.
Submitting the manifest should make your application available in the app manager. Here you have an update button that allows you to submit changes to your device every time you update.
You should be able to connect to your device
There is also a debug button specific to each application that you can use to essentially have a Developer Tool instance connected to your phone which is an indispensable tool. There are some features missing, like the Network tab, but other than that Console, Style Editor, Debugger, Inspector are all available, even hovering over DOM elements will be highlighting on the device :)
Happy hacking! :)


Pasta Grannies
One
Two
Test link
These legenday human beings create homemade pasta in Torino, Italy from local organic ingredients. Buon Appetit!
Test
bold
text
Type Here


Prepare for the IELTS Academic tests in this comprehensive, self-paced course covering listening, speaking, reading and writing.
Current
Self-Paced
Launch your career in a high demand industry that projects 2 million new jobs annually by earning a Cybersecurity MicroMasters Credential from RIT.
Current
Understand how to describe the various approaches utilized for determining value at risk.
Starting Soon
Starts: April 18, 2017 - Self-Paced


Codaye Technologies is a software development company. We build websites and digital services for small companies.
At Codaye Technologies, we care about your business and we can create the online model best suited for your enterprise. Reach out to us and we will proffer ideas on ways to use the internet to benefit your business based on your budget.
Transparency: Our open policy ensures you know how much of your budget we are allocating to every resource utilized in your project
Custom Solutions: No two problems are exactly alike, therefore we see no reason why your problems should be solved in a fixed manner. At Codaye, we only provide solutions best suited to your particular needs and objectives.
Flexibility: Our model ensures enough flexibiliy for businesses to get up and running online. Speak with us let's agree on a payment model most convenient for both your business and ours.
Reliability: At Codaye Tech, our word is our bond. We deliver in a timely fashion, providing exactly what our clients request for. A testament to this is the fact that 70% of our clients were recommended by previous clients.


You're receiving this email because you subscribed to The Rainforest Site newsletter. We email our supporters multiple times a week with special offers and news in the world of good causes and Internet shopping.
One-click unsubscribe here or click here to manage your subscription(s).
To ensure delivery to your inbox, add<EMAIL_ADDRESS>to your address book/contacts.
The Rainforest Site, One Union Square, 600 University Street, Suite 1000, Seattle, WA 98101
1-888-355-4321 Customer Service Hours: M-F 7am-3pm PT |


VINYL PRINTING
Vinyl printing on garments is an excellent alternative to traditional
printing. This type of printing utilizes a computer and vinyl machine to
cut your design into vinyl, and is then heat pressed onto the garment.
Vinyl printing is best for rush jobs, same day printing, as well as
clients wanting an alternative look to the traditional ink style methods
of DTG and screen printing. New techniques involving gold and iridescent
foils, as well as the highly reflective 3M material, fall under this
category of printing.


Jenga Review
Questions
-
Where did final authority in all matters belong under the Articles of Confederation?
- The President
- Congress
- The Supreme Court
- The States
- None of the Above
-
Shay's Rebellion demonstrated that:
- Local militias could put down rebellions
- The new national government might interfere with the rights of citizens
- The Articles of Confederation were not working
- The army was too weak to fight
- All of the Above
-
All of the following were weaknesses under the Articles of Confederation EXCEPT:
- There was no way to settle disputes between states
- The national government could not enforce treaties with other countries
- The Congress could not tax to raise its own money
- The national government was infringing on the rights of the individual states
- A huge national debt and cash shortage had piled up during the war
-
Which of the following ideas is NOT associated with John Locke?
- All people have a natural right to life, liberty, and property
- Legislative, executive, and judicial powers should be divided among three branches of government
- The government has the duty to protect the natural rights of citizens
- Government is based on an agreement between the ruler and the ruled
-
Some people opposed the Constitution because they believed that it:
- Gave the President too much power
- Gave the states too much power
- Made the people pay taxes that were too high
- Did not provide adequate representation for the people
- All of the Above
-
The most serious criticism that the Anti-federalists directed against the Constitution was that it:
- Could not be amended
- Failed to give enough power to the president
- Gave too much power to the judicial branch
- Lacked a bill of rights
- Did away with the Articles of Confederation
-
Which of the following reasons was NOT a criticism that the Anti-federalists made of the Constitution?
- There was no bill of rights
- The Constitutional Convention had exceeded its authority by writing a totally new constitution instead of simply amending the Articles of Confederation
- The central government would be too strong at the expense of the states
- A small group could become too powerful and be worse than a monarch
- There wouldn't be a standing army
-
This group felt that a Bill of Rights was unnecessary because the national government was limited to the powers granted to it in the Constitution.
- Federalists
- Anti-federalists
- Both Federalists and Anti-federalists
-
Which of the following is the only power that the Constitution does NOT give to Congress?
- Borrow money
- Provide for the common defense
- Power to create a Social Security system
- Power to establish post offices
-
The amendment process is carried out by which of the following?
- Direct vote of the people
- Congress and the state legislatures
- Congress and the President
- The electoral college
- The Supreme Court


jump to content
jump to tools list
Sync Now
Register
Tools list begins here
Minimize tool navigation
Expand tool navigation
Content begins here


|
Bullet Collision Detection & Physics Library
|
Public Member Functions | |
| virtual void | processTriangle (btVector3 *triangle, int partId, int triangleIndex) |
| Public Member Functions inherited from btTriangleCallback | |
| virtual | ~btTriangleCallback () |
Public Attributes | |
| int | m_partIdA |
| int | m_triangleIndexA |
| btVector3 * | m_triangleVerticesA |
| btTriangleInfoMap * | m_triangleInfoMap |
Definition at line 49 of file btInternalEdgeUtility.cpp.
|
inlinevirtual |
skip degenerate triangles
skip degenerate triangles
degenerate case
degenerate case
Implements btTriangleCallback.
Definition at line 56 of file btInternalEdgeUtility.cpp.
| int btConnectivityProcessor::m_partIdA |
Definition at line 51 of file btInternalEdgeUtility.cpp.
| int btConnectivityProcessor::m_triangleIndexA |
Definition at line 52 of file btInternalEdgeUtility.cpp.
| btTriangleInfoMap* btConnectivityProcessor::m_triangleInfoMap |
Definition at line 54 of file btInternalEdgeUtility.cpp.
| btVector3* btConnectivityProcessor::m_triangleVerticesA |
Definition at line 53 of file btInternalEdgeUtility.cpp.


Manipulating GraphData¶
After constructing a GraphData instance and adding several nodes and edges to it, the next job is to attach some useful
information to it for further processing. In GraphData
, there are two types of information related to the nodes and
edges, namely features and attributes.
Features¶
Features are PyTorch tensors designated for each node or edge. To access features, users may call
GraphData.nodes[node_index].features
or GraphData.edges[index].features
.
These methods return the features of the specified nodes or edges in a dictionary representation, where the keys are the
names of the feature and the values are the corresponding tensors.
Alternatively, if the user wants to access features from the whole-graph level, the GraphData.node_features
and
GraphData.edge_features
interfaces do the exact job.
g = GraphData()
g.add_nodes(10)
# Note that the first dimension of features represent the number of instances(nodes/edges).
# Any manipulation to the features should keep the match between the number of instances and the dimension size
# An invalid example
g.node_features['node_feat'] = torch.randn((9, 10))
>>> raise SizeMisatchError
g.node_features['node_feat'] = torch.randn((10, 10))
g.node_features['zero'] = torch.zeros(10)
g.node_features['idx'] = torch.tensor(list(range(10)), dtype=torch.long)
g.node_features
>>> {'node_feat': tensor([[-2.2053, -0.9236, -0.4437, -0.7142, 1.5309, -1.5863, 0.6002, -0.6847,
1.3772, 0.1066],
[ 0.8875, 1.7674, -0.0354, -0.7681, -2.6256, -1.3399, -2.3798, -0.7418,
1.2901, 0.6641],
[-1.5530, 0.9147, 0.0618, -0.0879, 1.0005, 1.2638, -1.4481, 1.2975,
-0.0304, 0.8707],
[-0.3448, -0.7484, -1.0194, -0.5096, -0.2596, 0.1056, 1.1560, 0.3463,
-0.1986, 0.9243],
[-0.3555, -0.7062, -1.0459, 0.1305, -0.1338, 1.2952, 1.2923, -0.5740,
-0.5492, -0.2497],
[-0.7125, 1.2456, -0.2136, 0.8562, 1.8037, -0.0379, -1.6863, 1.2693,
-0.1980, -0.3153],
[ 0.4099, -0.8295, 0.6984, 0.4125, -0.8396, 1.8205, -1.1458, -0.0837,
-0.2388, 0.0552],
[-1.4068, -1.9334, -0.0367, -1.3297, 1.0705, -0.5606, -0.0458, 0.1358,
1.3042, -0.8282],
[ 0.7764, 0.1442, 1.6043, 0.1052, 1.4648, -2.1791, 0.6740, 0.2858,
0.0482, 0.9058],
[-1.5054, 0.8992, 0.0893, -1.2325, 0.8888, -1.2222, 2.0569, 0.0218,
1.5519, -0.8234]]),
'node_emb': None,
'zero': tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]),
'idx': tensor([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])}
Note that there are some reserved keys for features, which are initialized to be None
. In node features the reserved keys
are node_feat and node_emb. In edge features the reserved keys are edge_feat, edge_emb and edge_weight.
Users are encouraged to use these keys as common feature names.
This means that the feature dictionary of an empty graph will have these items with the corresponding values being None
.
Another thing to notice is that when adding new nodes or edges to a graph whose features are already set(the value is not None), zero padding will be performed on the newly added instances.
g.add_nodes(1)
g.node_features # Zero padding is performed
>>> {'node_feat': tensor([[-2.2053, -0.9236, -0.4437, -0.7142, 1.5309, -1.5863, 0.6002, -0.6847,
1.3772, 0.1066],
[ 0.8875, 1.7674, -0.0354, -0.7681, -2.6256, -1.3399, -2.3798, -0.7418,
1.2901, 0.6641],
[-1.5530, 0.9147, 0.0618, -0.0879, 1.0005, 1.2638, -1.4481, 1.2975,
-0.0304, 0.8707],
[-0.3448, -0.7484, -1.0194, -0.5096, -0.2596, 0.1056, 1.1560, 0.3463,
-0.1986, 0.9243],
[-0.3555, -0.7062, -1.0459, 0.1305, -0.1338, 1.2952, 1.2923, -0.5740,
-0.5492, -0.2497],
[-0.7125, 1.2456, -0.2136, 0.8562, 1.8037, -0.0379, -1.6863, 1.2693,
-0.1980, -0.3153],
[ 0.4099, -0.8295, 0.6984, 0.4125, -0.8396, 1.8205, -1.1458, -0.0837,
-0.2388, 0.0552],
[-1.4068, -1.9334, -0.0367, -1.3297, 1.0705, -0.5606, -0.0458, 0.1358,
1.3042, -0.8282],
[ 0.7764, 0.1442, 1.6043, 0.1052, 1.4648, -2.1791, 0.6740, 0.2858,
0.0482, 0.9058],
[-1.5054, 0.8992, 0.0893, -1.2325, 0.8888, -1.2222, 2.0569, 0.0218,
1.5519, -0.8234],
[ 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,
0.0000, 0.0000]]),
'node_emb': None,
'zero': tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]),
'idx': tensor([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0])}
Attributes¶
Another important attached information is attribute. Like features, attribute is related to each node/edge instance and is basically a list of dictionaries. The list index corresponds to the node/edge index and the dictionary at each position stands for the corresponding attributes of that instance. Essentially, attribute is designed to make up for the limit of features in storing arbitrary objects. The reserved keys are node_attr for node attributes and edge_attr for edge attributes.
g = GraphData()
g.add_nodes(2) # Add 2 nodes to an empty graph
g.node_attributes
>>> [{'node_attr': None}, {'node_attr': None}]
g.node_attributes[1]['node_attr'] = 'hello'
g.node_attributes
>>> [{'node_attr': None}, {'node_attr': 'hello'}]
Features vs. Attributes¶
To make it clear, in this subsection we compare the differences between features and attributes in order for users to better utilize them.
Types of storage
features
store only the numerical feature objects. In current version these data are PyTorch tensors. The shape of these
tensor data should be consistent with the number of nodes/edges in the graph. Specifically, the first dimension
of the tensor data corresponds to the number of instances. For example, in a graph with 10 nodes and 20 edges, the shape
of any node feature tensor should be [10, *] and [20, *] for any edge feature.
On the other hand, attributes
store arbitrary type of data. The data can be of any type and do not necessarily need
to have a shape
.
Order of access
Both features
and attributes
have two levels of keys: names and indices. features
are implemented as a
dictionary where the keys are strings and values are tensors. Therefore, the first level of key is the feature names.
In this way, the second level of keys are just direct access to the corresponding PyTorch tensors.
On the other hand, attributes
are implemented as a list of dictionaries, where the list indices are the node indices.
Therefore, when accessing attributes, users should use the index first.


Simple, lightweight, efficient cache for large numbers of keys which expire on a uniform TTL but may be renewed frequently. This cache type uses a double-linked-list structure. A single timer is used and no events are provided.
Simple, lightweight, efficient cache for large numbers of keys which expire on a uniform TTL but may be renewed frequently. This cache type uses a double-linked-list structure. A single timer is used and no events are provided.


It was a good excuse to get to know git’s innards a bit better, as well as work on something that, while somewhat useless, is technically functional and interesting.
Anyone with a casual knowledge of git shouldn’t get too lost and hopefully learns something. Ambitious beginners are more than welcome, and tweet me if something comes up that you think could make it better :)
mkdir git_exploration
cd git_exploration
git init
This gets us a git repo created. Let’s check out what we have:
ls -a
. .. .git
And if we check out the .git
subdirectory in our editor:
$ tree .git
.git
├── branches
├── config
├── description
├── HEAD
├── hooks
│ ├── applypatch-msg.sample
│ ├── commit-msg.sample
│ ├── post-update.sample
│ ├── pre-applypatch.sample
│ ├── pre-commit.sample
│ ├── prepare-commit-msg.sample
│ ├── pre-push.sample
│ ├── pre-rebase.sample
│ └── update.sample
├── info
│ └── exclude
├── objects
│ ├── info
│ └── pack
└── refs
├── heads
└── tags
9 directories, 13 files
A note, you may need to install tree depending on your OS. On Ubuntu, I used
sudo apt-get install tree
I imagine it is about the same on mac with brew
. I Have no idea on Windows as I barely know how to list
a directory in Powershell (sorry).
Okay, so this doesn’t look too crazy. Let’s open up some of the stuff we have on initialization in here.
.git/info/exclude
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
Okay, so it appears that this opens up with the command that the system would use to govern this
behaviour. Knowing a bit about git, one can reasonably infer that this is going to work in hijinks
with the .gitignore
file that one can use to ignore certain files.
.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
It would appear this is just some general configuration for a boilerplate initialized repo.
.git/description
Unnamed repository; edit this file 'description' to name the repository.
Here it seems we can name our little project
.git/refs/HEAD
ref: refs/heads/master
This seems to be referencing the current HEAD
.
HEAD is a reference to the last commit in the current checked out branch.
echo "# Git Exploration" > README.md
git add README.md
git commit -m 'initial commit'
Once we do this, we can check out a new directory structure:
$ tree .git
.git
├── branches
├── COMMIT_EDITMSG
├── config
├── description
├── HEAD
├── hooks
│ ├── applypatch-msg.sample
│ ├── commit-msg.sample
│ ├── post-update.sample
│ ├── pre-applypatch.sample
│ ├── pre-commit.sample
│ ├── prepare-commit-msg.sample
│ ├── pre-push.sample
│ ├── pre-rebase.sample
│ └── update.sample
├── index
├── info
│ └── exclude
├── logs
│ ├── HEAD
│ └── refs
│ └── heads
│ └── master
├── objects
│ ├── 1b
│ │ └── f567a9cee63cd3036628c1519b818461905b27
│ ├── 9d
│ │ └── aeafb9864cf43055ae93beb0afd6c7d144bfa4
│ ├── c1
│ │ └── 2d7c0ed49ad9c7aa938743ba6fdee54b6b7fe1
│ ├── info
│ └── pack
└── refs
├── heads
│ └── master
└── tags
15 directories, 21 files
It appears we have some simple additions with adding one file. To start, we have expanded our
info directory to now include a logs
directory. We also have several subdirectories inside of our
objects
directory now, each containing a hash. refs subdirectory heads
now includes a
master
file, and we also have added COMMIT_EDITMSG
, and index at the root level of .git
.
The three hashes in our objects
directory represent 3 data structures git utilizes.  We will go into these more in-depth later.
If we examine COMMIT_EDITMSG
we see:
initial commit
Logging our commit message.
Let’s create a new branch to further expand this interesting .git
directory.
git checkout -b my_feature_branch
What this does is use the git checkout
command and the -b
flag to create and checkout a new branch
named whatever follows -b
. We have created a branch called my_feature_branch
. The reason I have
called it a feature branch specifically is because this is a common flow for managing an application’s
development with multiple authors. Let’s see what changed:
$ tree .git
.git
├── branches
├── COMMIT_EDITMSG
├── config
├── description
├── HEAD
├── hooks
│ ├── applypatch-msg.sample
│ ├── commit-msg.sample
│ ├── post-update.sample
│ ├── pre-applypatch.sample
│ ├── pre-commit.sample
│ ├── prepare-commit-msg.sample
│ ├── pre-push.sample
│ ├── pre-rebase.sample
│ └── update.sample
├── index
├── info
│ └── exclude
├── logs
│ ├── HEAD
│ └── refs
│ └── heads
│ ├── master
│ └── my_feature_branch
├── objects
│ ├── 1b
│ │ └── f567a9cee63cd3036628c1519b818461905b27
│ ├── 9d
│ │ └── aeafb9864cf43055ae93beb0afd6c7d144bfa4
│ ├── c1
│ │ └── 2d7c0ed49ad9c7aa938743ba6fdee54b6b7fe1
│ ├── info
│ └── pack
└── refs
├── heads
│ ├── master
│ └── my_feature_branch
└── tags
15 directories, 23 files
Now, if you look at .git/branches/refs/heads/
we can see we have added my_feature_branch
. If we
look at our HEAD
files, we will see an addition to it as well.
.git/logs/refs/HEAD
...<PHONE_NUMBER> -0400 commit (initial): initial commit
...<PHONE_NUMBER> -0400 checkout: moving from master to my_feature_branch
.git/refs/HEAD
ref: refs/heads/my_feature_branch
It has logged our checkout and pointed us at the new branch. Also it is worth noting we have not created
any new objects. This is one of the finer pieces of git, it is differentials rather than copies and
copies as one would have saving my_documentv1
, my_documentv2
, my_documentvN
etc.
Let’s add another commit by creating a directory in here and logging its boilerplate.
mkdir test && echo "test" > test/file.txt
cd test
git status
# => ./
Okay, lets add this project and commit. If you don’t have Volt installed locally, feel free to substitute it with anything from rails to django to meteor. It doesn’t really matter for our studies here.
cd ..
git add test
git commit -m 'add file + dir'
Now, let us further check out our changes in the git file tree:
.git
├── branches
├── COMMIT_EDITMSG
├── config
├── description
├── HEAD
├── hooks
│ ├── applypatch-msg.sample
│ ├── commit-msg.sample
│ ├── post-update.sample
│ ├── pre-applypatch.sample
│ ├── pre-commit.sample
│ ├── prepare-commit-msg.sample
│ ├── pre-push.sample
│ ├── pre-rebase.sample
│ └── update.sample
├── index
├── info
│ └── exclude
├── logs
│ ├── HEAD
│ └── refs
│ └── heads
│ ├── master
│ └── my_feature_branch
├── objects
│ ├── 1b
│ │ └── f567a9cee63cd3036628c1519b818461905b27
│ ├── 2b
│ │ └── 297e643c551e76cfa1f93810c50811382f9117
│ ├── 5e
│ │ └── c1f4ac6015a50b5d8462582d7ae50d7029d012
│ ├── 70
│ │ └── cc10cfcc770f6b0ea11cdd9a876ee1a3184d77
│ ├── 9d
│ │ └── aeafb9864cf43055ae93beb0afd6c7d144bfa4
│ ├── c1
│ │ └── 2d7c0ed49ad9c7aa938743ba6fdee54b6b7fe1
│ ├── info
│ └── pack
└── refs
├── heads
│ ├── master
│ └── my_feature_branch
└── tags
18 directories, 26 files
Now, if we look at COMMIT_EDITMSG
add file + dir
And again it is our latest message. The other major change is we have a ton of new objects. Just to see what happens, let’s checkout master and see if anything changes:
git checkout master
and we get the same tree, but we can check out our HEAD item in the .git
directory.
So we have the same thing, but our HEAD
file reads:
ref: refs/heads/master
So we can now see this is our constant anchor as we navigate changes.
$ find .git/objects
.git/objects/pack
.git/objects/info
.git/objects/b7
.git/objects/b7/37ff03e6f22c28bc4786f4b11925f2d864e00
...
.git/objects/4c
.git/objects/4c/2be36223ca4d07cbd7ce8c28419ba1c4144334
Here we see a list of a butt ton of what looks like SHA-1 hashes. So what is git doing with all of these?
Let’s create a clean repository and proceed to start an empty git repo in it.
cd .. && mkdir git_testing
Initialize a repository
git init
And now, let’s try creating one of these hash objects. We do this with the git command hash-object
.
If we simply use some bash, we can do this without even needing a file. By doing this we will pipe
an echoed statement into the hash-object command through stdin and receive our hash in stdout.
echo 'test content' | git hash-object -w --stdin
d670460b4b4aece5915caf5c68d12f560a9fe3e4
So, it took the string ‘test content’ and hashed it then spat it back out in SHA-1 form. Cool.
We should examine this further.
echo "test" > test.txt
git hash-object -w test.txt
vim test.txt
test
test 2
If we save this change and run the command again:
git hash-object -w test.txt
6375a2690c50e28c8c351fc552e2fd8a24b01031
And if we check out our objects directory we can now see what git has done:
bobby@bobdawg-devbox:~/code/git_test/test$ find .git/objects/ -type f
.git/objects/9d/aeafb9864cf43055ae93beb0afd6c7d144bfa4
.git/objects/63/75a2690c50e28c8c351fc552e2fd8a24b01031
It has a hash for each of our objects saved. Woo! But wait. We haven’t committed anything. How is git tracking all this?
Well it turns out git just keeps some headers with these SHA-1’s, and does a bunch of cool stuff so it only has to track changes. Not entire new versions of each document. So each of these objects simply represents a given state of some blob of our data.’
If we dive in to do the reverse of this, we can look up our input using git’s cat-file
command, which
intakes a hash.
git cat-file 6375a2690c50e28c8c351fc552e2fd8a24b01031
test
test 2
Now, if we make another change on this, we will be able to see the new version.
vim test.txt
test "one"
If we delete everything and replace it with this line, the do our typical:
git hash-object -w test.txt
We get a new hash, which when called with cat-file
will output a the new value,
while still keeping our old object in history.
What this really is at it’s core is a key:value store. Using this, we can leverage a very simple database that only relies on single key/value types (symbol, string) to store any data we need to and look it up. So, let’s move on.
In the broadest of terms, git is a directed acyclic graph. This sounds quite fancy and/or scary depending on how hard in the paint you go with mathematica, but it truly isn’t that crazy. Let’s ignore Wikipedia’s terse entry, and instead break it down on our own.
In its most basic state, git functions to make one of these graphs connecting a series of objects. These objects also have a handful of types.
A blob
is a blob of bytes. It usually is a file, but can also be a symlink or a myriad of other things.
It is all simply semantics as long as there is a pointer to the blob
.
Directories are represented by a tree
object. They refer to blobs
and other trees
. When one of these nodes
(a tree
or a blob
, in this case) points to another in the graph, it depends on that node. It is a connection
that cannot be broken. You can garbage collect, filesystem check, and a myriad of other functions
but we do not need to truly know more other than that without a referent of dependence, a node
is essentially useless, as it is disconnected.
A commit
refers to a tree that represents the state of a group of blobs
’ state at the time of that given
commit. It refers to a range X
of other commits that are its parents. More than one parent means a merge,
no parent means an initial commit, and a single just means its a regular old commit. As we saw earlier,
the body of a commit is its message.
Refs have two functions: storing HEAD
s, and branches
. They are essentially notes left on a given
node. These notes can be moved around freely and arent stored in history, and arent transferred
between repositories. They are simply a means to namespace ‘I am working here’.
As you can see, these nodes form a tree
of functioning between master and a remote with a few merges
thrown in (any of the nodes with 2 parents).
Since the cat-file
and hash_object
pattern functions simply as a key:value store for git, we
can utilize this to our advantage. Normal storing large strings in-memory in Ruby can get quite
taxing, but if we simply store the string of the SHA-1 hash to a given key, we can greatly reduce
the memory footprint of our master dictionary and allow it to grow far larger in size (theoretically).
So, let’s code up a pseudo-class for this and fill it in after we get that far.
vim git_database.rb
module GitDatabase
class Database
def initialize
# set initliazers and master dictionary
end
def set
# set a given key to a value
end
def get
# get a given key's value
end
def hash_object
# hash a given input that is coerced to a string
end
def cat_file
# cat out a given file based on SHA-1 hash
end
end
end
We can now tackle this piece by piece.
vim git_database.rb
...
class Database
attr_accessor :items
def initialize
@items = {}
`git init`
end
...
Simple enough. We ensure we have a git repository initialized, and we ensure that we setup our master dictionary.
vim git_database.rb
...
def hash_object(string)
# What do we do?
end
...
Well, to start, lets fire up irb and see what we can do calling git from Ruby.
irb
irb(main):001:0> string = "test"
=> "test"
irb(main):002:0> `echo #{string}`
=> "test\n"
irb(main):003:0> `echo #{string} | git hash-object -w --stdin`
=> "9daeafb9864cf43055ae93beb0afd6c7d144bfa4\n"
irb(main):004:0> `echo #{string} | git hash-object -w --stdin`.strip!
=> "9daeafb9864cf43055ae93beb0afd6c7d144bfa4"
So, it appears we can essentially call exactly what we were prior. We can now reasonable change the function to be:
...
def hash_object(data)
`echo #{data} | git hash-object -w --stdin`.strip!
end
...
And this will get that blob hashed up and stored for us. Now, notice we get the exact hash here, but if we do a
find .git/objects -type f
and look at a sampling of what we get:
.git/objects/e4/ea753518a47496350473b8eb0972ad2985d964
You might notice that objects has subdirectories of seemingly random 2 letter combos. There are the first 2 characters of the hash, but git does this to save on overhead. So, if looking in the git directory for hashes you must account for the parent directory of the longer string to get the entire SHA-1.
Since the prior method returns us a hash directly, we can use the same command as earlier and interpolate.
...
def cat_file(hash)
`git cat-file -p #{hash}`
end
...
And now we just need a way to map keys to the hashes we have saved.
...
def set
# get key, data
# hash data
# save key to SHA-1 hash in @items
end
...
This is a reasonable fleshed out idea of a simple set implementation. So, first we need to take in a key:
...
def set(key, value)
hash = hash_object(value.to_s)
@items[key] = value
end
...
And now, we can move onto a get implementation
To get, we have a little more to do. We will have a key, and that gets us an SHA-1 hash. However,
we still need to decrypt it using our cat_file
function. So, if we pseudocode this out:
...
def get
# find hash by key
# cat-file hash
end
...
So, with our functions already set up we can simply go in and do this:
...
def get(key)
<EMAIL_ADDRESS>end
...
And now, we have a finished class that can function as a reasonable minimal database. Consider it an equally ghetto but more interesting version of the good ‘ole CSV store.
Currently we are only returning the latest version of a given item. However, we have already stored it at every state it hash ever been hashed. So, if we were to add in some functionality for grabbing versions, it would be quite simple.
module GitDatabase
class Database
attr_accessor :items
def initialize
`git init`
@items = {}
end
def set(key, value)
unless key in @items.keys
@items[key] = [hash_object(value)]
else
@items[key] << value
end
end
def get(key)
<EMAIL_ADDRESS>end
def get_version(key, version)
# 0 = latest, numbers = older
@items[key][version]
end
def versions(key)
@items[key].count
end
private
def hash_object(data)
`echo #{data.to_s} | git hash-object -w --stdin`.strip!
end
def cat_file(hash)
`git cat-file -p #{hash}`
end
end
end
Now, we can do something like:
db = GitDatabase::Database.new
db.set("Apples", "12")
db.get("Apples")
# => "12"
db.set("Apples", "10")
db.get_version("Apples", 0)
# => "12"
db.get("Apples")
# => "10"
Abd to use this. We can make a very simple sinatra API to take input remotely:
... # below the class
require 'sinatra'
require 'json'
DB = GitDatabase::Database.new
post '/set' do
DB.set(params['key'], params['value']
rescue
{ error: 'please send key and value parameters' }.to_json
end
end
get '/get/:key' do
{ result: DB.get(params['key'] }.to_json
end
This is a very simple wrapper, but if gives the general idea of where you could take this with a toy application.


Sign Certificate
Create CA Chain
Revoke CA
The certificate will be signed with CA Free Testing CA Group
Create CA


Cheiren:
Us beacon watchers have been observing the Ragna Orcs for quite some time now. We've done all we can since the sparks of rebellion first erupted from their lands, but our efforts to control them have been fruitless so far.
"Please tell me what happened."


This template is a basic example of an PhoneGap App on webOS using the jQTouch Framework. It can easily be modified, extended, and used with another Framework (e.g. jQuery Mobile).
Camera.getPicture() exampleBecause this is a Scene from webOS's point of view, scolling actually works. To let you test this, this text has been made extra long and boring. But nothing is to much to bring pleasure to you, dear user.
So, hopefully this example can help you to get started on your mobile building quest! Have fun with this, and create many exciting Apps to make this beautiful platform really shine!