text:
<p align="center">
[Session](Session.md) • [**User**](User.md) • [Track](Track.md) • [Resolve](Resolve.md)
</div>

User
===============

### Load user by identifier:

Swift 3.0, 2.3
```swift
User.user(identifier: Int, completion: SimpleAPIResponse<User> -> Void)
```

### Load list of user's tracks:

Swift 3.0, 2.3
```swift
let user: User
user.tracks(completion: PaginatedAPIResponse<Track> -> Void)
```

### Load list of user's comments:

Swift 3.0, 2.3
```swift
let user: User
user.comments(completion: PaginatedAPIResponse<Comment> -> Void)
```

### Load list of user's favorite tracks:

Swift 3.0, 2.3
```swift
let user: User
user.favorites(completion: PaginatedAPIResponse<Track> -> Void)
```

### Load list of user's followers:

Swift 3.0, 2.3
```swift
let user: User
user.followers(completion: PaginatedAPIResponse<User> -> Void)
```

### Load list of user's followings:

Swift 3.0, 2.3
```swift
let user: User
user.followings(completion: PaginatedAPIResponse<User> -> Void)
```

Private Methods
---------------

### User's profile:

Swift 3.0, 2.3
```swift
let session = Soundcloud.session
session?.me(completion: SimpleAPIResponse<User> -> Void)
```

### Follow a user:

Swift 3.0, 2.3
```swift
let user: User
user.follow(userIdentifier: Int, completion: SimpleAPIResponse<Bool> -> Void)
```

### Unfollow a user:

Swift 3.0, 2.3
```swift
let user: User
user.unfollow(userIdentifier: Int, completion: SimpleAPIResponse<Bool> -> Void)
```


text:
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var htmlreplace = require('gulp-html-replace');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var watchify = require('watchify');
var reactify = require('reactify');
var streamify = require('gulp-streamify');
//指定文件输入和输出路径
var path = {
    HTML: 'src/index.html',
    MINIFIED_OUT: 'build.min.js',
    OUT: 'build.js',
    DEST: 'dist',
    DEST_BUILD: 'dist/build',
    DEST_SRC: 'dist/js',
    ENTRY_POINT: './src/jsx/App.js'
};

////复制index.html文件
//gulp.task('copy', function(){
//    gulp.src(path.HTML)
//        .pipe(gulp.dest(path.DEST));
//});

gulp.task('replaceHtml', function(){
    gulp.src(path.HTML)
        .pipe(htmlreplace({
            'js': 'js/' + path.OUT
        }))
        .pipe(gulp.dest(path.DEST));
});

gulp.task('watch', ['replaceHtml'], function() {
    gulp.watch(path.HTML, ['replaceHtml']); //1、监视index.html,一有变动执行replaceHtml任务

    var watcher  = watchify(browserify({
        entries: [path.ENTRY_POINT],
        transform: [reactify],
        debug: true,
        cache: {},
		packageCache: {},
		fullPaths: true
    }));

    return watcher.on('update', function () {
            watcher.bundle()
                .pipe(source(path.OUT))
                .pipe(gulp.dest(path.DEST_SRC))
            console.log('Updated');
        })
        .bundle()
        .pipe(source(path.OUT))
        .pipe(gulp.dest(path.DEST_SRC));
});
//默认任务
gulp.task('default', ['watch']);

//***************production生产版**********
gulp.task('build',  function(){
    browserify({
        entries: [path.ENTRY_POINT],
        transform: [reactify]
    })
        .bundle()
        .pipe(source(path.MINIFIED_OUT))
        .pipe(streamify(uglify(path.MINIFIED_OUT)))
        .pipe(gulp.dest(path.DEST_BUILD));
});

gulp.task('replaceHTML', function(){
    gulp.src(path.HTML)
        .pipe(htmlreplace({
            'js': 'build/' + path.MINIFIED_OUT
        }))
        .pipe(gulp.dest(path.DEST));
});

gulp.task('production', ['replaceHTML', 'build']);

redpajama_set_name: RedPajamaGithub


