text:
---
title: CompileSwift - Using the EnvironmentObject to make data available to SwiftUI views
date: "2021-03-22T11:20:00.284Z"
description: "SwiftUI has a great way to use data across views. I use the EnvironmentObject. Here is how I implimented it in a personal iOS application."
---

### Show Notes

More than likely you have more than one view in your SwiftUI based application. If that is the case then you probably need to share data across those views and always have them displaying the latest data right? That's where the environment object comes into play, this makes it possible to do just that. I'll walk through the steps on how I recently implemented it in an application.

I will also be releasing a video soon, so if you are interested and want to know when that comes out head over to compileswift.com/contact and let me know.

repository: GrfxGuru/pwpodcast

repo_name: GrfxGuru/pwpodcast


text:
AB Electronics UK: RTC Pi - C Library
=====

C Library to use with RTC Pi Raspberry Pi expansion board from [AB Electronics UK](https://www.abelectronics.co.uk)

The example C programs can be found in /ABElectronics_C_Libraries/RTCPi/demos

Downloading and Installing the library
----------

To download to your Raspberry Pi type in the terminal:

```bash
git clone https://github.com/abelectronicsuk/ABElectronics_C_Libraries.git
```

___

Functions
----------

```c
rtc_set_date(struct tm date)
```

Set the date on the RTC
**Parameter:** (struct tm) date - struct tm formatted date and time
**Returns:** null
___

```c
rtc_read_date()
```

Read the date from the RTC.
**Returns:** (struct tm) date as a tm struct
___

```c
rtc_enable_output()
```

Enable the squarewave output pin
**Returns:** null
___

```c
rtc_disable_output()
```

Disable the squarewave output pin
**Returns:** null
___

```c
rtc_set_frequency(uint8_t frequency)
```

Set the square wave output frequency
**Parameter:** (uint8_t) frequency - 1 = 1Hz, 2 = 4.096KHz, 3 = 8.192KHz, 4 = 32.768KHz
**Returns:** null
___

```c
rtc_write_memory(uint8_t address, uint8_t valuearray[])
```

Write to the memory on the ds1307.
The DS1307 contains a 56-byte, battery-backed RAM with unlimited writes.
**Parameter:** (uint8_t) address - 0x08 to 0x3F
**Parameter:** (uint8_t[]) valuearray - byte array containing data to be written to memory
**Returns:** null
___

```c
rtc_read_memory(uint8_t address, uint8_t length)
```

Read from the memory on the ds1307
The DS1307 contains a 56-byte, battery-backed RAM with unlimited writes.
**Parameter:** (uint8_t) address - 0x08 to 0x3F
**Parameter:** (uint8_t) length - up to 32 bytes.  length can not exceed the available address space.
**Returns:** (uint8_t *) pointer to a byte array where the data will be saved
___

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: C

license_type: permissive


text:
---
author: makumbe
comments: true
date: 2010-10-11 13:19:22+00:00
layout: post
link: http://blog.daanalytics.nl/2010/10/11/oracle-mos-html-update-10102010/
slug: oracle-mos-html-update-10102010
title: Oracle MOS HTML Update 10102010
wordpress_id: 484
categories:
- My Oracle Support
tags:
- MOS
- OBIEE
- Oracle BI EE
---

** Document ID **

** Title **

** Doc Type **

** Modified Date **

1227043.1

[Fusion Middleware Configuration Wizard Hangs.](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1227043.1)

PROBLEM

04-OCT-10

981684.1

[How To Add OC4J As Service And Prevent Command Window From Displaying in OBIEE and BI Publisher MS Windows Environments](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=981684.1)

HOWTO

07-OCT-10

1227077.1

[Master Note for OBIEE Install and Upgrade Reference documents](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1227077.1)

REFERENCE

04-OCT-10

1186342.1

[How To Install Only The OBIEE 11g Administration And Client Tools](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1186342.1)

HOWTO

08-OCT-10

1226254.1

[OBIEE 11g Installation Errors on Windows 2008 R2 64 bit](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1226254.1)

HOWTO

03-OCT-10

1227908.1

[Monitoring Oracle Business Intelligence (OBIEE) scheduled jobs using Answers](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1227908.1)

WHITE PAPER

05-OCT-10

1210345.1

[Oracle BI Scheduler Error Trying To Save iBot: [Nqserror: 68019] Authentication Failed. Error Codes: GYFPI8RN](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1210345.1)

PROBLEM

05-OCT-10

602080.1

[We are getting a 68019 authentication error when trying to run our iBots](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=602080.1)

PROBLEM

04-OCT-10

1227393.1

[Gauge view display "undefinedundefined...." in gauge footer](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1227393.1)

PROBLEM

04-OCT-10

1199023.1

[OBIEE 11: Cannot See The Administration Link on Top of Page.](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1199023.1)

PROBLEM

07-OCT-10

1230374.1

[Obiee 11g Dashboard Simplification](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1230374.1)

HOWTO

07-OCT-10

1232535.1

[Bi Answers Grouping Issue - Count(Distinct)](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1232535.1)

PROBLEM

08-OCT-10

1227074.1

[How to change Date Format In Footer or Header of an Answers Request?](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1227074.1)

HOWTO

04-OCT-10

1227163.1

[Out Of The Box Dashoards Not Showing Completely In Portuguese, Still See English](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1227163.1)

PROBLEM

04-OCT-10

1227903.1

[Dashboard & Answers: Different Background Color For Fields](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1227903.1)

HOWTO

05-OCT-10

1230703.1

[How To Add The Same Column Multiple Times To A Dashboard Prompt](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1230703.1)

HOWTO

07-OCT-10

1230713.1

[Compound Layout View Does Not Return Correct Case Sensitive Results](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1230713.1)

PROBLEM

07-OCT-10

1227933.1

[OBIEE / OCI Error : ORA-03113](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1227933.1)

PROBLEM

05-OCT-10

1228177.1

['Job scheduling failed because the user has no permission to access this report' Error when XMLP_SCHEDULER Privilege has not been set for the User](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1228177.1)

PROBLEM

05-OCT-10

1230338.1

[Special Character In Essbase Generates Error In Obi](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1230338.1)

PROBLEM

07-OCT-10

1228136.1

[OBIEE Server Not Able To Start Due To Nqserror: 46063](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1228136.1)

HOWTO

05-OCT-10

1189099.1

[OBIEE 11g Administration Fails To Launch On Windows 64-bit OS](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1189099.1)

HOWTO

08-OCT-10

1227918.1

[Obiee 11g: Customize Gauge Limit Error: Invalid Gauge Scale Node.](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1227918.1)

PROBLEM

05-OCT-10

1203455.1

[Gauge chart error out with Graphing engine is not responding.](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1203455.1)

PROBLEM

05-OCT-10

1228974.1

[Error Connecting Via ODBC Or OCI To Oracle Database From OBIEE 11g](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1228974.1)

PROBLEM

06-OCT-10

1232335.1

[OBIEE 11g <IP_ADDRESS> MapViewer map problem with some formats in non-English languages (Spanish/Espanol)](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1232335.1)

PROBLEM

08-OCT-10

1232663.1

[Resetting passwords in 11g](https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1232663.1)

HOWTO

08-OCT-10

extension: markdown


text:
This recipe shows how to extend an Android view and create a custom compound view.

![Screenshots of the app](./images/compoundview-03.png)

[See the recipe at developer.xamarin.com](http://developer.xamarin.com/recipes/android/layout/compound_view/)

repository: King-of-Spades/recipes

repo_name: King-of-Spades/recipes


text:
Babel for kdb+
=========
Babel for kdb+ allows the **ultra-fast** database kdb+ from [Kx Systems] to query other databases via jdbc. It runs as a daemon, accepts connections from kdb+ processes, and queries other databases via the jdbc interface, transforming the result into a kdb+ compatible object.

![alt tag](https://raw.githubusercontent.com/CharlesSkelton/babel/master/meta/Babel.png)

Current Version
----
1.34 2014.03.24

Installation
--------------
Download the latest release from

https://github.com/CharlesSkelton/babel/tree/master/dist

Start it with (e.g. if connecting to mysql)

    java -jar babel.jar 6868 com.mysql.jdbc.Driver

which is of the pattern

    java -jar babel.jar listeningport jdbcdriver1 jdbcdriver2 ... jdbcdriverN

Actual output is similar to

    $java -jar babel.jar 6868 com.mysql.jdbc.Driver
    Babel for kdb+ Version 1.0 beta
    2008.01.08 11:42:13.839 Listening on port 6868 for connections...
    2008.01.08 11:42:22.818 New connection from /<IP_ADDRESS>:62929
    2008.01.08 11:42:22.838 Request from /<IP_ADDRESS>:62929
    2008.01.08 11:42:22.934 Response sent
    2008.01.08 11:42:22.935 Request from /<IP_ADDRESS>:62929
    2008.01.08 11:42:22.940 Response sent
    2008.01.08 11:42:22.958 Request from /<IP_ADDRESS>:62929
    2008.01.08 11:42:22.962 Response sent
    2008.01.08 11:42:22.981 Request from /<IP_ADDRESS>:62929
    2008.01.08 11:42:23.057 Response sent

Invocation
----------
It can be started with

    java -Xmx512m -jar babel.jar 6868 com.mysql.jdbc.Driver

which is of the pattern

    java -jar babel.jar listeningport jdbcdriver1 jdbcdriver2 ... jdbcdriverN

If you don't specify the port 6868 it will default to listening on port 9999. It will accept connections from localhost only, and logs to stdout.
Alternately, you can ignore that babel.jar is an executable jar file and run with full command line options. For Oracle, this could be:

    java -Xmx1024m -Doracle.jdbc.defaultRowPrefetch=10000 -cp "babel.jar:lib/ojdbc6.jar" de.skelton.babel.Babel 6868 oracle.jdbc.OracleDriver

Building a connection and issuing a query
-----------------------------------------
From kdb+ you connect as

    q)h:hopen 6868

and send queries as a sync request using the following format

    q)handle("query|update|string";"jdbc url";"query text")

e.g.

    q)r:h("query";"jdbc:mysql://ensembldb.ensembl.org:3306?user=anonymous&zeroDateTimeBehavior=convertToNull";"show databases")

Replacing "query" with "string" will force all columns to be interpreted as varchar type; this is intended for debug of type mappings only, and not recommended as being used for regular queries.

Async Requests
--------------
In addition to sync requests, Babel can process async requests in the form

    q)neg[handle]([`callbackFn`callbackTag!`myfn`mytag;]"query|update";"jdbc url";"query text")

