text:
---
title: Structure
weight: 5
---

It helps to understand the folder structure so you know where each of the
components lives.

## Blueprint Structure

The project is organized into the following folders:

```text
asset/
|----dynamic/    - private assets like SASS files, single JavaScript files, and logo.png for favicon generation
|----static/     - public assets like CSS, JavaScript, and favicon.ico for Android, Apple, etc
controller/	     - packages with routes and application logic
filestorage/     - files uploaded from an HTML form
generate/	       - template pairs (.gen and .json) for generating code using jay
lib/             - packages you'll build that are used by the application (recommended to build with minimum dependencies)
|----boot/       - package for registering services and setting up all the components
|----env/        - package that holds the structure for the application settings
|----flight/     - package with a context that can be used by controllers to access application settings
middleware/      - packages that return a http.Handler to wrap around routes for ACL, request logging, etc
migration/       - migration database files
|----mysql/      - MySQL files for migrating database up and down
model/		       - packages with database queries and structs matching tables
view/            - HTML templates parsed using the Go html/template package
viewfunc/        - packages that return a template.FuncMap for use in views
viewmodify/      - packages that modify view prior to rendering to add varibles like CSRF token and auth level
```

The following files exist at the project root:

```text
blueprint.go     - entrypoint for the application
env.json.example - application config template for variables
gulpfile.js      - Gulp configuration that compiles SASS, concatenates JavaScript, etc
package.json     - npm configuration that loads Gulp, Boostrap, Underscore.js, etc
```

## Blueprint External Go Packages

There are a few external packages used in Blueprint:

```text
github.com/gorilla/context				- registry for global request variables
github.com/gorilla/csrf                 - CSRF protection for gorilla sessions
github.com/gorilla/sessions				- cookie and filesystem sessions
github.com/go-sql-driver/mysql 			- MySQL driver
github.com/husobee/vestigo              - HTTP router with wildcards
github.com/jmoiron/sqlx 				- MySQL general purpose extensions
github.com/justinas/alice				- middleware chaining
golang.org/x/crypto/bcrypt 				- password hashing algorithm
```

## Jay Structure

The project is simply a command-line interface for packages in the Core library
https://github.com/blue-jay/core. The packages that Jay uses from the Core
library are:

```text
env/       - package that creates and updates the env.json config file
find/      - package that finds case-sensitive matched text in files
generate/  - package that generates code from template pairs
migrate/   - package that handles the database migrations
replace/   - package that replaces case-sensitive matched text in files
```

The following file exists at the project root of Jay:

```text
jay.go     - entrypoint for the application
```

## Jay External Go Packages

There is only one external packages used in Jay (not including the Core
library):

```text
gopkg.in/alecthomas/kingpin.v2    - command-line and flag parser
```

## Core Structure