text:
Dashboard to view in de status of a ArcGIS FeatureService

## Instructions
Change the map/feature services in app/dashboard.js and start the application


text:
package com.github.windbender.chpcadscraper;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.geojson.Feature;
import org.geojson.FeatureCollection;

import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Slf4j
public class NWSScrapper {
    private final String alertZone;
    private final ObjectMapper objectMapper;
    public static void main(String[] args) {
        NWSScrapper c  = new NWSScrapper("CAZ507");
        c.scrape();

    }
    public NWSScrapper( String alertZone) {
        this.alertZone = alertZone;
        objectMapper = new ObjectMapper();
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    }

    public synchronized Map<String,Feature> scrape() {
        try {
            String cadDataUrl = new String("https://api.weather.gov/alerts/active/zone/"+this.alertZone);

            InputStream inputStream = new URL(cadDataUrl).openStream();

            FeatureCollection featureCollection = objectMapper.readValue(inputStream, FeatureCollection.class);

            Map<String,Feature> l = featureCollection.getFeatures().stream().filter(f -> {
                Object o = f.getProperties().get("event");
                return "Red Flag Warning".equalsIgnoreCase((String) o);
            }).collect(Collectors.toMap(Feature::getId, f->f));

            return l;
        } catch(Exception e) {
            emailAdmin("could not parse NWS alerts for "+alertZone+"  because  "+e);
            log.error("can't parse NWS stuff because ",e);
        }
        return new HashMap<>();
    }

    private void emailAdmin(String s) {
    }
}


text:
package com.airbnb.aerosolve.core.features;

import lombok.Getter;

public class ScoringFeature implements Comparable<ScoringFeature> {
  @Getter
  private String name;
  @Getter
  private Integer type;

  public ScoringFeature(String name, Integer type) {
    this.name = name;
    this.type = type;
  }
  public int compareTo(ScoringFeature other) {
    return this.getName().compareTo(other.getName());
  }
}


text:
import ActionTypes from './actionTypes';

function increment(index) {
  return {
    type: ActionTypes.L_INCREMENT_LIKES,
    index,
  };
}

function addComment(postId, author, comment) {
  return {
    type: ActionTypes.CM_ADD_COMMENT,
    postId,
    author,
    comment,
  };
}

function removeComment(postId, i) {
  return {
    type: ActionTypes.CM_DELETE_COMMENT,
    postId,
    i,
  };
}


text:
package org.pentaho.di.core.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.pentaho.di.core.Const;
import org.pentaho.di.core.logging.LogChannelInterface;

public class StreamLogger implements Runnable
{
    private InputStream is;

    private String      type;

	private LogChannelInterface	log;

    public StreamLogger(LogChannelInterface log, InputStream is, String type)
    {
    	this.log = log;
        this.is = is;
        this.type = type;
    }

    public void run()
    {
        try
        {
            InputStreamReader isr = new InputStreamReader(is);
            BufferedReader br = new BufferedReader(isr);
            String line = null;
            while ((line = br.readLine()) != null)
            {
                log.logBasic(type + " " + line); //$NON-NLS-1$
            }
        }
        catch (IOException ioe)
        {
            log.logError(type + " " + Const.getStackTracker(ioe)); //$NON-NLS-1$
        }
    }
}


text:
import { commitMutation, graphql } from 'react-relay'

const mutation = graphql`
  mutation ToDoUpdateRenameMutation($input: ToDoUpdateRenameInput!) {
    ToDoUpdateRename(input: $input) {
      ToDo {
        id
        ToDo_Text
      }
    }
  }
`

function commit( environment, aToDo, ToDo_Text ) {
  return commitMutation( environment, {
    mutation,
    variables: {
      input: { id: aToDo.id, ToDo_Text },
    },

    optimisticResponse() {
      return {
        ToDoUpdateRename: {
          ToDo: {
            id: aToDo.id,
            ToDo_Text,
          },
        },
      }
    },
  })
}

export default { commit }


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ page.title }}</title>

    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">

    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">

    <link rel="stylesheet" href="/public/css/site.css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    Toggle navigation

                </button>
                {{ site.name }}