e.g. Babel will callback myfn[`mytag;(0|1;errorText|resultSet)]

    q)myfn:{0N!(x;y);}
    q)neg[h](`callbackFn`callbackTag!`myfn`mytag;"query";"jdbc:mysql://ensembldb.ensembl.org:3306?user=anonymous&zeroDateTimeBehavior=convertToNull";"show databases")

or collect the result via h[]

    q)neg[h]("query";"jdbc:mysql://ensembldb.ensembl.org:3306?user=anonymous&zeroDateTimeBehavior=convertToNull";"show databases")
    q)r:h[] / (0|1;errorText|resultSet)

This demo uses http://www.ensembl.org/info/data/mysql.html

Specifying your jdbc driver and repacking the jar
-------------------------------------------------
If you want to continue to launch the executable JAR file directly, and you need to add your driver to the path, do the following: download and unzip the latest babel.zip, then extract the jar to its raw components

    jar -xvf babel.jar

then edit META-INF/MANIFEST.MF adding your database jar file path to the classpath in that manifest file, then update the jar file with the modified file

    jar umf META-INF/MANIFEST.MF babel.jar

If you know of a better way to achieve this please let us know.

Default Row Prefetch
--------------------
When extracting data from some oracle databases, users have discovered that the default fetch size for the Oracle jdbc driver is too small and impacts performance very badly. This can be influenced by setting the default fetch size as a command line option to java, using

    -Doracle.jdbc.defaultRowPrefetch=10000

e.g.

    $java -Doracle.jdbc.defaultRowPrefetch=10000 -Xmx512m -jar babel.jar 6868 ....

Data Type Conversion for NUMERIC and DECIMAL types
--------------------------------------------------
The default type for NUMERIC and DECIMAL is a String. However, the data will be converted into an actual number if the following criteria are met:

|Precision | Scale         | Data Type|
|----------|:-------------:|----------|
|<= 9	   | 0 or -127	   | Integer  |
|<= 18	   | 0 or -127	   | Long     |
|<= 7	   | not 0 or -127 | Float    |
|<= 15	   | not 0 or -127 | Double   |

[Kx Systems]:http://www.kx.com

gha_language: Java


text:
---
title: Syncing Files with Various Cloud Storage Solutions
author: Karim Elatov
layout: post
permalink: /2013/10/syncing-files-various-cloud-storage-solutions/
categories: ['storage', 'os']
tags: ['mac_os_x','ubuntu', 'linux','owncloud', 'seafile','davfs']
---

A while ago I wrote [this](/2013/02/sharing-a-file-encrypted-by-encfs-with-android-and-linux-systems-with-google-drive/) post on how to use Grive. Grive is a cross platform/architecture client that allowed me to sync files with Google Drive. I really liked the setup, but now I wanted another cloud storage solution, where I could store the not-so-important files and not take up space on my google drive account.

### Desired Cloud Storage Capabilities

I had a couple of criteria that the cloud storage solution had to support:

1.  I could manage the files with a cli (some people called this headless). Whether this was done with the API or something else, it didn't really matter to me
2.  It could be used cross platform and architecture. So I wanted to be able to use it on a Mac, Windows, Linux, and Android. For Linux, I wanted to be able to use it on x86, powerpc, ARM or whatever architecture.

### SkyDrive/OneDrive

I haven't used **skydrive** before, so I wanted to give it a try. First, what is *skydrive*? from wikipedia:

> SkyDrive (officially Microsoft SkyDrive, previously Windows Live SkyDrive and Windows Live Folders) is a file hosting service that allows users to upload and sync files to a cloud storage and then access them from a Web browser or their local device.

So it's Microsoft's version of a cloud storage solution. There is a pretty good comparison page from a Microsoft, comparing SkyDrive, iCloud, Google Drive, and DropBox. Here is quick snippet from the [page](https://products.office.com/en-us/onedrive/compare-onedrive-plans):

![SkyDrive Comparison Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/SkyDrive_Comparison.png)

You can register for the free 7GB SkyDrive account [here](https://skydrive.live.com) . After the registration is finished you can login and see your account:

![skydrive logged in Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/skydrive-logged-in.png)

There is a python client available for SkyDrive that uses the SkyDrive API. It's called **python-skydrive**, here is a link to the [client](https://github.com/mk-fg/python-onedrive).

#### Python-Skydrive

To use the **python-skypdrive** (now called **python-onedrive**) client, you have to register the SkyDrive application with the "Live Connect Developer Center". First visit the Dev Center, [here](https://developer.microsoft.com/en-us/windows/). Login with the same credentials that you created when you registered for SkyDrive and you should be inside the Dev Center:

![Live connect dev center Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/Live_connect_dev_center.png)

Click on "**My Apps**" and then click on "**Create Application**":

![Live dev center my apps Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/Live_dev_center_my_apps.png)

After clicking "**Create Application**" you can call it whatever you want. Then after clicking **Next** it will show your *client ID* and the *client secret*:

![skydrive Api rgistered i Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/skydrive_Api_rgistered_i.png)

Make sure to set **Mobile Client App** to **yes** and then click **Save**. Add both the *Client ID* and *Secret* to your **.lcrc** file:

    $ cat ~/.lcrc
    client:
      id: 0000620A3E4A
      secret: gndrjIOLWYLkOPl0QhW

I was actually using my Mac, so I ended using **Mac-Ports** to do the install. First I checked which version of python I have installed:

    kelatov@kmac:~$port list installed | grep python
    python27                       @2.7.5          lang/python27
    python27                       @2.7.5          lang/python27
    python32                       @3.2.5          lang/python32
    python_select                  @0.3            sysutils/python_select

The application supported *python2.7*, so let's install **pip** for that:

    kelatov@kmac:~$sudo port install py27-pip

Now using **pip**, let's install the SkyDrive client:

    kelatov@kmac:~$sudo pip-2.7 install 'python-skydrive[standalone]'
    Downloading/unpacking python-skydrive[standalone]
      Downloading python-skydrive-13.08.2.tar.gz
      Running setup.py egg_info for package python-skydrive

      Installing extra requirements: 'standalone'
    Downloading/unpacking requests (from python-skydrive[standalone])
      Downloading requests-2.0.0.tar.gz (362kB): 362kB downloaded
      Running setup.py egg_info for package requests

    Installing collected packages: python-skydrive, requests
      Running setup.py install for python-skydrive

        Installing skydrive-cli script to /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin
      Running setup.py install for requests

    Successfully installed python-skydrive requests
    Cleaning up...

It looks like I need **python-yaml** to do the authentication, so I installed that as well:

    $ sudo port install py27-yaml

The **skydrive-cli** script was placed in a weird location:

    kelatov@kmac:~$find /opt/local -name skydrive-cli /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/skydrive-cli

So I went ahead and added a symbolic link under **/opt/local/bin**:

    kelatov@kmac:~$sudo ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/skydrive-cli /opt/local/bin/skydrive-cli

Now it's time to authorize our client to be able to access SkyDrive. Here is the command for that:

    kelatov@kmac:~$skydrive-cli auth
    Visit the following URL in any web browser (firefox, chrome, safari, etc),
      authorize there, confirm access permissions, and paste URL of an empty page
      (starting with "https://login.live.com/oauth20_desktop.srf") you will get redirected to in the end.
    Alternatively, use the returned (after redirects) URL with "/opt/local/bin/skydrive-cli auth <URL>" command.

    URL to visit: https://login.live.com/oauth20_authorize.srf?scope=wl.skydrive+wl.skydrive_update+wl.offline_access&redirect_uri=https%3A%2F%2Flogin.live.com%2Foauth20_desktop.srf&response_type=code&client_id=790E

    URL after last redirect: https://login.live.com/oauth20_desktop.srf?code=c0c
    API authorization was completed successfully.

So first it provides you with a URL to visit and after you allow access, it will throw to a URL with a blank page. You can then copy that URL and paste it in to the command and it will be authorized. At this point you will be able to check the contents of your SkyDrive with the cli:

    kelatov@kmac:~$skydrive-cli tree
    SkyDrive:
      Documents:
      Pictures:
      Public:

After I started using the cli, I realized it was like an FTP client for SkyDrive. Here are the available actions:

    Supported operations:
      {auth,quota,recent,info,info_set,link,ls,mkdir,get,put,cp,mv,rm,comments,comment_add,comment_delete,tree}
        auth                Perform user authentication.
        quota               Print quota information.
        recent              List recently changed objects.
        info                Display object metadata.
        info_set            Manipulate object metadata.
        link                Get a link to a file.
        ls                  List folder contents.
        mkdir               Create a folder.
        get                 Download file contents.
        put                 Upload a file.
        cp                  Copy file to a folder.
        mv                  Move file to a folder.
        rm                  Remove object (file or folder).
        comments            Show comments for a file, object or folder.
        comment_add         Add comment for a file, object or folder.
        comment_delete      Delete comment from a file, object or folder.
        tree                Show contents of skydrive (or folder) as a tree of
                            file/folder names. Note that this operation will have
                            to (separately) request a listing of every folder
                            under the specified one, so can be quite slow for
                            large number of these.

You can't even **put** a directory into SkyDrive, so I would have to write another script to basically recursively put files from a directory. There was also no sync functionality, like with **grive**. I think the client is great and I am sure it will get better with future releases.

### DropBox

At this point I wanted to try the most popular cloud storage solution out there: DropBox. I first installed it on my Mac. The install was pretty straight forward, just download it and launch it, at which point it will ask you to login to dropbox:

![dropbox installer Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/dropbox_installer.png)

After the install is done, you will see the dropbox status in your notification area:

![dropbox notificateion Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/dropbox_notificateion.png)

That was just for the Mac. I then read up on how to setup dropbox on a headless linux server:

*   [Install Dropbox In An Entirely Text-Based Linux Environment](https://help.dropbox.com/desktop-web/linux-commands)
*   [Using Dropbox on Linux headless server](http://artofsimplicity.co.uk/install-dropbox-on-a-headless-ubuntu-server/)
*   [How to install headless dropbox (with no GUI frontend) on ubuntu](http://ubuntuforums.org/showthread.php?t=1416686)

All the installs provide an already compiled binary for either x86 or x86_64 architectures but nothing else. I then ran into a couple of CLIs for dropbox:

*   [Using the Official Dropbox Command Line Interface (CLI)](http://www.dropboxwiki.com/tips-and-tricks/using-the-official-dropbox-command-line-interface-cli)
*   [dbxcli: A command line tool for Dropbox users and team admins](https://github.com/dropbox/dbxcli)

But they were just CLIs that depended on **dropboxd** to be already running (which was only provided for x86 and x86_64 architectures). There is a *nautilus-plugin*, which can be compiled (the source can be found [here](https://www.dropbox.com/help/247/en).

I finally ran into **dropboxuploader.sh**. Here are a couple of guides on using that:

*   [Dropbox Uploader](https://github.com/andreafabrizi/Dropbox-Uploader)
*   [DropBox Uploader Bash Script: Useful for Servers, Raspberry PI, and More](http://www.webupd8.org/2013/01/dropbox-uploader-bash-script-useful-for.html)
*   [Manage Dropbox in Terminal With Dropbox Uploader](http://www.maketecheasier.com/manage-dropbox-in-terminal/)

The script was really good, but it also felt like an FTP client for DropBox. Here are the available actions:

    upload [LOCAL_FILE/DIR] <REMOTE_FILE/DIR>
    download [REMOTE_FILE/DIR] <LOCAL_FILE/DIR>
    delete [REMOTE_FILE/DIR]
    move [REMOTE_FILE/DIR] [REMOTE_FILE/DIR]
    copy [REMOTE_FILE/DIR] [REMOTE_FILE/DIR]
    mkdir [REMOTE_DIR]
    list <REMOTE_DIR>
    share [REMOTE_FILE]
    info
    unlink
    -f [FILENAME] Load the configuration file from a specific file
    -s Skip already existing files when download/upload. Default: Overwrite
    -d Enable DEBUG mode
    -q Quiet mode. Don't show progress meter or messages
    -p Show cURL progress meter
    -k Doesn't check for SSL certificates (insecure)

This script was better than the SkyDrive one (**skydrive-cli**), since it allowed for uploads of directories and it could skip existing files, but there was still no sync functionality (so if I had updated a text file, it wouldn't upload it since it already existed).

### Box

Everyone knows the popular alternative to *DropBox* is *Box*. The install on my Mac was similar to the DropBox install. You just launch the installer and it took care of the rest. The cool thing with Box is that you can access your files via **WebDav**. I ran into some pages that utilized WebDav with Box:

*   [50gb of “cloud” space with Box, automatically sync’d on Ubuntu/Linux with webdav and unison](http://seb.so/50gb-of-cloud-space-with-box-automatically-syncd-on-linux-with-webdav/)

It had a pretty cool setup, but I later ran into:

*   [box-linux-sync - A naïve Box.com Linux Client](https://github.com/noiselabs/box-linux-sync)

The setup seems reasonable, so I gave it a try. Here is what I did to sync files with Box with **WebDav** on my Debian box. First let's install **davfs**:

    $ sudo apt-get install davfs2

In order for regular users to be able to mount **davfs**, they need to be part of the **davfs2** group. Here is the command to add myself to that group:

    $ sudo usermod -a -G davfs2 elatov

Then I installed some python prerequisites, so we can use the **box-sync** client:

    $ sudo apt-get install python-pkg-resources

Now let's install the **box-sync** client:

    $ git clone git://github.com/noiselabs/box-linux-sync.git
    $ sudo mv box-linux-sync /usr/local/.
    $ sudo chown elatov:elatov /usr/local/box-linux-sync/
    $ sudo ln -s /usr/local/box-linux-sync/bin/box-sync /usr/local/bin/box-sync

Now let's check to make sure the client is ready for setup:

    $box-sync check
    Created configuration file '/home/elatov/.noiselabs/box/box-sync.cfg'
    Created example configuration file '/home/elatov/.noiselabs/box/box-sync.cfg.sample'
    * Checking davfs installation...
    * Congratulations. Your Davfs install is OK ;)

That looks good, now let's run the setup:

    $ box-sync setup
    * Setting up davfs...
    * Created sync directory at '/home/elatov/Box'
    *  Created a personal davfs2 directory at '/home/elatov/.davfs2'
    *  Created a personal cache directory at '/home/elatov/.davfs2/cache'
    * Created a new secrets file in '/home/elatov/.davfs2/secrets'
    * Installed a new davfs config file in '/home/elatov/.davfs2/davfs2.conf'
    * Credentials are missing from /home/elatov/.davfs2/secrets. Please add them:
      $ echo "https://www.box.com/dav MYEMAIL MYPASSWORD" >> /home/elatov/.davfs2/secrets

    * Box mount point is missing. Please add this line to your /etc/fstab:
      $ sudo sh -c 'echo "https://www.box.com/dav /home/elatov/Box davfs rw,user,noauto 0 0" >> /etc/fstab'

    * '/home/elatov/.davfs2/davfs2.conf' looks good ;)

Now let's add the credentials to the **~/.davfs2/secrets** file:

    $ echo "https://www.box.com/dav MYEMAIL MYPASSWORD" >> ~/.davfs2/secrets

and also let's add the mount point to our **/etc/fstab** file:

    $ sudo sh -c 'echo "https://www.box.com/dav /home/elatov/.box davfs rw,users,noauto 0 0" >> /etc/fstab'

**Note:** I added the *users* parameter to the **fstab** entry, this will allow regular users to un-mount that volume as well.

Next I changed my default folder to be **.box**, this is done by editing the **~/.noiselabs/box/box-sync.cfg** file and modifying the following line:

    box_dir = .box

Now let's create the mount point:

    $ mkdir .box

and lastly allow regular users to use the **davfs** mount utility, this is done by running the following:

    $ sudo chmod  u+s /usr/sbin/mount.davfs

Now to actually access our Box files via **webdav**:

    $ box-sync start

To make sure it's mounted, you can run the following:

    $ /bin/df -h -t fuse
    Filesystem               Size  Used Avail Use% Mounted on
    https://www.box.com/dav   26G   13G   13G  50% /home/elatov/.box

Now you can use **rsync**, or even **unison** (described in the above guide) to keep your files synced up. To un-mount the volume just run the following:

    $ box-sync stop

The setup was pretty good, but **davfs** was a little slow. Some times I would run **ls** on the volume and if the directory had over 10 files, it would take a while to display the files. I also didn't like the idea of modifying my **/etc/fstab** to get this running. I was still stuck on the simplicity of the **grive** client for google drive.

### Storage Made Easy (SME)

In my efforts to speed up Davfs with Box, I ran into Storage Made Easy (SME). From their FAQ, here is what they do:

> What exactly does Storage Made Easy do?
> Storage Made Easy Provide a Cloud File Server that can be used by individuals or teams and that unifies information from different file stores and SaaS services to make them easier to access, search, and manage. Over 40 different file clouds and services are supported and unlike other vendors no files need to be moved, copied or replaced to provide this service.

So SME is basically a broker for all different cloud solutions and they just keep metadata of all the files and don't actually store the data. They support a bunch of cloud solutions, from their [cloud list](http://storagemadeeasy.com/cloud_list/), here is their supported list:

![sme cloud list Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/sme_cloud_list.png)

You can see that SkyDrive, Dropbox, and Box are all supported and a lot of other ones are supported as well. Surprisingly the Ubuntu Client actually worked on my Chromebox (ARM Based). I downloaded the client from [here](http://storagemadeeasy.com/LinuxDrive/). The install went okay, first install the **deb** package:

    $ sudo dpkg -i storagemadeeasy_4.0.7.deb
    Selecting previously unselected package storagemadeeasy.
    (Reading database ... 167023 files and directories currently installed.)
    Unpacking storagemadeeasy (from storagemadeeasy_4.0.7.deb) ...
    dpkg: dependency problems prevent configuration of storagemadeeasy:
     storagemadeeasy depends on libqt4-core (>= 4.3); however:
      Package libqt4-core is not installed.
     storagemadeeasy depends on fuse-utils; however:
      Package fuse-utils is not installed.
     storagemadeeasy depends on libfuse-perl; however:
      Package libfuse-perl is not installed.
     storagemadeeasy depends on libfilesys-statvfs-perl; however:
      Package libfilesys-statvfs-perl is not installed.
     storagemadeeasy depends on liblchown-perl; however:
      Package liblchown-perl is not installed.
     storagemadeeasy depends on libfuse-dev; however:
      Package libfuse-dev is not installed.
     storagemadeeasy depends on libqt4-gui; however:
      Package libqt4-gui is not installed.

    dpkg: error processing storagemadeeasy (--install):
     dependency problems - leaving unconfigured
    Processing triggers for bamfdaemon ...
    Rebuilding /usr/share/applications/bamf-2.index...
    Processing triggers for desktop-file-utils ...
    Processing triggers for gnome-menus ...
    Errors were encountered while processing:
     storagemadeeasy

Then to install the missing dependencies, just run the following:

    $ sudo apt-get install -f
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Correcting dependencies... Done
    The following extra packages will be installed:
      fuse-utils libfilesys-statvfs-perl libfuse-dev libfuse-perl liblchown-perl
      libqt4-core libqt4-gui libselinux1-dev libsepol1-dev
    Suggested packages:
      libunix-mknod-perl
    The following NEW packages will be installed:
      fuse-utils libfilesys-statvfs-perl libfuse-dev libfuse-perl liblchown-perl
      libqt4-core libqt4-gui libselinux1-dev libsepol1-dev
    0 upgraded, 9 newly installed, 0 to remove and 2 not upgraded.
    1 not fully installed or removed.
    Need to get 0 B/496 kB of archives.
    After this operation, 1,949 kB of additional disk space will be used.
    Do you want to continue [Y/n]?

After it's installed you can launch the GUI to configure the cloud providers. So from the terminal run:

    $ smeexplorer

and it will ask you to authenticate:

![sme explorer Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/sme_explorer.png)

After your are authenticated, you can add a storage provider. For example I added **box.net**:

![sme add cloud provider Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/sme_add_cloud_provider.png)

Then you can launch the sync center:

    $ smesynccenter

You will have to authenticate again and you can define the sync schedule. For example I asked it to sync every 5 minutes:

![sme sync center 5min Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/sme-sync-center-5min.png)

and then you can link a local folder to a remote folder from any of the providers that you have added. Here I am syncing my local **pic** folder to the **Box.net** provider:

![link folder sme Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/link_folder-sme.png)

You can also mount all the providers with the **smeclient**. Run it with the following command:

    $ smeclient

and then choose a mount point and enter your credentials and it will mount it for you:

![smeclient 1 Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/smeclient_1.png)

After it's done you will see the mount point:

    $df -h -t fuse
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/fuse       4.0T     0  4.0T   0% /home/elatov/.sme

It was actually much faster than the **DavFS** mountpoint, but there was no CLI. From the [FAQ](http://storagemadeeasy.com/faq/#commandlinemount):

> How do I a headless command line mount of the Linux Drive?
> You should enter the following command into a bash startup script:
>
>     su -c "smemount /path/to/folder login:password" user
>

So the only thing you could do is mount like you did with **davfs** and *box*, but the SME Sync Center couldn't be launched without Xorg running. I really liked the product (the idea is fantastic, if I ever want to tranfer between storage cloud solutions, I will definitely use this), but the lack of the CLI pushed me back.

### UbuntuOne

At this point I thought if I could get something running on the ARM Chromebook (which was running Ubuntu), then I will just figure out the rest of the OSes later. So I decided to try out **UbuntuOne**, I have heard of this a while back, but I just never gave it a try. To set it up, first install the client:

    $ sudo apt-get install ubuntuone-client

Then let't change the default sync directory to be **~/.ubone** instead of **~/Ubuntu One**. This is done by editing the **/etc/xdg/ubuntuone/syncdaemon.conf** file and modifying the following line:

    root_dir.default = ~/.ubone

Next we can launch the GUI to get authenticated:

    $ ubuntuone-control-panel-qt

And you will see the following:

![ubone setup Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/ubone_setup.png)

After that click on "**Sign me in with my existing account**" and it will ask you to authenticate:

![ubon auth Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/ubon_auth.png)

After you are authenticated it will show you which folder it will sync with and the one we have set it perfect:

![ub one sync Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/ub_one_sync.png)

After you are done with the configuration, you should see the **syncdaemon** running:

    $ps -ef | grep ubuntuone
    elatov   22259     1  0 13:02 ?        00:00:02 /usr/bin/python /usr/lib/ubuntuone-client/ubuntuone-syncdaemon

And you can also check the status but using the CLI:

    $u1sdtool -s
    State: QUEUE_MANAGER
        connection: With User With Network
        description: processing the commands pool
        is_connected: True
        is_error: False
        is_online: True
        queues: IDLE

There are also instructions on how to get authenticated on a headless Linux server. The instructions are laid out [here](http://askubuntu.com/questions/95591/how-do-i-configure-ubuntu-one-on-a-server). You just have to use a python script to get authenticated. I ran into some forums on how to set it up for Debian, which were my two other machines (UbuntuOne had clients for MacOS and Windows as well):

*   [Ubuntu One on Debian Wheezy](https://conalambre.wordpress.com/2012/10/15/ubuntu-one-en-debian-wheezy/)
*   [Howto: Ubuntu One in Debian Wheezy](http://forums.debian.net/viewtopic.php?f=16&t=63310)

The Fedora one seemed okay, just had to add a repository but the Debian setup seemed surprisingly complicated. As I started to configuration on Fedora, I ran into an issue where the **NetworkManager** had to be running ([link](http://askubuntu.com/questions/95591/how-do-i-configure-ubuntu-one-on-a-server)). Some of these had static IPs and had no need to run that. Rather then installing NetworkingManager on all of my machines, I decided to move one. So far, I really liked UbuntuOne, if you are using Ubuntu Laptops, I would definitely recommend it, but if you are using another distribution, it might be a little difficult to setup.

### Others and Seafile

At this point I just started doing some random research.

#### Syncany

The first one I ran into was Syncany, from [their](http://www.syncany.org/) site:

> Syncany is an open-source cloud storage and filesharing application. It allows users to backup and share certain folders of their workstations using any kind of storage, e.g. FTP, Amazon S3 or Google Storage.
>
> While the basic idea is similar to Dropbox and JungleDisk, Syncany is open-source and additionally provides data encryption and more flexibility in terms of storage type and provider

The idea was similar to SME, but it was opensource. I couldn't find any CLI, just GUI for this application. And it seemed that they are trying to integrate with SparkleShare:

> 7 Mar 2013: We're still hanging in there. Even though the direction is now a different one. We're first trying to integrate Syncany with SparkleShare as a backend. Check out a detailed status in my recent mailing list post.

#### SparkleShare

SparkleShare seemed pretty cool, from [their](http://sparkleshare.org/) site:

> How does it work?
> SparkleShare creates a special folder on your computer. You can add remotely hosted folders (or "projects") to this folder. These projects will be automatically kept in sync with both the host and all of your peers when someone adds, removes or edits a file.

It's almost like a private dropbox setup. You run a server and then you connect clients to the server and every one synchronizes between each other. When I was reading about it, I thought of **git** right away (it seemed so similar), as I kept reading I saw the following:

> SparkleShare uses the version control system Git under the hood, so setting up a host yourself is relatively easy. Using your own host gives you more privacy and control, as well as lots of cheap storage space and higher transfer speeds.

This seemed really cool, but I actually like having the idea of having the files online somewhere, just for back up reasons.

#### DVCS-Autosync

Another similar tool to SparleShare is DVCS-Autosync. From [their](https://github.com/rmayr/dvcs-autosync) site:

> dvcs-autosync is a project to create an open source replacement for Dropbox/Wuala/Box.net/etc. based on distributed version control systems (DVCS). It offers nearly instantaneous mutual updates when a file is added or changed on one side but with the added benefit of (local, distributed) versioning and that it does not rely on a centralized service provider, but can be used with any DVCS hosting option including a completely separate server - your data remains your own.

It actually used XMMP for it's communication and it could use other tools than git, more from their site:

> Synchronization of directories is based on DVCS repositories. Git is used for main development and is being tested most thoroughly as the backend storage, but other DVCS such as Mercurial are also supported. dvcs-autosync is comparable to SparkleShare in terms of overall aim, but takes a more minimalistic approach. A single Python script monitors the configured directory for live changes, commits these changes to the DVCS (such as git) and synchronizes with other instances using XMPP messages.

So you would actually need an XMPP server to make it work (or use gtalk). The idea seems really cool as well but I wasn't really looking for hosting my own private storage cloud solution

#### OwnCloud

This application could almost do anything. It runs on PHP and allows you to upload files to it and also connect to other storage cloud providers (like SME) and supports WebDAV. It's basically your own private Box.net and then some. From [their](http://demo.owncloud.org/) site:

> ownCloud gives you universal access to your files through a web interface or WebDAV. It also provides a platform to easily view & sync your contacts, calendars and bookmarks across all your devices and enables basic editing right on the web. Installation has minimal server requirements, doesn’t need special permissions and is quick. ownCloud is extendable via a simple but powerful API for applications and plugins.

There are also client available for all the platforms and you can compile your own if you wanted to. If I really wanted to host my own dropbox-like service, I would definitely give this a try... maybe for another day.

#### SeaFile

At this point I ran into **Seafile**. What was cool about **seafile** is that you can setup your own storage cloud if you want, or you could use their storage cloud called **SeaCloud**. Here is information regarding seacloud, from [their](https://www.seafile.com/en/features/) site:

> SeaCloud is a place for managing your documents with team members. You can create public/private groups with file syncing, wiki, discussion and other functions. SeaCloud is hosted on Amazon Web Services.
>
> Based on the open source file-syncing tool Seafile

And here is information regarding SeaFile, for [their](https://github.com/haiwen/seafile) git page:

> Dropbox is good for file syncing and sharing, but is not an ideal place for collaboration. So we build Seafile, a better place for managing documents together.
>
> In Seafile, you can create groups with file syncing, wiki, discussion and tasks. It enables you to easily collaborate around documents within a team. In addition, it is open source. So you can build a private cloud freely for your organization.

More information:

> Seafile is a full-fledged document collaboration platform. It has following features:
>
> 1.  Groups with file syncing, wiki, discussion and tasks.
> 2.  Managing files into libraries. Each library can be synced separately.
> 3.  Sync with existing folders.
> 4.  File revisions.
> 5.  Library encryption with a user chosen password.

This also works in a similar way to Git:

> Seafile uses GIT's version control model, but simplified for automatic synchronization, and doesn't depend on GIT. Every library is like a GIT repository. It has its own unique history, which consists of a list of commits. A commit points to the root of a file system snapshot. The snapshot consists of directories and files. Files are further divided into blocks for more efficient network transfer and storage usage.

So if I wanted my own private storage cloud, I would definitely give this a try as well. Actually there were a couple of sites, that compared ownCloud, SparkelShare, and Seafile and they all liked Seafile:

*   [Seafile: Robust File Synchronization and Collaboration Tool that you Can Run on your Linux Server](http://www.webupd8.org/2013/02/seafile-robust-file-synchronization-and.html)
*   [Self-Hosted Cloud Storage: ownCloud vs. SparkleShare vs. BitTorrent Sync vs Seafile](http://blog.patshead.com/2013/04/self-hosted-cloud-storage-solution-owncloud-vs-sparkleshare.html)
*   [Cloud storage on the Raspberry Pi](http://stevenhickson.blogspot.com/2013/04/cloud-storage-on-raspberry-pi.html)

### Seafile Cli Install

So I decided to try out **Seafile** but not for it's server capabilities but rather for the Linux Cli connecting to their *seacloud*. Here is what I did to install the **seafile** cli on my Debian box, most of the instructions are laid out [here](https://github.com/haiwen/seafile/wiki/Build-and-use-seafile-client-from-source). First install the prerequisites:

    $ sudo apt-get install libglib2.0-dev

Then grab the source and extract it:

    $ wget http://seafile.googlecode.com/files/seafile-latest.tar.gz
    $ tar xzf seafile-latest.tar.gz

Now let's compile **libsearpc** (initially I tried with the **-prefix** option when running **./configure**, but it gave me an error during the complie, that issue is currently getting looked at, here is the [link](https://groups.google.com/g/seafile/c/vO7CCdsMwxE/m/PxCTDv4XotwJ) for the bug report). By default the compile puts all the files under **/usr/local** and that was good enough for me. I could've probably changed the configure scripts around but I didn't feel like messing with it. So first go inside the source code:

    $ cd seafile-1.8.2/libsearpc

For some reason the linking of the libraries is messed up as well, so run the following to include libraries that will be under **/usr/local/lib**:

    $ setenv CC "gcc -Wl,-rpath,/usr/local/lib"

Now for the configure:

    ./configure --enable-compile-demo=no

and now for the compile:

    $ make

and finally for the install:

    $ sudo make install

Here is what I ran to compile **ccnet**:

    $ cd seafile-1.8.2/ccnet
    $ sudo apt-get install uuid-dev libevent-dev libsqlite3-dev
    $ ./configure --enable-compile-demo=no
    $ make
    $ sudo make install

And here is what I ran to install **seafile**:

    $ cd seafile-1.8.2
    $ ./configure --enable-client --disable-gui
    $ make
    $ sudo make install

Now here are the commands to initialize the client:

    $ sudo apt-get install python-simplejson
    $ mkdir .config/seafile
    $ seaf-cli init -d .config/seafile/
    done
    Successly create configuration dir /home/elatov/.ccnet.
    Writen seafile data directory /home/elatov/.config/seafile/seafile-data to /home/elatov/.ccnet/seafile.ini

Now start the daemon:

    $seaf-cli start
    starting ccnet daemon ...
    Started: ccnet daemon ...
    starting seafile daemon ...
    Started: seafile daemon ...

Now login to your **seacloud** management console and click on your library and it will show your repo ID for your library:

![seafile repo url Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/seafile_repo_url.png)

The string after repo if what you need. Now to synchronize with that library create a local directory and run the following to synchronize your local directory with the remote library:

    $ mkdir .sea
    $ seaf-cli sync -l 30070853-17fe-4fd5 -s https://seacloud.cc -d .sea -u<EMAIL_ADDRESS>

You will be able to check the status by running the following:

    $ seaf-cli status
    # Name  Status  Progress

    # Name  Status
    files       downloading

You can also check which library is synchronized with which local folder by running the following:

    $ seaf-cli list
    Name    ID      Path
    files 30070853-17fe-4fd5 /home/elatov/.sea

That's it, now I can just run `seaf-cli start` on start up and my files will always synchronized. There are also Mac OS, Android, and Windows clients (all have installers). The is also a Linux Applet available. To compile the **seafile-applet**, run the following during the configure:

    $ ./configure --enable-client --disable-server

You can launch the applet, by running the following:

    $ seafile-applet &

After executing that, it will check if the **seafile-daemon** is running. If it is, it'll just attach it self to that. If the **seafile-daemon** is not running, then it will start it up and then attach it self to that. Here is seafile running in the notification area:

![seafile applet Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/seafile_applet.png)

This definitely fit my needs and I was happy with the setup. Lastly you can check on the local **seafile** daemon, by visiting **https://localhost:13420** to see the status:

![seafile client browser Syncing Files with Various Cloud Storage Solutions](https://github.com/elatov/uploads/raw/master/2013/10/seafile_client_browser.png)

gha_language: CSS


text:
# Get of My Lawn

**Reference**: <IP_ADDRESS>

**Description**:
In this exercise we’re going to write a simulator of my Dad,
the movie critic. It’s quite simple: any movie directed by
**Clint Eastwood** gets a rating `10.0`, any movie directed
by **John McTiernan** gets a `7.0`, while any other movie
gets a `3.0`. Implement an object called `Dad` with a method
`rate` which accepts a `Film` and returns a `Double`. Use
*pattern matching*.

repository: sierikov/essential-scala

repo_name: sierikov/essential-scala


text:
# my-pet-xamarin
A simple app made with Xamarin that retrieves some information of dogs from Azure and display on it. The app contains two screens: a list page and a detail page.

# iOS
![screenshot 1 - list page](https://i.imgur.com/ZjGsg6d.png)
![screenshot 2 - detail page](https://i.imgur.com/pc4epbS.png)
![screenshot 3 - map page](https://i.imgur.com/L8xkmVO.png)

# Android
![screenshot 1 - list page](https://i.imgur.com/DPt8msz.jpg)
![screenshot 2 - detail page](https://i.imgur.com/v28JQf3.jpg)
![screenshot 3 - map page](https://i.imgur.com/6saAbwL.jpg)

repository: rafaelbpa/my-pet-xamarin

repo_name: rafaelbpa/my-pet-xamarin


text:
[![Build Status](https://travis-ci.org/agalitsyn/goapi.svg?branch=master)](https://travis-ci.org/agalitsyn/goapi)

# goapi

This is example of golang app, which has minimal skeleton for web app and some dev tools.

Inspired by [article](https://medium.com/@kelseyhightower/12-fractured-apps-1080c73d481c#.ihna7diaw).
Partially based on repo https://github.com/kelseyhightower/app

Don't use for production.

## Usage

Download:

```
go get https://github.com/agalitsyn/goapi
```

### Review settings

```
$ cp .env.default .env
$ vi .env
```

### Build and Run

```
$ make

```

For database you can use docker image https://hub.docker.com/_/postgres/

### Test with cURL

```
$ curl --cacert ./ca.pem --key ./client-key.pem --cert ./client.pem https://<IP_ADDRESS>:5000/
```

repository: UnderGreen/goapi

repo_name: UnderGreen/goapi


text:
---
layout: post
title: POS - Particle Optimizing Swarm
subtitle: Enhancing Particle Swarm Optimization with Local Optimization
tags: [Optimization, Particle Swarm Optimization, Hyper-parameter Tuning]
image: /img/opt2_1.png
---

---
The purpose of this post is to introduce a new two-step optimizing technique that utilizes Particle Swarm Optimization (PSO)
and local numerical optimization. The code for this optimization method can be found [here](https://github.com/e-baumer/pos)
and is a work in progress.

In real-world applications such as hyper-parameter tuning of machine learning models, the function that we are trying to
optimize is noisy with many local minimum and maximum values. For example, the image below shows an objective function over
a 2-dimensional feature space. In this case, the objective function is the out-of-sample model validation score for a fitted
gradient boosted model. The objective function is a function of two hyper-parameters of the model.

Figure 1. 3D plot of the out of sample validation of the model (RMSE) versus the two hyper-pamaters of the model.

The local noise can skew the search over the global structure. PSO moves candidate solutions
(or particles) across the feature space according to the last known best solution of all the particles as a whole and of
the individual particles. Where the particle lands on the local variability will help determine the future state of that
individual particle as well as all the other particles. The local variability will mask the overall structure of the objective
function and either significantly increase the necessary number of iterations necessary to explore the overall structure or
make impossible to explore.

Here we propose a solution to overcome the inconsistencies of local variability. The search over the feature space is divided
into two steps. In the first step, we use Particle Swarm Optimization to update a candidate solution within the feature space.
After each update, we perform a local optimization within a bounded region of the updated particle's position. This local
optimization ensures that we are searching across the space of the best local solutions. We repeat these two steps for a
user-defined number of iterations.

Figure 2. Flow diagram showing the two step optimization process.

Currently, there are two options for the local optimization scheme. The first option is to perform a
Broyden-Fletcher-Goldfarb-Shannon (BFGS) numerical optimization. The second option is to randomly sample within a bounded
region of the candidate solution and take the minimum of the objective function within that sample. On the final overall iteration,
a BFGS optimization is performed.

The random sampling scheme for the local optimization is computationally cheaper; however, if the most resource-intensive step is in
evaluation of the objective function one should definitely use the BFGS optimization.


text:
# vue-cooler-exposure

[![npm version](https://img.shields.io/npm/v/vue-cooler-exposure.svg?style=flat-square)](https://www.npmjs.com/package/vue-cooler-exposure)
[![npm downloads](https://img.shields.io/npm/dm/vue-cooler-exposure.svg?style=flat-square)](https://www.npmjs.com/package/vue-cooler-exposure)
[![npm license](https://img.shields.io/npm/l/vue-cooler-exposure?style=flat-square)](https://www.npmjs.com/package/vue-cooler-exposure)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

[中文说明](./README-CN.md)

A vue plugin used to exposure elements and record data. Here are the advantages:
- Be lighterweight, just do one thing is that exposure elements
- use the browser native API Intersectionobserver, better performance
- offer hooks which you can deal with the data of elements exposured

## Demo
```bash
npm install
npm run dev
```

## Requirements
- Vue 2.x

## Installation
### npm
```bash
npm install vue-cooler-exposure
```

## Usage
main.js:
```javascript
import Vue from 'vue';
import exposurePlugin from 'vue-cooler-exposure';

Vue.use(lazyloadPlugin);
// you can get $exposure in the prototype of Vue and Vue instance.
// register callback which would be called when visibility of some element has changed.
Vue.prototype.$exposure.addAfterRecordCallback
(exposureList => {
  console.log(exposureList);
  // upload exposureList or some ...
})
```

template:
```html
<div>
  <img v-exposure="data1" />
  <div v-exposure="data2"></div>
</div>
```
v-exposure would set the data, which you could get it in the callback args, in the element.

## Plugin Options
|key|description|default|options|
|---|-----------|-------|-------|
|border|the viewport you want to listen|{top: 0, bottom: 0, left: 0, right: 0}(window)|{top, bottom, left, right}|
|threshold|the proportion of element insert into viewport|1(1 means that when a whole element go into the viewport, callback would be excuted)|0~1|
|delay|a delay time for debounce(unit: ms)|800|number|

## APIs
|key|description|default param|type|
|---|-----------|-------|-------|
|addAfterRecordCallback|when visibility of some element has changed, it would be called and the arg is the list of data which elements in viewport take.|null|(exposureList): void|
|exposureCheck|call callback at once|no args|no args|

## Compatibility
The compatibility of this plugin depends on [compatibility of IntersectionObserver](https://caniuse.com/intersectionobserver)
## License
[MIT](./LICENSE)

repository: shnning/vue-cooler-exposure

gha_language: TypeScript

gha_license_id: MIT

repo_name: shnning/vue-cooler-exposure


text:
# React Thrux Router

[![Travis build](https://img.shields.io/travis/Thram/react-thrux-router.svg?style=flat-square)](https://travis-ci.org/Thram/react-thrux-router)
[![version](https://img.shields.io/npm/v/react-thrux-router.svg?style=flat-square)](https://www.npmjs.com/package/react-thrux-router)
[![downloads](https://img.shields.io/npm/dt/react-thrux-router.svg?style=flat-square)](https://www.npmjs.com/package/react-thrux-router)
[![MIT License](https://img.shields.io/npm/l/react-thrux-router.svg?style=flat-square)](https://opensource.org/licenses/MIT)

Cross Browser router for React using [Thrux](https://github.com/Thram/thrux) state manager.

### TODO Docs, for now just an Example:

`App.js`

```javascript
import React, {Component} from "react";
import Router from "thrux-router";
import Home from "./Home";
import First from "./First";
import Second from "./Second";

const routes = [
  {path: '/', component: Home},
  {path: '/first', component: First},
  {path: '/second', component: Second}
];

class App extends Component {
  render = () => (<Router routes={routes}/>)
}
```

`Home.js`

```javascript
import React, {Component} from "react";
import {setTab, openModal, closeModal} from "thrux-router";

class Home extends Component {
  render   = () => (
      <div>
        <h1>Home</h1>
        <a href="#/first?test=1&test2=2">First</a>
        <a href="#/second">Second</a>

        <button onClick={()=>openModal({component: Home})}>Set Modal</button>
        <button onClick={()=>closeModal()}>UnSet Modal</button>
        <button onClick={()=>setTab('sometab')}>Set Tab</button>
      </div>
  )
}

export default Home;
```

`First.js`

```javascript
import React, {Component} from "react";
import {goRoute} from "thrux-router";

class First extends Component {
  render   = () => (
      <div>
        <h1>First</h1>
        <button onClick={()=>goRoute('/second', {someProp: 1})}>Go Second</button>
      </div>
  )
}

export default First;
```

`Second.js`

```javascript
import React, {Component} from "react";
import {goRoute} from "thrux-router";

class Second extends Component {
  render   = () => (
      <div>
        <h1>Second</h1>
        <button onClick={()=>goRoute()}>Go Home</button>
      </div>
  )
}

export default Second;
```

repository: Thram/react-thrux-router

gha_language: JavaScript

repo_name: Thram/react-thrux-router


text:
# T-lang meeting agenda

* Meeting date 2020-10-12

## Attendance

* Team members: Niko, Scott, boats
* Others: simulacrum, Lokathor, areredify

## Before meeting checklist

* [x] Update the project board with new proposals
* [ ] Update the project board with new RFCs

## Pending proposals

* "MCP: pub(macro)" [lang-team#59](https://github.com/rust-lang/lang-team/issues/59)
    * inclined to place in FCP for close because:
        * macros are imperfect, we know, but
        * this problem was meant to be solved by hygiene
        * adding syntax doesn't make solving it easier
        * we'd rather wait and address macros 2.0 / hygiene more holistically
* "Restrict promotion to infallible operations" [lang-team#58](https://github.com/rust-lang/lang-team/issues/58)
    * we would like an RFC that pulls together the overall plan
    * supercedes old promotion RFC, builds on explicit syntax recently introduced
    * role of this RFC is to surface this change to the community and document/justify it
    * doesn't block implementation PRs from landing
        * like https://github.com/rust-lang/rust/pull/77526

## Project board review

Review the [Lang team project board](https://github.com/rust-lang/lang-team/projects/2) and get updates

## Nominated RFCs
  - "Safer Transmute" [rfcs#2981](https://github.com/rust-lang/rfcs/pull/2981)

## P-high issues on rust-lang/rust
  - No P-high issues this time.

## Nominated PRs and issues on rust-lang/rust
  - "Tracking issue for experiments around coercions, generics, and Copy type ergonomics" [rust#44619](https://github.com/rust-lang/rust/issues/44619)
      - Mark to move this content to a design note in the lang-team repo
      - We are still open to project proposals in this area but the issue isn't serving much function
          - probably what's required is implementation  experimentation
  - "resolve: Do not put nonexistent crate `meta` into prelude" [rust#75802](https://github.com/rust-lang/rust/pull/75802)
      - un-nominated, no update
  - "Switch `mutable_borrow_reservation_conflict` lint to deny by default" [rust#76104](https://github.com/rust-lang/rust/pull/76104)
      - Niko to leave a comment and we can circle back next week, would be good to have Josh around
  - "passes: `check_attr` on more targets" [rust#77015](https://github.com/rust-lang/rust/pull/77015)
      - Discussed the question of whether we should revisit our backwards compatibility policies
          - in particular, this is clearly a bug fix but we could choose to make it a deny-by-default lint nonetheless and phase in (e.g.) over an edition boundary if we really wanted a hard error
      - For now decided to land this change but to revisit this topic in future
      - If there is more breakage than anticipated we are happy to back out
  - "`use dep1::foo as dep1` is considered ambiguous on nightly but not beta" [rust#77586](https://github.com/rust-lang/rust/issues/77586)
      - Seems like a bug, we are content to let it ride the trains as it was recently introduced
      - No crater data, but the person who made the report is ok with the breakage
      - The ambiguity error makes sense to us
      - Again highlights the need for a more explicit policy around these sorts of decisions
  - "New "warning incompatible with previous forbid in same scope" error" [rust#77713](https://github.com/rust-lang/rust/issues/77713)
    * https://github.com/rust-lang/rust/issues/70819 was the original issue being fixed, was fixed by https://github.com/rust-lang/rust/pull/77534
    * In Rust 1.42, if you put `-Funused` and `-Aunused` on the command line, it was interpreted as a forbid and resulted
    * But in code, putting two attributes at the crate level was ignored (https://github.com/rust-lang/rust/issues/70819)
    * This code is in nightly but not in beta yet
    * Consensus points
        * definitely we should forbid in the crate if there is a forbid at the top level
            * because: if someone writes `forbid(unsafe_code)` and then someone PRs in some small line with `warn(unsafe_code)` on a module and then allow(unsafe_code) on an unsafe usage, that's really not what the person who wrote forbid wanted
            * note though that cap-lints does mean that you can't rely on forbid as a had guarantee (but also means that dependencies don't break)
        * top level should not be special, all levels should behave the same
        * we should at least warn, and maybe error, for `forbid` followed by `allow`
        * we can either accept, warn, or hard error for `allow` followed by `forbid`
    * On order dependence
        * There was some surprise at the idea of order dependence for top-level items
        * However other forms of attributes are order dependent (e.g., procedural macros)

repository: rust-lang/lang-team

repo_name: rust-lang/lang-team


text:
# How to contact us

Please send any issue that you feel affects the security of this module to
<EMAIL_ADDRESS>
# Expectations

Please do not log security concerns as GitHub issues, as that could alert attackers to a potential flaw. If you want to nudge us beyond the email to<EMAIL_ADDRESS>tell us you sent such an email (without the details) on another channel, such as:
* An issue here on GitHub, with an email address we can use to contact you
  for a more detailed report.
* Send an email to<EMAIL_ADDRESS>* Message [@snyksec](https://twitter.com/snyksec) on Twitter.

repository: shawnsnyk/broker

gha_license_id: NOASSERTION

repo_name: shawnsnyk/broker


text:
## Difference Between Maximum and Minimum Price Sum
[Leetcode](https://leetcode.com/problems/difference-between-maximum-and-minimum-price-sum)

There exists an undirected and initially unrooted tree with n nodes indexed from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

Each node has an associated price. You are given an integer array price, where price[i] is the price of the ith node.

The price sum of a given path is the sum of the prices of all nodes lying on that path.

The tree can be rooted at any node root of your choice. The incurred cost after choosing root is the difference between the maximum and minimum price sum amongst all paths starting at root.

Return the maximum possible cost amongst all possible root choices.

Example 1:

Input: n = 6, edges = [[0,1],[1,2],[1,3],[3,4],[3,5]], price = [9,8,7,6,10,5]
Output: 24
Explanation: The diagram above denotes the tree after rooting it at node 2. The first part (colored in red) shows the path with the maximum price sum. The second part (colored in blue) shows the path with the minimum price sum.
- The first path contains nodes [2,1,3,4]: the prices are [7,8,6,10], and the sum of the prices is 31.
- The second path contains the node [2] with the price [7].
The difference between the maximum and minimum price sum is 24. It can be proved that 24 is the maximum cost.

Example 2:

Input: n = 3, edges = [[0,1],[1,2]], price = [1,1,1]
Output: 2
Explanation: The diagram above denotes the tree after rooting it at node 0. The first part (colored in red) shows the path with the maximum price sum. The second part (colored in blue) shows the path with the minimum price sum.
- The first path contains nodes [0,1,2]: the prices are [1,1,1], and the sum of the prices is 3.
- The second path contains node [0] with a price [1].
The difference between the maximum and minimum price sum is 2. It can be proved that 2 is the maximum cost.

Constraints:

1 <= n <= 105

edges.length == n - 1

0 <= ai, bi <= n - 1

edges represents a valid tree.

price.length == n

1 <= price[i] <= 105

repository: iajaykarthick/Algo-Repertoire

branch_name: refs/heads/main

repo_name: iajaykarthick/Algo-Repertoire


text:
# AwsClientVpn

```text
aws-20210131/Architecture/NetworkingContent/AwsClientVpn
```

```text
include('aws-20210131/Architecture/NetworkingContent/AwsClientVpn')
```

| Illustration | AwsClientVpn | AwsClientVpnCard | AwsClientVpnGroup |
| :---: | :---: | :---: | :---: |
| ![illustration for Illustration](../../../aws-20210131/Architecture/NetworkingContent/AwsClientVpn.png) | ![illustration for AwsClientVpn](../../../aws-20210131/Architecture/NetworkingContent/AwsClientVpn.Local.png) | ![illustration for AwsClientVpnCard](../../../aws-20210131/Architecture/NetworkingContent/AwsClientVpnCard.Local.png) | ![illustration for AwsClientVpnGroup](../../../aws-20210131/Architecture/NetworkingContent/AwsClientVpnGroup.Local.png) |

## AwsClientVpn

### Load remotely
```plantuml
@startuml
' configures the library
!global $LIB_BASE_LOCATION="https://github.com/tmorin/plantuml-libs/distribution"

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('aws-20210131/bootstrap')

' loads the Item which embeds the element AwsClientVpn
include('aws-20210131/Architecture/NetworkingContent/AwsClientVpn')

' renders the element
AwsClientVpn('AwsClientVpn', 'Aws Client Vpn', 'an optional tech label')
@enduml
```

### Load locally
```plantuml
@startuml
' configures the library
!global $INCLUSION_MODE="local"
!global $LIB_BASE_LOCATION="../../.."

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('aws-20210131/bootstrap')

' loads the Item which embeds the element AwsClientVpn
include('aws-20210131/Architecture/NetworkingContent/AwsClientVpn')

' renders the element
AwsClientVpn('AwsClientVpn', 'Aws Client Vpn', 'an optional tech label')
@enduml
```

## AwsClientVpnCard

### Load remotely
```plantuml
@startuml
' configures the library
!global $LIB_BASE_LOCATION="https://github.com/tmorin/plantuml-libs/distribution"

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('aws-20210131/bootstrap')

' loads the Item which embeds the element AwsClientVpnCard
include('aws-20210131/Architecture/NetworkingContent/AwsClientVpn')

' renders the element
AwsClientVpnCard('AwsClientVpnCard', 'Aws Client Vpn Card', 'an optional description')
@enduml
```

### Load locally
```plantuml
@startuml
' configures the library
!global $INCLUSION_MODE="local"
!global $LIB_BASE_LOCATION="../../.."

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('aws-20210131/bootstrap')

' loads the Item which embeds the element AwsClientVpnCard
include('aws-20210131/Architecture/NetworkingContent/AwsClientVpn')

' renders the element
AwsClientVpnCard('AwsClientVpnCard', 'Aws Client Vpn Card', 'an optional description')
@enduml
```

## AwsClientVpnGroup

### Load remotely
```plantuml
@startuml
' configures the library
!global $LIB_BASE_LOCATION="https://github.com/tmorin/plantuml-libs/distribution"

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('aws-20210131/bootstrap')

' loads the Item which embeds the element AwsClientVpnGroup
include('aws-20210131/Architecture/NetworkingContent/AwsClientVpn')

' renders the element
AwsClientVpnGroup('AwsClientVpnGroup', 'Aws Client Vpn Group', 'an optional tech label') {
    note as note
        the content of the group
    end note
}
@enduml
```

### Load locally
```plantuml
@startuml
' configures the library
!global $INCLUSION_MODE="local"
!global $LIB_BASE_LOCATION="../../.."

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('aws-20210131/bootstrap')

' loads the Item which embeds the element AwsClientVpnGroup
include('aws-20210131/Architecture/NetworkingContent/AwsClientVpn')

' renders the element
AwsClientVpnGroup('AwsClientVpnGroup', 'Aws Client Vpn Group', 'an optional tech label') {
    note as note
        the content of the group
    end note
}
@enduml
```

repository: VinayaSathyanarayana/plantuml-libs

repo_name: VinayaSathyanarayana/plantuml-libs


text:
# SparkHelper [![Build Status](https://travis-ci.org/XavierGuihot/spark_helper.svg?branch=master)](https://travis-ci.org/XavierGuihot/spark_helper)

## Overview

Version: 1.0.4

API Scaladoc: [SparkHelper](http://xavierguihot.github.io/spark_helper/#com.spark_helper.SparkHelper$)

This library contains a bunch of low-level basic methods for data processing
with Scala Spark.
* [SparkHelper](http://xavierguihot.github.io/spark_helper/#com.spark_helper.SparkHelper$): Hdfs file manipulations through the Spark API.
* [DateHelper](http://xavierguihot.github.io/spark_helper/#com.spark_helper.DateHelper$): Wrapper around [joda-time](http://www.joda.org/joda-time/apidocs/) for dates manipulations.
* [FieldChecker](http://xavierguihot.github.io/spark_helper/#com.spark_helper.FieldChecker$): Validation for stringified fields
* [Monitor](http://xavierguihot.github.io/spark_helper/#com.spark_helper.monitoring.Monitor$): Spark custom monitoring/logger and kpi validator

The goal is to remove the maximum of highly used and highly duplicated low-level
code from the spark job code and replace it with methods fully tested whose
names are self-explanatory and readable.

## Using spark_helper:

### HdfsHelper:

The full list of methods is available at [HdfsHelper](http://xavierguihot.github.io/spark_helper/#com.spark_helper.HdfsHelper$).

Contains basic file-related methods mostly based on hdfs apache Hadoop
FileSystem API [org.apache.hadoop.fs.FileSystem](https://hadoop.apache.org/docs/r2.6.1/api/org/apache/hadoop/fs/FileSystem.html).

A few exemples:

	import com.spark_helper.HdfsHelper

	// A bunch of methods wrapping the FileSystem API, such as:
	HdfsHelper.fileExists("my/hdfs/file/path.txt")
	assert(HdfsHelper.listFileNamesInFolder("my/folder/path") == List("file_name_1.txt", "file_name_2.csv"))
	assert(HdfsHelper.getFileModificationDate("my/hdfs/file/path.txt") == "20170306")
	assert(HdfsHelper.getNbrOfDaysSinceFileWasLastModified("my/hdfs/file/path.txt") == 3)

	// Some Xml helpers for hadoop as well:
	HdfsHelper.isHdfsXmlCompliantWithXsd("my/hdfs/file/path.xml", getClass.getResource("/some_xml.xsd"))

### SparkHelper:

The full list of methods is available at [SparkHelper](http://xavierguihot.github.io/spark_helper/#com.spark_helper.SparkHelper$).

Contains basic file/RRD-related methods based on the Spark APIs.

A few exemples:

	import com.spark_helper.SparkHelper

	// Same as SparkContext.saveAsTextFile, but the result is a single file:
	SparkHelper.saveAsSingleTextFile(myOutputRDD, "/my/output/file/path.txt")
	// Same as SparkContext.textFile, but instead of reading one record per line,
	// it reads records spread over several lines:
	SparkHelper.textFileWithDelimiter("/my/input/folder/path", sparkContext, "---\n")

### DateHelper:

The full list of methods is available at [DateHelper](http://xavierguihot.github.io/spark_helper/#com.spark_helper.DateHelper$).

Wrapper around [joda-time](http://www.joda.org/joda-time/apidocs/) for dates manipulations.

A few exemples:

	import com.spark_helper.DateHelper

	assert(DateHelper.daysBetween("20161230", "20170101") == List("20161230", "20161231", "20170101"))
	assert(DateHelper.today() == "20170310") // If today's "20170310"
	assert(DateHelper.yesterday() == "20170309") // If today's "20170310"
	assert(DateHelper.reformatDate("20170327", "yyyyMMdd", "yyMMdd") == "170327")
	assert(DateHelper.now("HH:mm") == "10:24")

### FieldChecker

The full list of methods is available at [FieldChecker](http://xavierguihot.github.io/spark_helper/#com.spark_helper.FieldChecker$).

Validation (before cast) for stringified fields:

A few exemples:

	import com.spark_helper.FieldChecker

	assert(FieldChecker.isInteger("15"))
	assert(!FieldChecker.isInteger("1.5"))
	assert(FieldChecker.isInteger("-1"))
	assert(FieldChecker.isStrictlyPositiveInteger("123"))
	assert(!FieldChecker.isYyyyMMddDate("20170333"))
	assert(FieldChecker.isCurrencyCode("USD"))

### Monitor:

The full list of methods is available at [Monitor](http://xavierguihot.github.io/spark_helper/#com.spark_helper.monitoring.Monitor).

It's a simple logger/report that you update during your job. It contains a
report (a simple string) that you can update and a success boolean which can
be updated to give a success status on your job. At the end of your job you'll
have the possibility to store the report in hdfs.

Have a look at the [scaladoc](http://xavierguihot.github.io/spark_helper/#com.spark_helper.monitoring.Monitor)
for a cool exemple.

## Including spark_helper to your dependencies:

With sbt, just add this one line to your build.sbt:

	libraryDependencies += "spark_helper" % "spark_helper" % "1.0.4" from "https://github.com/xavierguihot/spark_helper/releases/download/v1.0.4/spark_helper-1.0.4.jar"

## Building the project:

With sbt:

	sbt assembly


text:
# Radix Playground: McElfish

To run the project locally, you need docker:

```
docker build -t mcelfish .
docker run -p 8000:8000 mcelfish
```

# Steps for setting up a Radix service

## Setting up the repository

1. Create a repository on GitHub (e.g.) `equinor/radix-mcelfish` (public)
1. add collaborators to have triage/write/maintain access
1. Warning: GitHub now defaults to `main` as the initial branch, but
   Radix expects `master`.  You might need to change the default branch.

## Follow the _Getting Started_ guide

1. Create configuration file (`radixconfig.yaml`)
1. Register Radix playground app in the [console](https://console.playground.radix.equinor.com/applications)
1. Add deploy key according to the guide
1. Add webhook according to the guide

## Kickstart the pipelines

For each environment (`prod`, `dev`, `test`, `qa`, etc) you might need
to manually start the new job.

Press _new job_ under `/applications/<name>/jobs/new`.

# Resources and inspiration

- [radix.equinor.com](https://www.radix.equinor.com)
- [radix.equinor.com/guides/getting-started/](https://www.radix.equinor.com/guides/getting-started/)
- [github.com/keaaa/hello-world](https://github.com/keaaa/hello-world)
- [github.com/equinor/radix-example-workshop-1](https://github.com/equinor/radix-example-workshop-1)
- [console.playground.radix.equinor.com/applications/xample-5-nodejs/envs/prod/component/x5n](https://console.playground.radix.equinor.com/applications/xample-5-nodejs/envs/prod/component/x5n)

repository: equinor/radix-mcelfish

repo_name: equinor/radix-mcelfish


text:
# todo-cobra-cli

CLI will fetch todo by ID as provided by the user

## Steps to run the project

1. Run `go get` command in the root directory
2. Then do `go install mytodo`. This will install mytodo as binary package in your gopath
3. Run `mytodo 45` or any number between 1-200
4. And you will get the result

## Sample

```bash
$ mytodo 23

UserId is : 2
Todo Id is : 23
Todo title is : et itaque necessitatibus maxime molestiae qui quas velit
Completion status is : false
```

repository: ankithans/todo-cobra-cli

repo_name: ankithans/todo-cobra-cli


text:
---
layout: post
title: "turbolinks"
date: 2013-09-25 10:27
comments: true
categories: rails4 turbolinks
---

Turbolinks replaces the body of the page but doesn't reload the header files. This limits the number of calls and makes the site appear faster to the user by a noticeable margin.

###To remove turbolinks for Rails 4
  - (3 steps from Steve Klabnik)[http://blog.steveklabnik.com/posts/2013-06-25-removing-turbolinks-from-rails-4]

###Breaking my JS
  - Turbolink breaks my JS calls when the page loads up the Facebook SDK. So I started disabling turbolinks on certain pages in my HAML a tag with the "data-no-turbolink" option `= link_to 'add friends', next_wizard_path, "data-no-turbolink" => "true"`
  - There are also events that one can hook into. They are (listed here)[https://github.com/rails/turbolinks/#events].
  - You can also put the click event on the doc rather than the element which will solve this issue. In this case ajax tasks would also have the click event applied to them as well.

```ruby Click Event on doc rather than element
$('document').on 'click', '.edit_task input[type=checkbox]', ->
    $(this).parent('form').submit()
```

###The jquery turbolinks gem
  - Using (the gem)[https://github.com/kossnocorp/jquery.turbolinks] just straight fixes it. This likely means that the turbolinks is disabled for all jquery related calls.

###Reading
  - a (basic summary by treehouse)[http://blog.teamtreehouse.com/rails-4-a-look-at-turbolinks]

repository: adamjonas/blog

repo_name: adamjonas/blog


text:
DTIToastCenter-Swift
====================

A toast center inspired from TKAlertCenter (tapku library) for displaying quick toast to the user written in full swift with great animation.
> Toasts are bounded to keyWindow to handle screen rotation and resize/move when keyboard is shown/hidden.

- Center can be called from both swift or objc project.
- This component require **Xcode6.1** to compile.

<img src="Shots/toastcenter.gif"/>

### Installation

> For application targets that do not support embedded frameworks, such as iOS 7, DTIToastCenter can be integrated by including the `*.swift` source files directly.

_Due to the current lack of [proper infrastructure](http://cocoapods.org) for Swift dependency management, using DTIToastCenter in your project requires the following steps:_

1. Add DTIToastCenter as a [submodule](http://git-scm.com/docs/git-submodule) by opening the Terminal, `cd`-ing into your top-level project directory, and entering the command `git submodule add https://github.com/dtissera/DTIToastCenter-Swift.git`
2. Open the `DTIToastCenter` folder, and drag `DTIToastCenter.xcodeproj` into the file navigator of your app project.
3. In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar.
4. Ensure that the deployment target of DTIToastCenter.framework matches that of the application target.
5. In the tab bar at the top of that window, open the "Build Phases" panel.
6. Expand the "Target Dependencies" group, and add `DTIToastCenter.framework`.
7. Click on the `+` button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add `DTIToastCenter.framework`.
8. If you are using this component in an `objc target`, flag ```Embedded Content Contains Swift Code``` in the `Build Settings` needs to be set to `YES`.

---

### Usage

Initialize center in your application delegate to listen keyboard events

#### objc
**Register center**
```objc
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [[DTIToastCenter defaultCenter] registerCenter];
    return YES;
}
```

**Post alert with text**
```objc
[[DTIToastCenter defaultCenter] makeText:@"Hey! This is the toast system."];
```

**Post alert with image**
```objc
[[DTIToastCenter defaultCenter] makeImage:[UIImage imageNamed:@"swift"]];
```

**Post alert with image and text**
```objc
[[DTIToastCenter defaultCenter] makeText:@"Toast with image !" image:[UIImage imageNamed:@"swift"]];
```

repository: AlexeyS/DTIToastCenter-Swift

gha_language: Swift

repo_name: AlexeyS/DTIToastCenter-Swift


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.2.0] - 2020-10-24
### Added
- Added information on Average Block Time
- Added function to put automatic labels in hashrate