The Core project contains many packages that are all divided into individual
folders. Each is well documented so the
[GoDoc](https://godoc.org/github.com/blue-jay/core) page should provide enough
information on each one.


text:
---
layout: api
hero-message: "Guide #1: Tele-Operated Code"
hero-button-url: /software
hero-button: Return to Software Hub
---

# 1. The `setup`/`loop` paradigm and tele-operated code
In this tutorial, we'll be going over the basics of coding for PiE, and write some sample tele-operated code.

NOTE: This tutorial is designed around a game different from this year's PiE game, and for a robot construction that may be different from yours. It will explain the tools available for you to program your robot -- it is not a library of code you can copy-paste into your robot and run without modifications.

A example game: Tug-of-War

As a running example throughout the tutorials, we'll be showing how to program a robot to play tug-of-war.

Our robot will have four wheels, with one motor on each side. A rope will be tied to the robot frame, and the object of the game is to pull the opponent's robot onto your side of the field.

In this tutorial, we will explain how to drive backwards when commanded to with an XBox controller.

## Minimal code

We're going to assume you can open up Dawn and connect it to your robot. (For info on how to do that, see the Quickstart guide.)

You may already have some code in Dawn. We recommend you save that code and open up a new file.

Delete everything and start with the minimal code you need to have a working robot:

~~~python
def autonomous_setup():
    pass

def autonomous_main():
    pass

def teleop_setup():
    pass

def teleop_main():
    pass
~~~

This defines four functions that will be run at various points throughout a match: `autonomous_setup`, `autonomous_main`, `teleop_setup`, `teleop_main`.

Currently, the contents of these functions are just `pass`. `pass` is an instruction that does nothing -- so with this code, your robot will never move!

## Progress of a match

A match consists of an autonomous and a tele-operated phase (see the game rules for more details). Your code will be run in the following order:

1. When autonomous mode starts, your entire file will be loaded.
2. The code in `autonomous_setup` will then be run once
3. After that, the code in `autonomous_main` will be run at a rate of 20 times a second
4. Once the autonomous period ends, your code will be shut down. (There may be a pause as referees tally the score.)
5. When tele-operated mode starts, your entire file will be loaded once again.
6. The code in `teleop_setup` will then be run once
7. After that, the code in `teleop_main` will be run at a rate of 20 times a second
8. All code will stop running when the match eds.

## Testing code with Dawn

For this tutorial, we'll be focusing only on the tele-operated code.

Change the tele-op code so that it looks like this:

~~~python
def teleop_setup():
    print("Tele-operated mode has started!")

def teleop_main():
    print("Tele-operated mode is ongoing")
~~~

Your entire file should now read like this: (from now on we'll only be showing the section of the file that need to be changed.)

~~~python
def autonomous_setup():
    pass

def autonomous_main():
    pass

def teleop_setup():
    print("Tele-operated mode has started!")

def teleop_main():
    print("Tele-operated mode is ongoing")
~~~

Now use Dawn to upload and run your code. (Remember to upload before pressing play to run the code!)

When you toggle the console, you should see the following:

## Driving motors

Next, we need to write the code for driving the robot.

The kit uses unique numerical IDs to refer to all peripherals (motors, sensors, etc.) attached to you robot. We will create variables to hold the IDs for the left and right motor.

Add the following code to the top of the file, substituting your IDs:

~~~python
left_motor = "YOUR MOTOR ID HERE"
right_motor = "YOUR MOTOR ID HERE"
~~~

Afterwards, Dawn should look like the following:

You will notice that in the sidebar, each Yogi Bear motor controller has several values: `duty_cycle`, `enc_pos`, `enc_vel`. These are known as "parameters" associated with the device. To make the motor drive, we will need to set the `duty_cycle` parameter.

Let's try driving the robot backwards:

~~~python
def teleop_main():
    Robot.set_value(left_motor, "duty_cycle", -1.0)
    Robot.set_value(right_motor, "duty_cycle", -1.0)
~~~

Note that you might need to flip the negative sign to get the robot to drive backwards (the direction the motors need to spin will depend on how you built and wired your robot.)

Try running this code in Dawn until the robot is able to drive backwards.

## Controllable Driving

Now let's actually make the driving controllable. The goal is to drive backwards when you pull the left thumb-stick on your controller backwards.

~~~python
def teleop_main():
    if Gamepad.get_value("joystick_right_y") > 0.5:
        Robot.set_value(left_motor, "duty_cycle", -1.0)
        Robot.set_value(right_motor, "duty_cycle", -1.0)
    else:
        Robot.set_value(left_motor, "duty_cycle", 0)
        Robot.set_value(right_motor, "duty_cycle", 0)
~~~

`setup`, sensors, and remembering state

So far, we have not used `teleop_setup` in any way.

The `setup` functions exist to allow setting some values when a robot first starts running. As an example, let's assume that we have a limit switch mounted on the robot. Depending on whether the limit switch is pressed as the tele-operated period starts, we would like our robot to drive at different speeds.

Here is code that can accomplish this:

~~~python
limit_switch = "YOUR SENSOR ID HERE"

def teleop_setup():
    if Robot.get_value(limit_switch, "sensor0"):
        Robot.speed = 1.0
    else:
        Robot.speed = 0.5

def teleop_main():
    if Gamepad.get_value("joystick_right_y") > 0.5:
        Robot.set_value(left_motor, "duty_cycle", -Robot.speed)
        Robot.set_value(right_motor, "duty_cycle", -Robot.speed)
    else:
        Robot.set_value(left_motor, "duty_cycle", 0)
        Robot.set_value(right_motor, "duty_cycle", 0)
~~~

Note that we are assigning to a new `Robot.speed` variable. Variables created inside a function are cleared when the function finishes running -- therefore, we use the `Robot` object to ensure that our values are retained across all calls of both `teleop_setup` and `teleop_main`.

repository: pioneers/website

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

license_type: permissive

repo_name: pioneers/website


text:
---
layout: post
title: "OsHXK7"
description: ""
category: genes
tags: [sugar, growth, development, plant growth]
---

* **Information**
    + Symbol: OsHXK7
    + MSU: [LOC_Os05g09500](http://rice.uga.edu/cgi-bin/ORF_infopage.cgi?orf=LOC_Os05g09500)
    + RAPdb: [Os05g0187100](https://rapdb.dna.affrc.go.jp/locus/?name=Os05g0187100)

* **Publication**
    + [Role of rice cytosolic hexokinase OsHXK7 in sugar signaling and metabolism.](http://www.ncbi.nlm.nih.gov/pubmed?term=Role of rice cytosolic hexokinase OsHXK7 in sugar signaling and metabolism.%5BTitle%5D), 2015, J Integr Plant Biol.
    + [Conformational Characteristics of Rice Hexokinase OsHXK7 as a Moonlighting Protein involved in Sugar Signalling and Metabolism.](http://www.ncbi.nlm.nih.gov/pubmed?term=Conformational Characteristics of Rice Hexokinase OsHXK7 as a Moonlighting Protein involved in Sugar Signalling and Metabolism.%5BTitle%5D), 2017, Protein J.

* **Genbank accession number**

* **Key message**
    + Role of rice cytosolic hexokinase OsHXK7 in sugar signaling and metabolism.
    + This result provides compelling evidence that OsHXK7 functions in sugar signaling via a glycolysis-dependent manner under normal conditions, but its signaling role is suppressed when O2 is deficient
    + This result suggests the distinct role that OsHXK7 plays in sugar metabolism and efficient germination by enforcing glycolysis-mediated fermentation in O2 -deficient rice
    + These results suggest that OsHXK7 binding to Glc leads to a conformational change, that is likely essential for the function of OsHXK7 in Glc signalling and metabolism during plant growth and development
    + Conformational Characteristics of Rice Hexokinase OsHXK7 as a Moonlighting Protein involved in Sugar Signalling and Metabolism.

* **Connection**
    + __alphaAmy3~OsAmy3D~RAmy3D~OsRAM3D__, __OsHXK7__, [Role of rice cytosolic hexokinase OsHXK7 in sugar signaling and metabolism.](http://www.ncbi.nlm.nih.gov/pubmed?term=Role of rice cytosolic hexokinase OsHXK7 in sugar signaling and metabolism.%5BTitle%5D), According to transient expression assays that used the promoter:luciferase fusion construct, OsHXK7 enhanced the glucose (Glc)-dependent repression of a rice α-amylase gene (RAmy3D) in the mesophyll protoplasts of maize, but its catalytically inactive mutant alleles did not

[//]: # * **Key figures**

license: MIT


text:
importance: 4

---

# Which day of month was many days ago?

Create a function `getDateAgo(date, days)` to return the day of month `days` ago from the `date`.

For instance, if today is 20th, then `getDateAgo(new Date(), 1)` should be 19th and `getDateAgo(new Date(), 2)` should be 18th.

Should work reliably for `days=365` or more:

```js
let date = new Date(2015, 0, 2);

alert( getDateAgo(date, 1) ); // 1, (1 Jan 2015)
alert( getDateAgo(date, 2) ); // 31, (31 Dec 2014)
alert( getDateAgo(date, 365) ); // 2, (2 Jan 2014)
```

P.S. The function should not modify the given `date`.

gha_license_id: MIT


text:
# [WinHelloUnlock v1.6.1](https://github.com/Angelelz/WinHelloUnlock/releases/tag/v1.6.1)

- Fix [#57](https://github.com/Angelelz/WinHelloUnlock/issues/57). Added build instructions to readme.
- Fix [#58](https://github.com/Angelelz/WinHelloUnlock/issues/58). Disable prompt to unlock a database already opened by KeeAutoExec.
- Upgraded base KeePass version to 2.50
- Replaced relative path for absolute for the Windows.winmd reference.

repository: Angelelz/WinHelloUnlock

gha_language: C#

repo_name: Angelelz/WinHelloUnlock


text:
### sc-req-resp-lib - Just a little project to parse queries

So, just this little project aims to help you to process any kind of query. The main feature here is to identify some know patterns, make a few (or a lot) process into the query and then return the String that represents the final query.

A great scenario is when you need to receive some input from a program/user/whatever and then you need to make some changes into this input to pass to another program/user/whatever.

So, i hope that this project may help you.

Some helpfull links:

[Full source of this project](https://github.com/softctrl/sc-regex-criterya-lib/archive/master.zip).

[The library jar](https://github.com/softctrl/sc-regex-criterya-lib/blob/master/files/sc-regex-criterya-lib-0.0.3-SNAPSHOT.jar?raw=true).

[My personal blog-0x09](http://www.0x09.com.br/).

Thanks.

[![Build Status](https://travis-ci.org/softctrl/sc-regex-criterya-lib.svg?branch=master)](https://travis-ci.org/softctrl/sc-regex-criterya-lib)

repository: softctrl/sc-regex-criterya-lib

repo_name: softctrl/sc-regex-criterya-lib