Source

Issues

Nuget

                      Documentation

Quick Start

Overview

Duck Proxies

Safe Proxies

Intercept Proxies

    {{ content }}


text:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MLifter.BusinessLayer;
using MLifter.DAL.Interfaces;
using System.IO;

namespace MLifterTest.BusinessLayer
{
    [TestClass]
    public class OfflineModulesTest
    {
        static string tempFolder;
        LearningModulesIndexEntry lm1;
        LearningModulesIndexEntry lm2;

        /// <summary>
        /// Initializes a new instance of the <see cref="RecentLearningModulesTest"/> class.
        /// </summary>
        /// <remarks>Documented by Dev07, 2009-03-03</remarks>
        public OfflineModulesTest()
        {
            tempFolder = Path.Combine(Path.GetTempPath(), "ML_Temp");
            Directory.CreateDirectory(tempFolder);

            File.Create(Path.Combine(tempFolder, "lm1.mlm"));
            File.Create(Path.Combine(tempFolder, "lm2.mlm"));

            lm1 = new LearningModulesIndexEntry();
            lm2 = new LearningModulesIndexEntry();
            ConnectionStringStruct css1 = new ConnectionStringStruct();
            css1.ConnectionString = Path.Combine(tempFolder, "lm1.mlm");
            css1.Typ = MLifter.DAL.DatabaseType.MsSqlCe;
            css1.LmId = 1;

            ConnectionStringStruct css2 = new ConnectionStringStruct();
            css2.ConnectionString = Path.Combine(tempFolder, "lm2.mlm");
            css2.Typ = MLifter.DAL.DatabaseType.MsSqlCe;
            css2.LmId = 2;

            IConnectionString con = new UncConnectionStringBuilder(tempFolder);

            lm1.DisplayName = "learnmodule1";
            lm1.ConnectionName = "connectionname1";
            lm1.Connection = con;
            lm1.ConnectionString = css1;
            lm1.SyncedPath = css1.ConnectionString;

            lm2.DisplayName = "learnmodule2";
            lm2.ConnectionName = "connectionname2";
            lm2.Connection = con;
            lm2.ConnectionString = css2;
            lm2.SyncedPath = css2.ConnectionString;
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        [ClassCleanup()]
        public static void MyClassCleanup()
        {
            Directory.Delete(tempFolder, true);
        }
        //
        // Use TestInitialize to run code before running each test
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        /// <summary>
        /// Tests the offline storage.
        /// </summary>
        /// <remarks>Documented by Dev05, 2009-04-02</remarks>
        [TestMethod]
        public void TestOfflineStorage()
        {
            string storageFile = Path.Combine(tempFolder, "storage.dat");
            IConnectionString con = new UncConnectionStringBuilder(tempFolder);
            SyncedModulesIndex.Clear();

            SyncedModulesIndex.Add(lm1.Connection, lm1);
            SyncedModulesIndex.Add(lm2.Connection, lm2);
            SyncedModulesIndex.Dump(storageFile);
            Assert.AreEqual<int>(2, SyncedModulesIndex.Get(con).Count);

            SyncedModulesIndex.Clear();
            Assert.AreEqual<int>(0, SyncedModulesIndex.Get(con).Count);

            SyncedModulesIndex.Restore(storageFile);
            Assert.AreEqual<int>(2, SyncedModulesIndex.Get(con).Count);
            Assert.AreEqual<string>(lm1.ConnectionString.ConnectionString, SyncedModulesIndex.Get(con)[0].ConnectionString.ConnectionString);
            Assert.AreEqual<string>(lm2.ConnectionString.ConnectionString, SyncedModulesIndex.Get(con)[1].ConnectionString.ConnectionString);
        }
    }
}


text:
package org.jboss.weld.tests.jsf.weld1247;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

/**
 * @author Marko Luksa
 */
@RequestScoped
@Named
public class Bean {

    public static int invocationCount = 0;

    public void doAction(){
        invocationCount++;
    }

}