### Fixed
- Fix errors in Network Hasrate statistics

## [1.1.0] - 2020-10-08
### Added
- Commands to enable and disable payment notifications

### Changed
- Command names to enable and disable worker status notifications
- Modified obsolete methods for pyMongo

repository: ahonder/bot-openethereumpool

repo_name: ahonder/bot-openethereumpool


text:
# wrap-hook

## Install

`npm i -S wrap-hook`

## How to use

```js
import wraphook from 'wrap-hook'

const TRUSY_BEFORE = () => true;
const AFTER_CALL = ()=>{ console.log('after is called!')}

const wrapped = wraphook({ before: TRUSY_BEFORE, after: AFTER_CALL });
wrapped((callback) => {
  console.log('write business code here.')
  callback();
});
// write business code here.
// after is called!
```

```js
import wraphook from 'wrap-hook'

const FALSY_BEFORE = () => false;
const AFTER_CALL = ()=>{ console.log('after is called!')}

const wrapped = wraphook({ before: FALSY_BEFORE, after: AFTER_CALL });
wrapped((callback) => {
  console.log('write business code here.')
  callback();
});
// no log!
```

repository: JaysonHwang/wrap-hook

repo_name: JaysonHwang/wrap-hook


text:
# NYT Spaghetti Carbonara

## Overview

- Yield: 4 servings
- Total Time: 25 mins

## Ingredients

- 12 ounces spaghetti (about 3/4 box)

- 3½ ounces of slab guanciale (see recipe), pancetta or bacon, sliced into pieces about 1/4 inch thick by 1/3 inch square

- 2 large eggs and 2 large yolks, room temperature

- 1 ounce (about 1/3 packed cup) grated pecorino Romano, plus additional for serving

- 1 ounce (about 1/3 packed cup) grated Parmesan

- coarsely ground black pepper

- 1 Tablespoon olive oil

## Method

1. Place a large pot of lightly salted water (no more than 1 tablespoon salt) over high heat, and bring to a boil. Fill a large bowl with hot water for serving, and set aside.
---
2. In a mixing bowl, whisk together the eggs, yolks and pecorino and Parmesan. Season with a pinch of salt and generous black pepper.
---
3. Set the water to boil. Meanwhile, heat oil in a large skillet over medium heat, add the pork, and sauté until the fat just renders, on the edge of crispness but not hard. Remove from heat and set aside.
---
4. Add pasta to the water and boil until a bit firmer than al dente. Just before pasta is ready, reheat guanciale in skillet, if needed. Reserve 1 cup of pasta water, then drain pasta and add to the skillet over low heat. Stir for a minute or so.
---
5. Empty serving bowl of hot water. Dry it and add hot pasta mixture. Stir in cheese mixture, adding some reserved pasta water if needed for creaminess. Serve immediately, dressing it with a bit of additional grated pecorino and pepper.
---

## References and Acknowledgments

[NYT](https://cooking.nytimes.com/recipes/12965-spaghetti-carbonara)

## Tags
verified

repository: troyerta/recipes

gha_language: Python

repo_name: troyerta/recipes


text:
# **PIZZA 'n CHILL**
#### Pizza n' Chill is an online pizza store that enables customers to order for different pizza types.
#### By **Cheboi Derrick**
## Description
The website allows a user to place an order for a pizza and be notified of the total cost. The user can then decide to have a delivery or a pickup. If the user uses a delivery, they need to be prompted for their name and a location for the delivery.
The cost of the pizza depends on the size, type of crust and the toppings a customer chooses. The user input should also be validated to avoid erroneus orders.
## **Website Design**
<img src="./images/Pizza 'n Chill (1).png">

## Setup/Installation Requirements
* Clone the repository to your computer from [here](https://github.com/CheboiDerrick/pizzacart)
* Open the project using your preferred code editor preferably Visual Studio Code
* Open the project using a web browser preferably Google Chrome
## Known Bugs
There are no known bugs so far.
## Technologies Used
The website has been developed using the following:
- HTML
- CSS
- Bootstrap
- jQuery
- You can also live view the website [here](https://cheboiderrick.github.io/pizzacart/)

## Support and contact details
Feel free to give suggestions or bugs and possible suggestions through:
-<EMAIL_ADDRESS>### License
[MIT](https://github.com/CheboiDerrick/pizzacart/blob/main/LICENSE)
Copyright (c) 2021

repository: CheboiDerrick/pizzacart

repo_name: CheboiDerrick/pizzacart


text:
#### Integrations
##### Active Directory Query v2
- Fixed an issue in which the ***ad-get-group-members*** command did not return all members.
- Updated the Docker image to: *demisto/python3:<IP_ADDRESS>342*.

repository: demisto/content

repo_name: demisto/content


text:
# 📓Release

## 3.0.3 - 2021-06-24

### New  Features

* Add status info at homepage. When the bridge service is suspended, there will be a warning.

![](.gitbook/assets/1-not-connect.png)

## 3.0.2 - 2021-06-18

### New  Features

* **Disable Memo** when Binance Chain is chosen as the destination network
* Block orders with centralized exchange deposit address as the destination

## 3.0.1 - 2021-06-10

### New  Features

* **ETH network ETH max swap amount**:  When the user chooses to swap ETH to pegged ETH, the max amount will be ETH balance - estimated transfer fee; Add a reminder message of change: The estimated max amount is your ETH balance minus the estimated gas fee
*  Add "[**Refund History**](guides/binance-bridge-history-page.md#refund-history)" to History page: With the release of Bridge V3, the refund process for the following orders between BSC and Ethereum will be automatic. Users can check the refund tx easily

## 3.0.0 - 2021-04-27

### New  Features

* Add network
* Add Token to MetaMask
* The refund process for the following orders between BSC and Ethereum will only take about an hour from **2021/5/26 14:00PM（SGT）**:
  * Failed deposit
  * Send multiple deposits for the same order
  * Deposit after the swap becomes to 'DepositTimeout'
  * fromAddress is different from walletAddress

### Changed

* When swap tokens between BSC and Ethereum, connected network must be the same as fromNetwork
* When swap tokens between BSC and Ethereum, toAddress and walletAddress must  be the same

## 2.1.0 - 2021-01-27

### New  Features

* [Buy BNB as gas](guides/buy-bnb-as-gas.md)

## [2.0.0](https://www.binance.org/en/blog/binance-bridge-v2-release/) - 2020-12-22

### New  Features

* Switch between V1 and V2
* New UI

### Changed

* Remove "Peg-in" and "'Peg-out".

[Doc Link]()

## [1.0.0 ](https://www.binance.com/en/support/announcement/b763da0c6ace4e32bf8e65844e6c72e2)- 2020-11-06 \[Deprecated\]

### Added

* This is the first release

[Doc Link](guides/binance-bridge-v1.md)


text:
# gnugo.js
port gnugo to javascript with emscripten

`build_gnugo.sh` is used to generate necessary step database

`rebuild_gnugo_with_em.sh` is used to generate `gnugo.js`

`gnugowrapper.c` is the main source file for `gnugo.js` to export APIs from `GNU-Go` (much code copied from `play_ascii.c` from `gnugo` source)

To compile gnugo correctly:
- disable clock functionality: make `gg_gettimeofday` return 0 directly

Currently we support APIs:

- `Module._initializeGoGame(boardSize, komi, handicap, randomSeed)`
- `Module._finalizeGoGame()`
- `Module._getBoard(i, j)`
- `Module._isLastMove(i, j)`
- `Module._genNextStep()`: make computer put current stone at a proper place
- `Module._moveTo(i, j)`: put current stone at (i,j), where 0 < i,j < size

after compiled out `gnugo.js`, try `test.html` with it. if want to interact with the board, open browser console panel,
and try `Module._moveTo(0, 0); showBoard(syncBoard(board))` to put one stone at `A1`.


text:
# Air Quality Index Crystal
![gif](https://raw.githubusercontent.com/andrewlrogers/AQI_Crystal/master/AQI_Crystal.gif "A gif showing the crystal in action")
#### About
For the past week smoke and particulate matter from the Camp Fire in Northern California has lingered in San Francisco, creating a hazardous environment. The EPA ranks the air quality with the Air Quality Index, a value that ranges from 0 - 500. San Francisco often stays in the 'good' range of 0-50, but recently was in the 'very-unhealthy' range. School and businesses have been canceling activities and government officials are encouraging residents to shelter indoors and wear a NIOSH N95 mask when outdoors.

As we increasingly deal with the impact of global climate change it seemed appropriate to create a visualization of the AQI, so I can determine if I need to wear a mask before heading outdoors. Fortunately, the EPA has an API for checking the current AQI by zipcode at [airnowapi.org](https://airnowapi.org). Additionally, the EPA has assigned colors for the different ranges and provides [specific hexidecimal color codes](https://docs.airnowapi.org/aq101) for each.

This project checks the AQI at a regular interval and adjusts the color of a series of LEDS. The project is fit inside a selenite crystal lamp because it diffuses the colors and looks really cool.

#### Why Micropython and not Circuit Python?
I explored Circuit Python because I was interested in using the Adafruit Fancy Led library, but ultimately Circuit Python lacked a `urequests` alternative.

## Materials

+ [1 Adafruit Feather HUZZAH with ESP8266](https://www.adafruit.com/product/2821)
+ [1 NeoPixel Ring - 12 x 5050 RGB LED](https://www.adafruit.com/product/1643)
+ [1 Selenite Crystal Lamp](https://www.amazon.com/Selenite-Crystal-Electric-lamp-Cord/dp/B077LD5P5G/ref=asc_df_B077LD5P5G/?tag=hyprod-20&linkCode=df0&hvadid=242019590558&hvpos=1o5&hvnetw=g&hvrand=3662701919086755367&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9031945&hvtargid=aud-466346483690:pla-429162419688&psc=1)
+ Assorted wires and tools including soldering iron

## Assembly
1. Solder wires to NeoPixel Ring
2. Solder wires to Feather HUZZAH
  * Connect ground to ground, 3v to 3v, and Data in to Pin 14
3. Slide into the Selenite Crystal

## Setup and Configuration
1. [Download and install micropython on the Feather HUZZAH](https://learn.adafruit.com/micropython-basics-how-to-load-micropython-on-a-board/)
2. Download or Clone this repository
3. Open `boot.py` and add your `SSID` and `SSID_PW`
4. Request API Access at [airnowapi.org](https://airnowapi.org)
  * Copy your **top secret** API KEY
5. Open `main.py` and add your `API_KEY` and `ZIP_CODE` as a string
6. [Load the code onto the Feather HUZZAH] (https://learn.adafruit.com/micropython-basics-load-files-and-run-code/overview)

## Resources
1. [airnowapi.org](https://airnowapi.org)
3. [video trailer on Vimeo](https://vimeo.com/301542921)


text:
# whim-bot

Built with Serverless >= 1.8, deploys to AWS directly.

* Create a bot at [Bot Framework](https://botframework.com)
* Create a Facebook [Page and a Facebook app](https://developer.facebook.com)
* Configure your project by editing `serverless.yml`
* Configure your environment by creating `dev-env.yml` based on the sample given
* Set up [Serverless](https://serverless.com)

```
npm install
sls deploy --region eu-west-1
```

## Updating the persistent menu

```
curl -X POST -H "Content-Type: application/json" -d @persistent-menu.json "https://graph.facebook.com/v2.6/me/thread_settings?access_token=$FACEBOOK_PAGE_TOKEN"
```

## About this project

Note that this is a proof-of-concept, at best, at the moment. So treat it as such - code isn't well structured and the flow has some holes in it. But the point is to show what can be done with this setup in rather short amount of time.

repository: wethil/whim-bot

repo_name: wethil/whim-bot


text:
# Off-axis projection in Unity

A bare-minimum example project for getting off-axis projection up and running in Unity.

![pr](img/head-coupled-perspective.gif)

This work is based on the article found [here](https://medium.com/@michel.brisis/off-axis-projection-in-unity-1572d826541e?source=friends_link&sk=1884d03651947a41cd553168714cbfb6).

The application can be executed as follows:

- Run 'off-axis-projection.exe' found in the Built-Application folder.
- From console, access the Python-tracking directory >> cd C:\<path>\off-axis-projection-unity-master\Python-tracking
- Run >>python main.py

The application should begin showing the off-axis perspective as shown in this [video](https://drive.google.com/file/d/11oc2YuKHkMvqdLqCBxBuSGJyH_6QfDcP/view?usp=sharing).

## Intelligent desktop

To run object detection part, run object_detection_darkflow.py file from Python-tracking folder. Darkflow framework should be installed previously, as explained in the following link: https://towardsdatascience.com/yolov2-object-detection-using-darkflow-83db6aa5cf5f. Video showing the demo of the application is present in the following link: https://drive.google.com/open?id=1zB8pSATkNv59yAFRSDUCvrFnwwERF9Cx.

For exiting the applications just press Esc.

repository: ujemd/off-axis-projection-unity

gha_language: C#

repo_name: ujemd/off-axis-projection-unity


text:
---
layout: single
author_profile: true
title: About
permalink: /about/
modified: 2022-10-12
header:
  overlay_image: images/porcupine_road.jpg
---

Hello!

I'm Paul T Baker.
I'm an assistant professor in the Department of Physics and Astronomy at [Widener University][wu-me].
I teach physics and study gravitational waves.

Before coming to Widener, I was a postdoctoral fellow at the [Center for Gravitational Waves and Cosmology][gwac] at West Virginia University.
I have also taught as a visiting assistant professor at SUNY Geneseo, a public liberal arts college that is home to one of the largest all undergrad physics departments in the country.

My research is mostly about on gravitational wave data analysis techniques.
Particularly, I'm interested detecting and characterizing gravitational wave signals.
I used to work on [LIGO][ligo] starting way back in 2007, when I was a graduate student.
More recently have been working on detecting gravitational waves with pulsar timing arrays (PTA).
I'm a member of [NANOGrav][nano], the North American Nanohertz Observatory for Gravitational waves, which seeks to detect low frequecy gravitational waves by timing radio pulsars.
NANOGrav is one of four PTAs that jointly form the [International Pulsar Timing Array][ipta].

Over my life, I've lived in New York, Pennsylvania, Oregon, Montana, West Virginia, and Delaware.
The banner photo is a view down Porcupine Rd from [my favorite forest service cabin][porc] in the Crazy Mountains north of Livingston, Montana.

[wu-me]: https://www.widener.edu/about/faculty-directory/paul-t-baker
[gwac]: https://gwac.wvu.edu
[ligo]: http://www.ligo.org
[nano]: http://www.nanograv.org
[ipta]: http://www.ipta4gw.org
[porc]: https://www.google.com/maps/@46.1127739,-110.4733903,702m/data=!3m1!1e3

gha_language: Jupyter Notebook