text:
package tour;

import com.mongodb.Block;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientURI;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoCursor;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.model.BulkWriteOptions;
import com.mongodb.client.model.DeleteOneModel;
import com.mongodb.client.model.InsertOneModel;
import com.mongodb.client.model.ReplaceOneModel;
import com.mongodb.client.model.UpdateOneModel;
import com.mongodb.client.model.WriteModel;
import com.mongodb.client.result.DeleteResult;
import com.mongodb.client.result.UpdateResult;
import org.bson.Document;

import java.util.ArrayList;
import java.util.List;

import static com.mongodb.client.model.Accumulators.sum;
import static com.mongodb.client.model.Aggregates.group;
import static com.mongodb.client.model.Aggregates.match;
import static com.mongodb.client.model.Aggregates.project;
import static com.mongodb.client.model.Filters.and;
import static com.mongodb.client.model.Filters.eq;
import static com.mongodb.client.model.Filters.exists;
import static com.mongodb.client.model.Filters.gt;
import static com.mongodb.client.model.Filters.gte;
import static com.mongodb.client.model.Filters.lt;
import static com.mongodb.client.model.Filters.lte;
import static com.mongodb.client.model.Projections.excludeId;
import static com.mongodb.client.model.Sorts.descending;
import static com.mongodb.client.model.Updates.inc;
import static com.mongodb.client.model.Updates.set;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;

/**
 * The QuickTour code example see: https://mongodb.github.io/mongo-java-driver/3.0/getting-started
 */
public class QuickTour {
    /**
     * Run this main method to see the output of this quick example.
     *
     * @param args takes an optional single argument for the connection string
     */
    public static void main(final String[] args) {
        MongoClient mongoClient;

        if (args.length == 0) {
            // connect to the local database server
            mongoClient = new MongoClient();
        } else {
            mongoClient = new MongoClient(new MongoClientURI(args[0]));
        }

        // get handle to "mydb" database
        MongoDatabase database = mongoClient.getDatabase("mydb");

        // get a handle to the "test" collection
        MongoCollection<Document> collection = database.getCollection("test");

        // drop all the data in it
        collection.drop();

        // make a document and insert it
        Document doc = new Document("name", "MongoDB")
                       .append("type", "database")
                       .append("count", 1)
                       .append("info", new Document("x", 203).append("y", 102));

        collection.insertOne(doc);

        // get it (since it's the only one in there since we dropped the rest earlier on)
        Document myDoc = collection.find().first();
        System.out.println(myDoc.toJson());

        // now, lets add lots of little documents to the collection so we can explore queries and cursors
        List<Document> documents = new ArrayList<Document>();
        for (int i = 0; i < 100; i++) {
            documents.add(new Document("i", i));
        }
        collection.insertMany(documents);
        System.out.println("total # of documents after inserting 100 small ones (should be 101) " + collection.count());

        // find first
        myDoc = collection.find().first();
        System.out.println(myDoc.toJson());

        // lets get all the documents in the collection and print them out
        MongoCursor<Document> cursor = collection.find().iterator();
        try {
            while (cursor.hasNext()) {
                System.out.println(cursor.next().toJson());
            }
        } finally {
            cursor.close();
        }

        for (Document cur : collection.find()) {
            System.out.println(cur.toJson());
        }

        // now use a query to get 1 document out
        myDoc = collection.find(eq("i", 71)).first();
        System.out.println(myDoc.toJson());

        // now use a range query to get a larger subset
        cursor = collection.find(gt("i", 50)).iterator();

        try {
            while (cursor.hasNext()) {
                System.out.println(cursor.next().toJson());
            }
        } finally {
            cursor.close();
        }

        // range query with multiple constraints
        cursor = collection.find(and(gt("i", 50), lte("i", 100))).iterator();

        try {
            while (cursor.hasNext()) {
                System.out.println(cursor.next().toJson());
            }
        } finally {
            cursor.close();
        }

        // Query Filters
        myDoc = collection.find(eq("i", 71)).first();
        System.out.println(myDoc.toJson());

        // now use a range query to get a larger subset
        Block<Document> printBlock = new Block<Document>() {
            @Override
            public void apply(final Document document) {
                System.out.println(document.toJson());
            }
        };
        collection.find(gt("i", 50)).forEach(printBlock);

        // filter where; 50 < i <= 100
        collection.find(and(gt("i", 50), lte("i", 100))).forEach(printBlock);

        // Sorting
        myDoc = collection.find(exists("i")).sort(descending("i")).first();
        System.out.println(myDoc.toJson());

        // Projection
        myDoc = collection.find().projection(excludeId()).first();
        System.out.println(myDoc.toJson());

        // Aggregation
        collection.aggregate(asList(
                match(gt("i", 0)),
                project(Document.parse("{ITimes10: {$multiply: ['$i', 10]}}")))
        ).forEach(printBlock);

        myDoc = collection.aggregate(singletonList(group(null, sum("total", "$i")))).first();
        System.out.println(myDoc.toJson());

        // Update One
        collection.updateOne(eq("i", 10), set("i", 110));

        // Update Many
        UpdateResult updateResult = collection.updateMany(lt("i", 100), inc("i", 100));
        System.out.println(updateResult.getModifiedCount());

        // Delete One
        collection.deleteOne(eq("i", 110));

        // Delete Many
        DeleteResult deleteResult = collection.deleteMany(gte("i", 100));
        System.out.println(deleteResult.getDeletedCount());

        collection.drop();

        // ordered bulk writes
        List<WriteModel<Document>> writes = new ArrayList<WriteModel<Document>>();
        writes.add(new InsertOneModel<Document>(new Document("_id", 4)));
        writes.add(new InsertOneModel<Document>(new Document("_id", 5)));
        writes.add(new InsertOneModel<Document>(new Document("_id", 6)));
        writes.add(new UpdateOneModel<Document>(new Document("_id", 1), new Document("$set", new Document("x", 2))));
        writes.add(new DeleteOneModel<Document>(new Document("_id", 2)));
        writes.add(new ReplaceOneModel<Document>(new Document("_id", 3), new Document("_id", 3).append("x", 4)));

        collection.bulkWrite(writes);

        collection.drop();

        collection.bulkWrite(writes, new BulkWriteOptions().ordered(false));
        //collection.find().forEach(printBlock);

        // Clean up
        database.drop();

        // release resources
        mongoClient.close();
    }
}


text:
//  mlx_new_window.m

#import <Cocoa/Cocoa.h>
#import <OpenGL/gl3.h>
#import <AppKit/NSOpenGLView.h>

#include <stdio.h>

#include "mlx_int.h"
#include "mlx_new_window.h"

NSOpenGLPixelFormatAttribute pfa_attrs[] =
  {
    NSOpenGLPFADepthSize, 32,
    NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy,
    0
  };

static const GLfloat pixel_vertexes[8] =
  {
    -1.0 , -1.0,
    1.0, -1.0,
    1.0, 1.0,
    -1.0, 1.0
  };

int get_mouse_button(NSEventType eventtype)
{
  switch (eventtype) {
  case NSLeftMouseDown:
  case NSLeftMouseUp:
  case NSLeftMouseDragged:
    return 1;
  case NSRightMouseDown:
  case NSRightMouseUp:
  case NSRightMouseDragged:
    return 2;
  case NSOtherMouseDown:
  case NSOtherMouseUp:
  case NSOtherMouseDragged:
    return 3;
  default:
    return 0;
  }
}

// classes for window & events

@implementation NSWindowEvent

- (NSWindowEvent *) initWithContentRect:(NSRect)rect styleMask:(NSUInteger)winstyle backing:(NSBackingStoreType)bck defer:(BOOL) dfr
{
  int i;

  if ((self = [super initWithContentRect:rect
		     styleMask:winstyle
		     backing:bck
		     defer:dfr]))
    {
      i = MAX_EVENT;
      while (i--)
	{
	  event_funct[i] = NULL;
	  event_param[i] = NULL;
	}
      keyrepeat = 0;
      keyflag = 0;
      size_x = rect.size.width;
      size_y = rect.size.height;
    }
  return (self);
}

- (void) setEvent:(int)event andFunc:(func_t)func andParam:(void *)param
{
  event_funct[event] = func;
  event_param[event] = param;
  if (event == 6) // motion notify
    {
      if (func == NULL)
	[self setAcceptsMouseMovedEvents:NO];
      else
	[self setAcceptsMouseMovedEvents:YES];
    }
}

- (void) setKeyRepeat:(int)mode
{
  keyrepeat = mode;
}

- (BOOL) acceptsFirstResponder
{
  return (YES);
}

- (void) flagsChanged:(NSEvent *)theEvent
{
  unsigned int flag;
  int the_key;
  unsigned int val;

  flag = [theEvent modifierFlags];
  //  printf("Key flag changed: %x => %x\n", keyflag, flag);
  //  printf("**mlx flag low part : %d  - %x\n", flag&0xFFFF, flag&0xFFFF);

  if (!(val = (keyflag|flag)&(~(keyflag&flag))))
    return ;   // no change - can happen when loosing focus on special key pressed, then re-pressed later
  the_key = 1;
  while (((val >> (the_key-1)) & 0x01)==0)
    the_key ++;
  if (flag > keyflag && event_funct[2] != NULL)
    event_funct[2](0xFF+the_key, event_param[2]);
  if (flag < keyflag && event_funct[3] != NULL)
    event_funct[3](0xFF+the_key, event_param[3]);
  /*
  if (event_funct[2] != NULL)
    {
      if (!(keyflag & NSAlphaShiftKeyMask) && (flag&NSAlphaShiftKeyMask)) event_funct[2](0xFF+1, event_param[2]);
      if (!(keyflag & NSShiftKeyMask) && (flag&NSShiftKeyMask)) event_funct[2](0xFF+2, event_param[2]);
      if (!(keyflag & NSControlKeyMask) && (flag&NSControlKeyMask)) event_funct[2](0xFF+3, event_param[2]);
      if (!(keyflag & NSAlternateKeyMask) && (flag&NSAlternateKeyMask)) event_funct[2](0xFF+4, event_param[2]);
      if (!(keyflag & NSCommandKeyMask) && (flag&NSCommandKeyMask)) event_funct[2](0xFF+5, event_param[2]);
      if (!(keyflag & NSNumericPadKeyMask) && (flag&NSNumericPadKeyMask)) event_funct[2](0xFF+6, event_param[2]);
      if (!(keyflag & NSHelpKeyMask) && (flag&NSHelpKeyMask)) event_funct[2](0xFF+7, event_param[2]);
      if (!(keyflag & NSFunctionKeyMask) && (flag&NSFunctionKeyMask)) event_funct[2](0xFF+8, event_param[2]);
    }
  if (event_funct[3] != NULL)
    {
      if ((keyflag & NSShiftKeyMask) && !(flag&NSShiftKeyMask)) event_funct[3](NSShiftKeyMask, event_param[3]);

      if ((keyflag & NSAlphaShiftKeyMask) && !(flag&NSAlphaShiftKeyMask)) event_funct[3](0xFF+1, event_param[3]);
      if ((keyflag & NSShiftKeyMask) && !(flag&NSShiftKeyMask)) event_funct[3](0xFF+2, event_param[3]);
      if ((keyflag & NSControlKeyMask) && !(flag&NSControlKeyMask)) event_funct[3](0xFF+3, event_param[3]);
      if ((keyflag & NSAlternateKeyMask) && !(flag&NSAlternateKeyMask)) event_funct[3](0xFF+4, event_param[3]);
      if ((keyflag & NSCommandKeyMask) && !(flag&NSCommandKeyMask)) event_funct[3](0xFF+5, event_param[3]);
      if ((keyflag & NSNumericPadKeyMask) && !(flag&NSNumericPadKeyMask)) event_funct[3](0xFF+6, event_param[3]);
      if ((keyflag & NSHelpKeyMask) && !(flag&NSHelpKeyMask)) event_funct[3](0xFF+7, event_param[3]);
      if ((keyflag & NSFunctionKeyMask) && !(flag&NSFunctionKeyMask)) event_funct[3](0xFF+8, event_param[3]);
    }
  */
  keyflag = flag;
}

- (void) keyDown:(NSEvent *)theEvent
{
  if (keyrepeat==0 && [theEvent isARepeat])
    return ;
  //  printf("Key Down: %d\n", [theEvent keyCode]);
  if (event_funct[2] != NULL)
    event_funct[2]([theEvent keyCode], event_param[2]);
  //  else [super keyDown: theEvent];
}

- (void) keyUp:(NSEvent *)theEvent
{
  //  printf("Key Up: %d\n", [theEvent keyCode]);
  if (event_funct[3] != NULL)
    event_funct[3]([theEvent keyCode], event_param[3]);
  //  else [super keyUp: theEvent];

}

- (void) mouseDown:(NSEvent *)theEvent
{
  NSPoint thepoint;
  int     button;

  thepoint = [theEvent locationInWindow];
  button = get_mouse_button([theEvent type]);
  //  printf("Mouse pressed bt %d  pos: %f, %f\n", button, thepoint.x, thepoint.y);
  if (event_funct[4] != NULL)
    event_funct[4](button, (int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[4]);
}

- (void) rightMouseDown:(NSEvent *)theEvent
{
  NSPoint thepoint;
  int     button;

  thepoint = [theEvent locationInWindow];
  button = get_mouse_button([theEvent type]);
  //  printf("Mouse pressed bt %d  pos: %f, %f\n", button, thepoint.x, thepoint.y);
  if (event_funct[4] != NULL)
    event_funct[4](button, (int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[4]);
}

- (void) otherMouseDown:(NSEvent *)theEvent
{
  NSPoint thepoint;
  int     button;

  thepoint = [theEvent locationInWindow];
  button = get_mouse_button([theEvent type]);
  //  printf("Mouse pressed bt %d  pos: %f, %f\n", button, thepoint.x, thepoint.y);
  if (event_funct[4] != NULL)
    event_funct[4](button, (int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[4]);
}

- (void) mouseUp:(NSEvent *)theEvent
{
  NSPoint thepoint;
  int     button;

  thepoint = [theEvent locationInWindow];
  button = get_mouse_button([theEvent type]);
  //  printf("Mouse release bt %d  pos: %f, %f\n", button, thepoint.x, thepoint.y);
  if (event_funct[5] != NULL)
    event_funct[5](button, (int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[5]);
}

- (void) rightMouseUp:(NSEvent *)theEvent
{
  NSPoint thepoint;
  int     button;

  thepoint = [theEvent locationInWindow];
  button = get_mouse_button([theEvent type]);
  //  printf("Mouse release bt %d  pos: %f, %f\n", button, thepoint.x, thepoint.y);
  if (event_funct[5] != NULL)
    event_funct[5](button, (int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[5]);
}

- (void) otherMouseUp:(NSEvent *)theEvent
{
  NSPoint thepoint;
  int     button;

  thepoint = [theEvent locationInWindow];
  button = get_mouse_button([theEvent type]);
  //  printf("Mouse release bt %d  pos: %f, %f\n", button, thepoint.x, thepoint.y);
  if (event_funct[5] != NULL)
    event_funct[5](button, (int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[5]);
}

- (void) mouseMoved:(NSEvent *)theEvent
{
  NSPoint thepoint;

  thepoint = [theEvent locationInWindow];
  //  printf("Mouse moved  pos: %f, %f\n", thepoint.x, thepoint.y);
  if (event_funct[6] != NULL)
    event_funct[6]((int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[6]);
}

- (void) mouseDragged:(NSEvent *)theEvent
{
  NSPoint thepoint;

  thepoint = [theEvent locationInWindow];
  //  printf("Mouse moved  pos: %f, %f\n", thepoint.x, thepoint.y);
  if (event_funct[6] != NULL)
    event_funct[6]((int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[6]);
}

- (void) rightMouseDragged:(NSEvent *)theEvent
{
  NSPoint thepoint;

  thepoint = [theEvent locationInWindow];
  //  printf("Mouse moved  pos: %f, %f\n", thepoint.x, thepoint.y);
  if (event_funct[6] != NULL)
    event_funct[6]((int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[6]);
}

- (void) otherMouseDragged:(NSEvent *)theEvent
{
  NSPoint thepoint;

  thepoint = [theEvent locationInWindow];
  //  printf("Mouse moved  pos: %f, %f\n", thepoint.x, thepoint.y);
  if (event_funct[6] != NULL)
    event_funct[6]((int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[6]);
}

- (void) scrollWheel:(NSEvent *)theEvent
{
  NSPoint thepoint;
  int     button;
  float	  sens;

  if (event_funct[4] == NULL)
    return ;

  button = 0;
  thepoint = [theEvent locationInWindow];
  sens = [theEvent deltaY];
  if (sens > 0.2)
    button = 4;
  if (sens < -0.2)
    button = 5;
  sens = [theEvent deltaX];
  if (sens > 0.2)
    button = 6;
  if (sens < -0.2)
    button = 7;
  if (button != 0)
    event_funct[4](button, (int)(thepoint.x), size_y - 1 - (int)(thepoint.y), event_param[4]);
}

- (void) exposeNotification:(NSNotification *)note
{
  //    printf("Expose...\n");
    if (event_funct[12] != NULL)
      event_funct[12](event_param[12]);
    //    printf("Expose done.\n");
}

- (void) closeNotification:(NSNotification *)note
{
  if (event_funct[17] != NULL)
    event_funct[17](event_param[17]);
}

- (void) deminiaturizeNotification:(NSNotification *)note
{
  //  if (event_funct[??] != NULL)
  //    event_funct[??](event_param[??]);
  [self exposeNotification:note];
}
@end

@implementation MlxWin

- (id) initWithRect: (NSRect)rect andTitle: (NSString *)title pfaAttrs: (NSOpenGLPixelFormatAttribute *)attrs
{
  NSOpenGLPixelFormat* pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];

  if ((self = [super initWithFrame:rect pixelFormat:pixFmt]) != nil)
    {
      NSUInteger windowStyle = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask;

      win = [[NSWindowEvent alloc] initWithContentRect:rect
				   styleMask:windowStyle
				   backing:NSBackingStoreBuffered   // NSBackingStoreNonretained
				   defer:NO];
      [win setContentView:self];
      [win setTitle:title];
      [win setKeyRepeat:1];
      [win makeKeyAndOrderFront:self];

      //      printf("init ctx: current %p ", [NSOpenGLContext currentContext]);

      //      ctx = [[NSOpenGLContext alloc] initWithFormat:pixFmt shareContext:[NSOpenGLContext currentContext]]; //other_context];
      //      [ctx setView:self];
      //      [ctx makeCurrentContext];

      [[self openGLContext] makeCurrentContext];
      [[self openGLContext] setView:self];
      [self prepareOpenGL];

      [self setNextKeyView:self];

      //      [[NSNotificationCenter defaultCenter] addObserver:win selector:@selector(exposeNotification:) name:@"NSWindowDidExposeNotification" object:nil];
      [[NSNotificationCenter defaultCenter] addObserver:win selector:@selector(exposeNotification:) name:@"NSWindowDidBecomeKeyNotification" object:win];
      [[NSNotificationCenter defaultCenter] addObserver:win selector:@selector(deminiaturizeNotification:) name:@"NSWindowDidDeminiaturizeNotification" object:win];
      [[NSNotificationCenter defaultCenter] addObserver:win selector:@selector(closeNotification:) name:@"NSWindowWillCloseNotification" object:win];
      // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ctxNeedsUpdate:)
      //				    name:NSViewGlobalFrameDidChangeNotification
      //				    object:nil];

      size_x = rect.size.width;
      size_y = rect.size.height;

      glClearColor(0, 0, 0, 0);
      glClear(GL_COLOR_BUFFER_BIT);
      glFlush();

      //[win makeKeyAndOrderFront:nil];
      // BOOL r = [win isKeyWindow];
      //  if (r==YES) printf("keywindow ok\n"); else printf("keywindow KO\n");

      // Window controller subclass to set title
      // NSWindowController* windowController = [[NSWindowController alloc] initWithWindow:win];
      // [windowController windowTitleForDocumentDisplayName:title];
      // [windowController showWindow:nil];
      // MlxWinController *mlxWinCont = [[MlxWinController alloc] initWin:win andTitle:title];

      // after nswindowcontroller who will retake first responder
      //      BOOL r = [win makeFirstResponder:nil];
      //      if (r==YES) printf("responder ok\n"); else printf("responder KO\n");

      [pixFmt release];
    }
  return (self);
}

- (int)	pixel_management
{
  bzero(&glsl, sizeof(glsl));   // so gldelete[shader/program] go silent on error.

  glDisable(GL_DEPTH_TEST);
  glGenBuffers(1, &pixel_vbuffer);
  glBindBuffer(GL_ARRAY_BUFFER, pixel_vbuffer);
  glBufferData(GL_ARRAY_BUFFER, sizeof(pixel_vertexes), pixel_vertexes, GL_DYNAMIC_DRAW); // 4 points buff
  // pixel_ptr = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);

  glGenTextures(1, &pixel_texture);
  glBindTexture(GL_TEXTURE_2D, pixel_texture);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,     GL_CLAMP_TO_EDGE);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,     GL_CLAMP_TO_EDGE);
  pixtexbuff = malloc(sizeof(unsigned int)*size_x*size_y);
  pixel_nb = size_x*size_y;
  while (pixel_nb--) pixtexbuff[pixel_nb] = 0xFF000000;
  pixel_nb = 0;
  glTexImage2D(
	       GL_TEXTURE_2D, 0,           /* target, level of detail */
	       GL_RGBA8,                    /* internal format */
	       size_x, size_y, 0,           /* width, height, border */
	       GL_BGRA, GL_UNSIGNED_BYTE,   /* external format, type */
	       pixtexbuff                   /* pixels */
	       );
  //      printf("pix tex err? 0x%x\n", glGetError());

  if (mlx_shaders(&glsl))
    return (0);

  glUseProgram(glsl.pixel_program);
  glsl.loc_pixel_texture = glGetUniformLocation(glsl.pixel_program, "texture");
  //glsl.loc_pixel_winhalfsize = glGetUniformLocation(glsl.pixel_program, "winhalfsize");
  glsl.loc_pixel_position = glGetAttribLocation(glsl.pixel_program, "position");
  //      printf("err? 0x%x\n", glGetError());

  glUseProgram(glsl.image_program);
  glsl.loc_image_texture = glGetUniformLocation(glsl.image_program, "texture");
  glsl.loc_image_pos = glGetUniformLocation(glsl.image_program, "imagepos");
  glsl.loc_image_size = glGetUniformLocation(glsl.image_program, "imagesize");
  glsl.loc_image_winhalfsize = glGetUniformLocation(glsl.image_program, "winhalfsize");
  glsl.loc_image_position = glGetAttribLocation(glsl.image_program, "position");
  //      printf("err? 0x%x\n", glGetError());

  glUseProgram(glsl.font_program);
  glsl.loc_font_texture = glGetUniformLocation(glsl.font_program, "texture");
  glsl.loc_font_color = glGetUniformLocation(glsl.font_program, "color");
  glsl.loc_font_posinwin = glGetUniformLocation(glsl.font_program, "fontposinwin");
  glsl.loc_font_posinatlas = glGetUniformLocation(glsl.font_program, "fontposinatlas");
  glsl.loc_font_atlassize = glGetUniformLocation(glsl.font_program, "fontatlassize");
  glsl.loc_font_winhalfsize = glGetUniformLocation(glsl.font_program, "winhalfsize");
  glsl.loc_font_position = glGetAttribLocation(glsl.font_program, "position");
  //      printf("err? 0x%x\n", glGetError());

  glFlush();
  return (1);
}

- (void) ctxNeedsUpdate
{
  // printf("Context update\n");
  [ctx update];
}

- (void) selectGLContext
{
  if ([NSOpenGLContext currentContext] != [self openGLContext])
    {
      //      printf("ctx: %p => %p\n", [NSOpenGLContext currentContext], [self openGLContext]);
      [[self openGLContext] makeCurrentContext];
    }
}

- (void) flushGLContext
{
  [[self openGLContext] flushBuffer];
}

- (NSOpenGLContext *) ctx
{
  return (ctx);
}

- (void) pixelPutColor: (int)color X:(int)x Y:(int)y
{
  pixel_nb ++;

  glBindTexture(GL_TEXTURE_2D, pixel_vbuffer);
  glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, (GLvoid *)(&color));

  if (pixel_nb >= MAX_PIXEL_NB)
    [self mlx_gl_draw];
}

- (void) destroyPixelManagement
{
  free(pixtexbuff);
  [self selectGLContext];
  glDeleteBuffers(1, &pixel_vbuffer);
  glDeleteTextures(1, &pixel_texture);
  glDeleteProgram(glsl.pixel_program);
  glDeleteProgram(glsl.image_program);
  glDeleteShader(glsl.pixel_vshader);
  glDeleteShader(glsl.pixel_fshader);
  glDeleteShader(glsl.image_vshader);
  glDeleteShader(glsl.image_fshader);
}

- (void) destroyMe
{
  [[NSNotificationCenter defaultCenter] removeObserver:win];
  [[NSNotificationCenter defaultCenter] removeObserver:self];
  // [ctx release];
  [win close];
  [self release];
}

- (void) setEvent:(int)event andFunc:(func_t)func andParam:(void *)param
{
  [win setEvent:event andFunc:func andParam:param];
}

- (void) setKeyRepeat:(int)mode
{
  [win setKeyRepeat:mode];
}

- (void) clearWin
{
  glClearColor(0, 0, 0, 0);
  glClear(GL_COLOR_BUFFER_BIT);
}

- (void) mlx_gl_draw_img:(mlx_img_list_t *)img andCtx:(mlx_img_ctx_t *)imgctx andX:(int)x andY:(int)y
{

  if (pixel_nb >0)
    [self mlx_gl_draw];

  glUseProgram(glsl.image_program);

  glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, imgctx->texture);
  glUniform1i(glsl.loc_image_texture, 0);

  glUniform2f(glsl.loc_image_winhalfsize, size_x/2, size_y/2);
  glUniform2f(glsl.loc_image_pos, x, size_y - y);
  glUniform2f(glsl.loc_image_size, img->width, -img->height);

  glBindBuffer(GL_ARRAY_BUFFER, imgctx->vbuffer);
  glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2*sizeof(GLfloat), (void*)0);
  glEnableVertexAttribArray(0);

  glEnable(GL_BLEND);
  glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA);  // src alpha 0xFF : keep dst
  glBlendEquation(GL_FUNC_ADD);

  glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
  glDisableVertexAttribArray(0);

}

- (void) mlx_gl_draw_font:(mlx_img_list_t *)img andCtx:(mlx_img_ctx_t *)imgctx andX:(int)x andY:(int)y andColor:(int)color glyphX:(int)gx glyphY:(int)gy
{
  GLfloat color_tab[4];

  if (pixel_nb >0)
    [self mlx_gl_draw];

  color_tab[0] = ((float)((color&0xFF0000)>>16))/255.0;
  color_tab[1] = ((float)((color&0xFF00)>>8))/255.0;
  color_tab[2] = ((float)((color&0xFF)>>0))/255.0;
  color_tab[3] = 1.0;
  glUseProgram(glsl.font_program);

  glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, imgctx->texture);
  glUniform1i(glsl.loc_font_texture, 0);
  glUniform4fv(glsl.loc_font_color, 1, color_tab);

  glUniform2f(glsl.loc_font_winhalfsize, size_x/2, size_y/2);
  glUniform2f(glsl.loc_font_posinwin, x, size_y - 1 - y);
  glUniform2f(glsl.loc_font_posinatlas, gx, gy);
  glUniform2f(glsl.loc_font_atlassize, img->width, img->height);

  glBindBuffer(GL_ARRAY_BUFFER, imgctx->vbuffer);
  glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2*sizeof(GLfloat), (void*)0);
  glEnableVertexAttribArray(0);

  glEnable(GL_BLEND);
  glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA);  // src alpha 0xFF : keep dst
  glBlendEquation(GL_FUNC_ADD);

  glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
  glDisableVertexAttribArray(0);

}

- (void) mlx_gl_draw
{
  if (pixel_nb <= 0)
    return ;

  glUseProgram(glsl.pixel_program);

  glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, pixel_vbuffer);
  glUniform1i(glsl.loc_pixel_texture, 0);

  glBindBuffer(GL_ARRAY_BUFFER, pixel_vbuffer);
  glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2*sizeof(GLfloat), (void*)0);
  glEnableVertexAttribArray(0);

  glEnable(GL_BLEND);
  glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA);  // src alpha 0xFF : keep dst
  glBlendEquation(GL_FUNC_ADD);

  glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
  glDisableVertexAttribArray(0);

  pixel_nb = size_x*size_y;
  while (pixel_nb--) pixtexbuff[pixel_nb] = 0xFF000000;
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, size_x, size_y, 0, GL_BGRA, GL_UNSIGNED_BYTE, pixtexbuff);
  pixel_nb = 0;

}

@end

// mlx API

void *mlx_new_window(mlx_ptr_t *mlx_ptr, int size_x, int size_y, char *title)
{
  mlx_win_list_t	*newwin;
  NSString		*str;

  if ((newwin = malloc(sizeof(*newwin))) == NULL)
    return ((void *)0);
  newwin->img_list = NULL;
  newwin->next = mlx_ptr->win_list;
  newwin->nb_flush = 0;
  newwin->pixmgt = 1;
  mlx_ptr->win_list = newwin;

  NSRect windowRect = NSMakeRect(100, 100, size_x, size_y);
  str = [NSString stringWithCString:title encoding:NSASCIIStringEncoding];
  newwin->winid = [[MlxWin alloc] initWithRect:windowRect andTitle:str pfaAttrs:pfa_attrs];
  if (newwin->winid)
    if (![(id)(newwin->winid) pixel_management])
      {
	[(id)(newwin->winid) destroyPixelManagement];
	[(id)(newwin->winid) destroyMe];
      }
  return ((void *)newwin);
}

void mlx_clear_window(mlx_ptr_t *mlx_ptr, mlx_win_list_t *win_ptr)
{
  [(id)(win_ptr->winid) selectGLContext];
  [(id)(win_ptr->winid) clearWin];
  win_ptr->nb_flush ++;
}

void mlx_expose_hook(mlx_win_list_t *win_ptr, int (*funct_ptr)(), void *param)
{
  [(id)(win_ptr->winid) setEvent:12 andFunc:funct_ptr andParam:param];
}

void mlx_key_hook(mlx_win_list_t *win_ptr, int (*funct_ptr)(), void *param)
{
  [(id)(win_ptr->winid) setEvent:3 andFunc:funct_ptr andParam:param];
}

void mlx_mouse_hook(mlx_win_list_t *win_ptr, int (*funct_ptr)(), void *param)
{
  [(id)(win_ptr->winid) setEvent:4 andFunc:funct_ptr andParam:param];
}

void mlx_hook(mlx_win_list_t *win_ptr, int x_event, int x_mask, int (*funct_ptr)(), void *param)
{
  [(id)(win_ptr->winid) setEvent:x_event andFunc:funct_ptr andParam:param];
}

int     mlx_do_key_autorepeatoff(mlx_ptr_t *mlx_ptr)
{
  mlx_win_list_t *win;

  win = mlx_ptr->win_list;
  while (win)
    {
      [(id)(win->winid) setKeyRepeat:0];
      win = win->next;
    }
  return (0);
}

int     mlx_do_key_autorepeaton(mlx_ptr_t *mlx_ptr)
{
  mlx_win_list_t *win;

  win = mlx_ptr->win_list;
  while (win)
    {
      [(id)(win->winid) setKeyRepeat:1];
      win = win->next;
    }
  return (0);
}

int     mlx_destroy_window(mlx_ptr_t *mlx_ptr, mlx_win_list_t *win_to_del)
{
  mlx_win_list_t    first;
  mlx_win_list_t    *win;
  mlx_img_ctx_t	    *ctx;
  mlx_img_ctx_t	    *ctx2;

  first.next = mlx_ptr->win_list;
  win = &first;
  while (win && win->next)
    {
      if (win->next == win_to_del)
	win->next = win->next->next;
      win = win->next;
    }
  mlx_ptr->win_list = first.next;

  if (win_to_del->pixmgt)
    {
      [(id)(win_to_del->winid) selectGLContext];
      ctx = win_to_del->img_list;   // should be null anyway if no pixel management
      while (ctx)
	{
	  glDeleteBuffers(1, &(ctx->vbuffer));
	  glDeleteTextures(1, &(ctx->texture));
	  ctx2 = ctx;
	  ctx = ctx->next;
	  free(ctx2);
	}
      [(id)(win_to_del->winid) destroyPixelManagement];
    }
  [(id)(win_to_del->winid) destroyMe];
  free(win_to_del);

  //  printf("destroy window done.\n");
  mlx_do_sync(mlx_ptr);
  return (0);
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TextView android:layout_height="wrap_content" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:text="@string/catchphrase" android:layout_margin="5dp" android:textSize="25sp"></TextView>
    <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@android:id/list"></ListView>
</LinearLayout>


text:
//=======================================================================
// Copyright Baptiste Wicht 2013-2018.
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
//  http://www.opensource.org/licenses/MIT)
//=======================================================================

#ifndef NET_ETHERNET_LAYER_H
#define NET_ETHERNET_LAYER_H

#include <types.hpp>
#include <expected.hpp>

#include "tlib/net_constants.hpp"

#include "net/interface.hpp"
#include "net/packet.hpp"

namespace network {

namespace arp {
struct layer;
}

namespace ip {
struct layer;
}

namespace ethernet {

static_assert(sizeof(address) == 6, "The size of a MAC address is 6 bytes");
static_assert(sizeof(header) == 14, "The size of the Ethernet header is 14 bytes");

/*!
 * \brief Convert a 6 sequential byte MAC address to its single 64bit representation
 */
uint64_t mac6_to_mac64(const char* mac);

/*!
 * \brief Convert a 64bit MAC to its 6 sequential byte MAC address
 * \param input The 64bit MAC input
 * \param mac The output 6 sequential byte MAC address representation
 */
void mac64_to_mac6(uint64_t input, char* mac);

/*!
 * \brief Ethernet layer implementation
 */
struct layer {
    /*!
     * \brief Decode a network packet.
     *
     * This must only be called from the network interface.
     *
     * \param interface The interface on which the packet was received
     * \param packet The packet to decode
     */
    void decode(network::interface_descriptor& interface, packet_p& packet);

    /*!
     * \brief Prepare a packet for the kernel
     * \param interface The interface on which to prepare the packet for
     * \param descriptor The packet descriptor
     * \return the prepared packet or an error
     */
    std::expected<packet_p> kernel_prepare_packet(network::interface_descriptor& interface, const packet_descriptor& descriptor);

    /*!
     * \brief Prepare a packet for the user
     * \param buffer The buffer to write the packet to
     * \param interface The interface on which to prepare the packet for
     * \param descriptor The packet descriptor
     * \return the prepared packet or an error
     */
    std::expected<packet_p> user_prepare_packet(char* buffer, network::interface_descriptor& interface, const packet_descriptor* descriptor);

    /*!
     * \brief Finalize a prepared packet
     * \param interface The interface on which to finalize the packet
     * \param p The packet to finalize
     * \return nothing or an error
     */
    std::expected<void> finalize_packet(network::interface_descriptor& interface, packet_p& p);

    /*!
     * \brief Register the ARP layer
     * \param layer The ARP layer
     */
    void register_arp_layer(network::arp::layer* layer);

    /*!
     * \brief Register the IP layer
     * \param layer The IP layer
     */
    void register_ip_layer(network::ip::layer* layer);

private:
    network::arp::layer* arp_layer; ///< The ARP layer
    network::ip::layer* ip_layer;   ///< The IP layer
};

} // end of ethernet namespace

} // end of network namespace

#endif


text:
'use strict';

var gulp = require('gulp');

gulp.task('build', ['main.js', 'vendor.js', 'less']);


text:
package com.nicktoony.scrAI.World.Tasks;

import com.nicktoony.scrAI.Constants;
import com.nicktoony.scrAI.Controllers.RoomController;
import com.nicktoony.scrAI.World.Creeps.CreepWorker;
import com.nicktoony.screeps.Game;
import com.nicktoony.screeps.structures.Structure;

/**
 * Created by nick on 02/08/15.
 */
public class TaskRepair extends Task {
    protected Structure buildable;
    private float progress = 0;

    public TaskRepair(RoomController roomController, String associatedId, Structure buildable) {
        super(roomController, associatedId);
        this.buildable = buildable;
    }

    @Override
    public boolean canAssign(CreepWorker creepWorker) {
        return canAct(creepWorker)
                && (creeps.$length() == 0);
    }

    @Override
    public boolean canAct(CreepWorker creepWorker) {
        return buildable != null
                && (creepWorker.getCreep().carry.energy > 0)
                && buildable.hits < buildable.hitsMax;
    }

    @Override
    public boolean act(CreepWorker creepWorker) {
        if (creepWorker.moveTo(buildable.pos)) {
            creepWorker.getCreep().repair(buildable);
        }
        return true;
    }

    @Override
    public boolean save() {
        if (buildable == null || buildable.hits == buildable.hitsMax) {
            return false;
        }
        return super.save();
    }

    @Override
    public void init() {
        super.init();
    }

    @Override
    public void create() {
        buildable = (Structure) Game.getObjectById(associatedId);
        if (buildable!=null) {
            progress = 1 - ((float) buildable.hits / buildable.hitsMax);
        }
    }

    @Override
    public String getType() {
        return "5";
    }

    @Override
    public int getPriority() {
        return Math.round(Constants.PRIORITY_REPAIR * progress);
    }
}


text:
<?php

/**
 * Created by PhpStorm.
 * User: shenzhe
 * Date: 2016/12/27
 * Time: 17:07
 */
namespace service;

use sdk\LoadService;

class Demo
{
    public function demo($method)
    {
        $service = LoadService::getService('api-demo');
        $result = $service->call($method);
        $body = $result->getBody();
        return $body['data'];
    }
}


text:
[![Build Status](https://travis-ci.org/putan/stubon.svg?branch=master)](https://travis-ci.org/putan/stubon) [![Coverage Status](https://coveralls.io/repos/github/putan/stubon/badge.svg?branch=master)](https://coveralls.io/github/putan/stubon?branch=master) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/putan/stubon/blob/master/LICENSE.txt)

# Stubon

stubon is simple dummy api server.

## 0. install
```shell
$ npm i -D stubon
```

## 1. Make source file by JSON or YAML or both.
When "http request" includes all condition that written under "request", value returned that under correspond "response.body".
[Sample is here](https://github.com/putan/stubon/blob/master/example/stub/stub.yml).

```js
// ./dev/src/dummy.yml
'/aaa/get':
    -
        request:
            method: 'GET'
        response:
            status: 200
            body:
                result: 'OK!'
```

## 2. Create server.
#### 2.1 The way to make with a file.
```js
var Stubon = require('stubon').default; // = import Stubon from 'stubon';

var srcPath = './dev/src';
var stubon = new Stubon(srcPath, {
    debug : true,
    ssl   : true,
});

stubon.server().listen(8080);
```

#### 2.2 The way to make with a command line.
```shell
$ $(npm bin)/stubon -p 8080 -s ./dev/src --debug --ssl
```

## 3. Call a dummy API.
```shell
$ open https://localhost:8080/aaa/get
```

If you call API from node script, you need setting option 'agent'.<br>
When you call from browser, you can do permission setting on the browser side.

```js
// call_api.js
fetch('https://localhost:8080/aaa/get', {
    agent : new https.Agent({ rejectUnauthorized : false }),
})
    .then(function(res) {
        return res.json();
    })
    .then(function(json) {
        console.log(json.result); // OK!
    });
```

```shell
$ node call_api.js
```


text:
<!DOCTYPE html>

    <title>IMDB Top 250</title>
    <link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" />

       <link href="/static/main.less" type="text/css" rel="stylesheet/less"/>

  {% raw %}

IMDB top 250

        Updating...

              Hi, enter your IMDB ID below and your list of unseen movies from the
              Top 250 movie list at IMDB will be fetched. The list is a list with all the top 250
              movies you have not rated. Your ID should be on the form ur00000000.
              You can find it in the url on your profile page. Using usernames are in the making
              and will soon be available.

            <ng-pluralize count="movies.length" offset=2
                          when="{'0': 'Wow, you have watched them all!',
                                 '1': 'You have 1 movie to watch.',
                                 'other': 'You have {{movies.length}} movies to watch.'}">
            </ng-pluralize>

              #
              Title
              Rating
              Year
              Links

              {{movie.rank}}
              {{movie.title}}
              {{movie.rating}}
              {{movie.year}}
              IMDB

    {% endraw %}

        <form class="navbar-form text-center">

            <input type="text" class="form-control" data-ng-model="user_id" placeholder="IMDB user id">

          <button class="btn btn-info" data-ng-click="fetchMovieList(user_id)">Fetch</button>
        </form>

    {% if analytics_code %}

    {% endif %}


text:
<?php namespace Barryvdh\HttpCache\Console;

use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;

class ClearCommand extends Command
{

    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'httpcache:clear';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Clear the entire HttpCache';

    /**
     * The file system instance.
     *
     * @var \Illuminate\Filesystem\Filesystem
     */
    protected $files;

    /**
     * Create a new HttpCache clear command instance.
     *
     * @param \Illuminate\Filesystem\Filesystem $files
     */
    public function __construct(Filesystem $files)
    {
        parent::__construct();
        $this->files = $files;
    }

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function fire()
    {

        $cacheDir = $this->laravel['http_cache.cache_dir'];

        if($this->files->cleanDirectory($cacheDir)){
            $this->info('HttpCache cleared!');
        }else{
            $this->error('Could not clear HttpCache');
        }

    }

}


text:
/* $Id: VBGLInternal.h $ */
/** @file
 * VBoxGuestLibR0 - Internal header.
 */

/*
 * Copyright (C) 2006-2015 Oracle Corporation
 *
 * This file is part of VirtualBox Open Source Edition (OSE), as
 * available from http://www.virtualbox.org. This file is free software;
 * you can redistribute it and/or modify it under the terms of the GNU
 * General Public License (GPL) as published by the Free Software
 * Foundation, in version 2 as it comes in the "COPYING" file of the
 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
 *
 * The contents of this file may alternatively be used under the terms
 * of the Common Development and Distribution License Version 1.0
 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
 * VirtualBox OSE distribution, in which case the provisions of the
 * CDDL are applicable instead of those of the GPL.
 *
 * You may elect to license modified versions of this file under the
 * terms and conditions of either the GPL or the CDDL or both.
 */

#ifndef ___VBoxGuestLib_VBGLInternal_h
#define ___VBoxGuestLib_VBGLInternal_h

#include <VBox/VMMDev.h>
#include <VBox/VBoxGuest.h>
#include <VBox/VBoxGuestLib.h>

#include <VBox/log.h>

#ifdef RT_OS_WINDOWS /** @todo dprintf() -> Log() */
# if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
#  define dprintf(a) RTLogBackdoorPrintf a
# else
#  define dprintf(a) do {} while (0)
# endif
#else
# define dprintf(a) Log(a)
#endif

#include "SysHlp.h"

#pragma pack(4) /** @todo r=bird: What do we need packing for here? None of these structures are shared between drivers AFAIK. */

struct _VBGLPHYSHEAPBLOCK;
typedef struct _VBGLPHYSHEAPBLOCK VBGLPHYSHEAPBLOCK;
struct _VBGLPHYSHEAPCHUNK;
typedef struct _VBGLPHYSHEAPCHUNK VBGLPHYSHEAPCHUNK;

#ifndef VBGL_VBOXGUEST
struct VBGLHGCMHANDLEDATA
{
    uint32_t fAllocated;
    VBGLDRIVER driver;
};
#endif

enum VbglLibStatus
{
    VbglStatusNotInitialized = 0,
    VbglStatusInitializing,
    VbglStatusReady
};

/**
 * Global VBGL ring-0 data.
 * Lives in VbglR0Init.cpp.
 */
typedef struct _VBGLDATA
{
    enum VbglLibStatus status;

    VBGLIOPORT portVMMDev;

    VMMDevMemory *pVMMDevMemory;

    /**
     * Physical memory heap data.
     * @{
     */

    VBGLPHYSHEAPBLOCK *pFreeBlocksHead;
    VBGLPHYSHEAPBLOCK *pAllocBlocksHead;
    VBGLPHYSHEAPCHUNK *pChunkHead;

    RTSEMFASTMUTEX mutexHeap;
    /** @} */

    /**
     * The host version data.
     */
    VMMDevReqHostVersion hostVersion;

#ifndef VBGL_VBOXGUEST
    /**
     * Handle for the main driver instance.
     * @{
     */

    RTSEMMUTEX mutexDriverInit;

    VBGLDRIVER driver;

    /** @} */

    /**
     * Fast heap for HGCM handles data.
     * @{
     */

    RTSEMFASTMUTEX mutexHGCMHandle;

    struct VBGLHGCMHANDLEDATA aHGCMHandleData[64];

    /** @} */
#endif
} VBGLDATA;

#pragma pack()

#ifndef VBGL_DECL_DATA
extern VBGLDATA g_vbgldata;
#endif

/**
 * Internal macro for checking whether we can pass physical page lists to the
 * host.
 *
 * ASSUMES that vbglR0Enter has been called already.
 *
 * @param   a_fLocked       For the windows shared folders workarounds.
 *
 * @remarks Disabled the PageList feature for locked memory on Windows,
 *          because a new MDL is created by VBGL to get the page addresses
 *          and the pages from the MDL are marked as dirty when they should not.
 */
#if defined(RT_OS_WINDOWS)
# define VBGLR0_CAN_USE_PHYS_PAGE_LIST(a_fLocked) \
    ( !(a_fLocked) && (g_vbgldata.hostVersion.features & VMMDEV_HVF_HGCM_PHYS_PAGE_LIST) )
#else
# define VBGLR0_CAN_USE_PHYS_PAGE_LIST(a_fLocked) \
    ( !!(g_vbgldata.hostVersion.features & VMMDEV_HVF_HGCM_PHYS_PAGE_LIST) )
#endif

int vbglR0Enter (void);

#ifdef VBOX_WITH_HGCM
# ifndef VBGL_VBOXGUEST
int vbglR0HGCMInit (void);
int vbglR0HGCMTerminate (void);
# endif
#endif /* VBOX_WITH_HGCM */

#ifndef VBGL_VBOXGUEST
/**
 * Get a handle to the main VBoxGuest driver.
 * @returns VERR_TRY_AGAIN if the main driver has not yet been loaded.
 */
int vbglGetDriver(VBGLDRIVER **ppDriver);
#endif

#endif /* !___VBoxGuestLib_VBGLInternal_h */


text:
/* eslint-env browser */

'use strict;';

document.addEventListener('DOMContentLoaded', function() {
  const init = require('../src/dist/frontend/mathProgram');
  init();
}, false);


text:
class Vat{

    amount = null;
    rate = null;

}

 export default Vat;


text:
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

$this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title;
$web_path = \wanhunet\wanhunet::getAlias("@web") . "/";
?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>Login Page - wanhunet</title>

    <meta name="description" content="User login page"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

    <link rel="stylesheet" href="<?= $web_path ?>assets/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="<?= $web_path ?>assets/font-awesome/4.2.0/css/font-awesome.min.css"/>

    <link rel="stylesheet" href="<?= $web_path ?>assets/fonts/fonts.googleapis.com.css"/>

    <link rel="stylesheet" href="<?= $web_path ?>assets/css/ace.min.css"/>

    <link rel="stylesheet" href="<?= $web_path ?>assets/css/ace-rtl.min.css"/>

                            万虎网络

                                        请输入您的信息

                                    <?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
                                    <fieldset>

															<?= $form->field($model, 'username') ?>

															<?= $form->field($model, 'password')->passwordInput() ?>

                                                <?= $form->field($model, 'rememberMe')->checkbox() ?>

                                                <?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>

                                    </fieldset>
                                    <?php ActiveForm::end(); ?>


text:
const { expect } = require('chai')

const {
  init,
  resetAll,
} = require('../lib/DecoratorManager')

const {
  wrap,
  doWrap,
  validate
} = require('../lib/MethodWrapper')

/*
  IMPORTANT: We *must* initialize the decorators collection
             for /test before the tests, otherwise we'll get
             a bunch of errors.
 */
init('/test')

describe('MethodWrapper', () => {
  afterEach(resetAll)

  describe('wrap', () => {
    it('is a function', () =>
      expect(wrap).to.be.a('function')
    )

    it('returns a Promise', () => {
      const fn = Object.getPrototypeOf(wrap('test', { })).constructor

      expect(fn.name).to.equal('Promise')
    })

    it('wraps all methods on an object', async () => {
      const test = {
        $init: function({ done, progress }) {
          expect(done).to.be.a('function')
          expect(progress).to.be.a('function')

          done()
        },
        foo: function({ testParam, done, progress }) {
          expect(testParam).to.equal('bar')
          expect(done).to.be.a('function')
          expect(progress).to.be.a('function')

          done()
        }
      }

      const wrapped = await wrap('/test', test)

      await wrapped.$init()
      await wrapped.foo({ testParam: 'bar' })
    })

    it('does not wrap properties that are not functions', async () => {
      const test = {
        $init: false,
        foo: ({ done }) => done(),
        baz:   4,
      }

      const wrapped = await wrap('/test', test)

      expect(wrapped.baz).to.be.undefined
      expect(wrapped.$init).to.be.undefined
    })

    it('returns a frozen object', async () => {
      const test = {
        $init: function() { },
        foo:   function() { }
      }

      const wrapped = await wrap('/test', test)

      expect(Object.isFrozen(wrapped)).to.be.true
    })

    it('does not wrap methods if they are deps', async () => {
      const test = {
        deps: ['BAR -> bar'],
        bar:  function() { return 'Not wrapped' },
      }

      const wrapped = await wrap('/test', test)

      expect(wrapped.bar).to.be.undefined
    })
  })

  describe('doWrap', () => {
    it('is a function', () =>
      expect(doWrap).to.be.a('function')
    )

    it('returns an AsyncFunction', () => {
      const fn = Object.getPrototypeOf(doWrap('/test')).constructor

      expect(fn.name).to.equal('AsyncFunction')
    })

    it('returns a Promise from the returned AsyncFunction', () => {
      const fn = Object.getPrototypeOf(doWrap('/test')()).constructor

      expect(fn.name).to.equal('Promise')
    })

    it('invokes the specified property, using the passed self as the self param', async () => {
      const self     = { foo: 4 }
      const instance = { bar: function({ self, done }) { done(self.foo) } }
      const wrapped  = doWrap('/test', instance, 'bar', self)
      const result   = await wrapped()

      expect(result).to.equal(self.foo)
    })

    it('passes params through to the wrapped function', async () => {
      const self     = { }
      const instance = { bar: ({ example, done }) => done(example) }
      const wrapped  = doWrap('/test', instance, 'bar', self)
      const result   = await wrapped({ example: 'param' })

      expect(result).to.equal('param')
    })

    it('rejects the Promise when the wrapped function throws an error', async () => {
      const self     = { }
      const instance = { bar: () => { throw new Error('BOOM') } }
      const wrapped  = doWrap('/test', instance, 'bar', self)

      try {
        await wrapped()
      } catch (e) {
        expect(e.message).to.equal('BOOM')
      }
    })

    it('resolves the Promise when done is called', async () => {
      const self     = { }
      const instance = { bar: ({ done }) => done('whew!') }
      const wrapped  = doWrap('/test', instance, 'bar', self)
      const result   = await wrapped()

      expect(result).to.equal('whew!')
    })
  })

  describe('validate', () => {
    it('is a function', () =>
      expect(validate).to.be.a('function')
    )

    it('throws an error if passed an array', () => {
      try {
        validate([])
      } catch (e) {
        expect(e.message).to.equal('An array cannot be wrapped')
      }
    })

    it('throws an error if passed a string', () => {
      try {
        validate('foo')
      } catch (e) {
        expect(e.message).to.equal('string is not a valid type')
      }
    })

    it('throws an error if passed a number', () => {
      try {
        validate(4)
      } catch (e) {
        expect(e.message).to.equal('number is not a valid type')
      }
    })

    it('throws an error if passed a boolean', () => {
      try {
        validate(false)
      } catch (e) {
        expect(e.message).to.equal('boolean is not a valid type')
      }
    })

    it('throws an error if passed null', () => {
      try {
        validate(null)
      } catch (e) {
        expect(e.message).to.equal('Cannot wrap null')
      }
    })

    it('throws an error if passed undefined', () => {
      try {
        validate()
      } catch (e) {
        expect(e.message).to.equal('Cannot wrap undefined')
      }
    })

    it('throws an error if there are no functions to wrap', () => {
      try {
        validate({})
      } catch (e) {
        expect(e.message).to.equal('instance must contain at least one functional property')
      }
    })
  })
})


text:
module Admin4rails
  class Engine < ::Rails::Engine
    isolate_namespace Admin4rails

    config.generators do |g|
      g.test_framework :rspec
    end

    config.to_prepare do
      Devise::SessionsController.layout 'admin4rails/devise'
    end

    config.before_eager_load do
      Admin4rails.initialize!
    end

    config.after_initialize do
      Admin4rails.initialize!
    end
  end
end


text:
\defgroup mrpt_nav_grp [mrpt-nav]

Autonomous navigation, path planning

[TOC]

# Library mrpt-nav

This library is part of MRPT and can be installed in Debian-based systems with:

		sudo apt install libmrpt-nav-dev

Read also [how to import MRPT into your CMake scripts](mrpt_from_cmake.html).

This library implements:

- Reactive navigation:
  - Holonomic navigation algorithms: Virtual Force Fields (VFF), Nearness
Diagram (ND), ... See mrpt::nav::CAbstractHolonomicReactiveMethod
  - A complex reactive navigator: Using space transformations (PTGs) to drive a
robot using an internal simpler holonomic algorithm. See
mrpt::nav::CReactiveNavigationSystem
  - A number of different PTGs: See mrpt::nav::CParameterizedTrajectoryGenerator
  - See the full list of classes in mrpt::nav, or the online page
https://www.mrpt.org/list-of-mrpt-apps/application-reactivenavigationdemo/ for a
working application (see MRPT/apps/ReactiveNavigationDemo).

* Planned / hybrid navigation:
  * See mrpt::nav

# Library contents


text:
<!DOCTYPE html>

<title>SQR | squareroot.js</title>

<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, minimal-ui">
<meta charset="UTF-8">

<meta name='keywords' content='interactive,design,webgl,fwa,awwwards'/>
<meta name='description' content='We are Holotype - an interactive studio. We help our clients come up with the best digital ideas and turn those ideas into captivating interactive experiences.'/>

<meta property='og:title' content='Squareroot.js - Javascript creative coding library'/>
<meta property="og:site_name" content="sqr.holotype.co"/>
<meta property="og:url" content="http://sqr.holotype.co"/>
<meta property="og:description" content="Squareroot.js is a flexible and easy to use Javascript creative coding library based on the WebGL API. It is developed and maintained by Holotype."/>
<meta property="og:image" content="http://sqr.holotype.co/home/assets/share/sqr.jpg" />

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@bartekd">
<meta name="twitter:url" content="http://sqr.holotype.co">
<meta name="twitter:title" content="Squareroot.js - Javascript creative coding library">
<meta name="twitter:description" content="Squareroot.js is a flexible and easy to use Javascript creative coding library based on the WebGL API. It is developed and maintained by Holotype.">
<meta name="twitter:image" content="http://sqr.holotype.co/home/assets/share/sqr.jpg">

<link rel="icon" href="home/assets/favicon.png" type="image/x-icon">
<link rel="shortcut icon" href="home/assets/favicon.png" type="image/x-icon">

<link rel="stylesheet" type="text/css" href="home/css/master.css">

Squareroot.js

Squareroot.js is a Javascript creative coding library based on the WebGL API. It was developed and is maintained by Bartek Drozdz.

Squareroot.js code was born out of many years of experience in building WebGL apps. It is written in a pragmatic way - with the goal of getting things done rather than complying to a praticular programming pattern or philosphy. It makes it very flexible, powerful and easy to use, once you get familiar with it.

The first version of this library called J3D. After that is was re-written from scratch... three times. Each iteration was was built with better understanding of the underlying WebGL API and the mathematics of 2d and 3d rendering.

The structure is loosely based on Unity3d API, including the central concept of 'Transforms' as building blocks. It also features a Unity-to-WebGL exporter that can export meshes and skinned meshes, textures, animations and even entire scenes.

The library was initially used in many of our projects.

Currently, it is used in the Kuula Virtual Tour Software as the basis for the 360 panorama player. Founded in 2016, Kuula is used by over 300,000 people woirldwide and hosts over 10 million panoramic photos (and counting!).

Github Repository

API docs and tutorials

Basic Examples

Hello World!

Custom geometry

Post effect

Loading a mesh

Demos

Perlin Noise Animation

Real-time reflections

Depth-of-field effect

Animation aling splines

Dynamic geometry

2D animation

Skinned mesh

Live webcam reflection

More demos...

		Created by HOLOTYPE


text:
package org.apache.predictionio.tools

import org.apache.predictionio.tools.Common._
import org.apache.predictionio.tools.ReturnTypes._
import org.apache.predictionio.workflow.JsonExtractorOption
import org.apache.predictionio.workflow.JsonExtractorOption.JsonExtractorOption

import java.io.File
import grizzled.slf4j.Logging

import scala.sys.process._

case class DeployArgs(
  ip: String = "0.0.0.0",
  port: Int = 8000,
  logUrl: Option[String] = None,
  logPrefix: Option[String] = None)

case class EventServerArgs(
  enabled: Boolean = false,
  ip: String = "0.0.0.0",
  port: Int = 7070,
  stats: Boolean = false)

case class ServerArgs(
  deploy: DeployArgs = DeployArgs(),
  eventServer: EventServerArgs = EventServerArgs(),
  batch: String = "",
  accessKey: String = "",
  variantJson: Option[File] = None,
  jsonExtractor: JsonExtractorOption = JsonExtractorOption.Both)

object RunServer extends Logging {

  def runServer(
    engineInstanceId: String,
    serverArgs: ServerArgs,
    sparkArgs: SparkArgs,
    pioHome: String,
    engineDirPath: String,
    verbose: Boolean = false): Expected[(Process, () => Unit)] = {

    val jarFiles = jarFilesForScala(engineDirPath).map(_.toURI) ++
      Option(new File(pioHome, "plugins").listFiles())
        .getOrElse(Array.empty[File]).map(_.toURI)
    val args = Seq(
      "--engineInstanceId",
      engineInstanceId,
      "--engine-variant",
      serverArgs.variantJson.getOrElse(
        new File(engineDirPath, "engine.json")).getCanonicalPath,
      "--ip",
      serverArgs.deploy.ip,
      "--port",
      serverArgs.deploy.port.toString,
      "--event-server-ip",
      serverArgs.eventServer.ip,
      "--event-server-port",
      serverArgs.eventServer.port.toString) ++
      (if (serverArgs.accessKey != "") {
        Seq("--accesskey", serverArgs.accessKey)
      } else {
        Nil
      }) ++
      (if (serverArgs.eventServer.enabled) Seq("--feedback") else Nil) ++
      (if (serverArgs.batch != "") Seq("--batch", serverArgs.batch) else Nil) ++
      (if (verbose) Seq("--verbose") else Nil) ++
      serverArgs.deploy.logUrl.map(x => Seq("--log-url", x)).getOrElse(Nil) ++
      serverArgs.deploy.logPrefix.map(x => Seq("--log-prefix", x)).getOrElse(Nil) ++
      Seq("--json-extractor", serverArgs.jsonExtractor.toString)

    Runner.runOnSpark(
      "org.apache.predictionio.workflow.CreateServer",
      args, sparkArgs, jarFiles, pioHome, verbose)
  }
}


text:
// Type definitions for SkyWay
// Project: http://nttcom.github.io/skyway/
// Definitions by: Toshiya Nakakura <https://github.com/nakakura>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference path='../webrtc/RTCPeerConnection.d.ts' />

declare namespace PeerJs{
    interface PeerJSOption{
        key?: string;
        host?: string;
        port?: number;
        path?: string;
        secure?: boolean;
        turn?: boolean;
        config?: RTCPeerConnectionConfig;
        debug?: number;
    }

    interface PeerConnectOption{
        label?: string;
        metadata?: any;
        serialization?: string;
        reliable?: boolean;
    }

    interface DataConnection{
        send(data: any): void;
        close(): void;
        on(event: string, cb: ()=>void): void;
        on(event: 'data', cb: (data: any)=>void): void;
        on(event: 'open', cb: ()=>void): void;
        on(event: 'close', cb: ()=>void): void;
        on(event: 'error', cb: (err: any)=>void): void;
        off(event: string, fn: Function, once?: boolean): void;
        bufferSize: number;
        dataChannel: RTCDataChannel;
        label: string;
        metadata: any;
        open: boolean;
        peerConnection: any;
        peer: string;
        reliable: boolean;
        serialization: string;
        type: string;
    }

    interface MediaConnection{
        answer(stream?: any): void;
        close(): void;
        on(event: string, cb: ()=>void): void;
        on(event: 'stream', cb: (stream: any)=>void): void;
        on(event: 'close', cb: ()=>void): void;
        on(event: 'error', cb: (err: any)=>void): void;
        off(event: string, fn: Function, once?: boolean): void;
        open: boolean;
        metadata: any;
        peer: string;
        type: string;
    }

    interface utilSupportsObj {
        audioVideo: boolean;
        data: boolean;
        binary: boolean;
        reliable: boolean;
    }

    interface util{
        browser: string;
        supports: utilSupportsObj;
    }

    export interface Peer{
        /**
         *
         * @param id The brokering ID of the remote peer (their peer.id).
         * @param options for specifying details about Peer Connection
         */
        connect(id: string, options?: PeerJs.PeerConnectOption): PeerJs.DataConnection;
        /**
         * Connects to the remote peer specified by id and returns a data connection.
         * @param id The brokering ID of the remote peer (their peer.id).
         * @param stream The caller's media stream
         */
        call(id: string, stream: any): PeerJs.MediaConnection;
        /**
         * Calls the remote peer specified by id and returns a media connection.
         * @param event Event name
         * @param cb Callback Function
         */
        on(event: string, cb: ()=>void): void;
        /**
         * Emitted when a connection to the PeerServer is established.
         * @param event Event name
         * @param cb id is the brokering ID of the peer
         */
        on(event: 'open', cb: (id: string)=>void): void;
        /**
         * Emitted when a new data connection is established from a remote peer.
         * @param event Event name
         * @param cb Callback Function
         */
        on(event: 'connection', cb: (dataConnection: PeerJs.DataConnection)=>void): void;
        /**
         * Emitted when a remote peer attempts to call you.
         * @param event Event name
         * @param cb Callback Function
         */
        on(event: 'call', cb: (mediaConnection: PeerJs.MediaConnection)=>void): void;
        /**
         * Emitted when the peer is destroyed and can no longer accept or create any new connections.
         * @param event Event name
         * @param cb Callback Function
         */
        on(event: 'close', cb: ()=>void): void;
        /**
         * Emitted when the peer is disconnected from the signalling server
         * @param event Event name
         * @param cb Callback Function
         */
        on(event: 'disconnected', cb: ()=>void): void;
        /**
         * Errors on the peer are almost always fatal and will destroy the peer.
         * @param event Event name
         * @param cb Callback Function
         */
        on(event: 'error', cb: (err: any)=>void): void;
        /**
         * Remove event listeners.(EventEmitter3)
         * @param {String} event The event we want to remove.
         * @param {Function} fn The listener that we need to find.
         * @param {Boolean} once Only remove once listeners.
         */
        off(event: string, fn: Function, once?: boolean): void;
        /**
         * Close the connection to the server, leaving all existing data and media connections intact.
         */
        disconnect(): void;
        /**
         * Close the connection to the server and terminate all existing connections.
         */
        destroy(): void;
        /**
         * Get a list of available peer IDs
         * @param callback
         */
        listAllPeers(callback: (peerIds: Array<string>)=>void): void;

        /**
         * The brokering ID of this peer
         */
        id: string;
        /**
         * A hash of all connections associated with this peer, keyed by the remote peer's ID.
         */
        connections: any;
        /**
         * false if there is an active connection to the PeerServer.
         */
        disconnected: boolean;
        /**
         * true if this peer and all of its connections can no longer be used.
         */
        destroyed: boolean;
    }
}

declare var Peer: {
    prototype: RTCIceServer;
    /**
     * A peer can connect to other peers and listen for connections.
     * @param id Other peers can connect to this peer using the provided ID.
     *     If no ID is given, one will be generated by the brokering server.
     * @param options for specifying details about PeerServer
     */
    new (id: string, options?: PeerJs.PeerJSOption): PeerJs.Peer;

    /**
     * A peer can connect to other peers and listen for connections.
     * @param options for specifying details about PeerServer
     */
    new (options: PeerJs.PeerJSOption): PeerJs.Peer;
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Openbiz Cubi Application Platform
  LICENSE http://code.google.com/p/openbiz-cubi/wiki/CubiLicense
  Copyright (c) 2005-2011, Openbiz Technology LLC
  Version $Id: ResetPasswordForm.xml 5524 2014-06-06 14:08:36Z rockyswen@gmail.com $
-->
<EasyForm Name="ResetPasswordForm" Class="ResetPasswordForm" Icon="icon_my_password.gif" FormType="Edit" jsClass="jbForm" Title="Change Password" Description="You can setup a new password in below form." DataService="/myaccount/users" TemplateEngine="Smarty" MessageFile="myaccount.ini" TemplateFile="detail.tpl">
    <DataPanel>
        <Element Name="fld_Id" Hidden="Y" Class="Hidden" FieldName="Id" Label="User Id"/>
        <Element Name="fld_username" Class="LabelText" FieldName="username" Label="Username" Width="200"/>
		<Element Name="fld_email" Class="LabelText" FieldName="email" Label="Email Address" Width="200" CssClass=""/>
        <Element Name="fld_password_old" Class="Password" label="Old Password" FieldName="password_old" Description="Current password" Required="Y"  />
		<Element Name="fld_password" Class="Password" label="New Password" FieldName="password_new" Description="Longer than 4 characters" Required="Y"  />
		<Element Name="fld_password_repeat" Class="Password" Required="Y" FieldName="password_repeat" Description="Same as new password" Label="Repeat" />
        <!--<Element Name="fld_logoff" Class="Checkbox" Description="Log off after passwd changed"  SelectFrom="1" DefaultValue="0" DefaultChecked="{@:m_DefaultLogoff}" FieldName="_logoff" Label="Action" />-->
    </DataPanel>
    <ActionPanel>
        <Element Name="btn_save" Class="Button" Text="Submit" CssClass="button_gray_w" Click="save()"/>
        <Element Name="btn_back" Class="Button" Text="Back" CssClass="button_gray_m" Click="back()"/>
    </ActionPanel>
    <NavPanel>
    </NavPanel>
    <SearchPanel>
    </SearchPanel>
</EasyForm>


text:
package com.thinkbiganalytics.search.rest.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.List;
import java.util.Map;

/**
 * Store the execution metadata and actual results of a search
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class SearchResult {

    private String query;
    private Long totalHits;
    private Long tookInMillis;
    private Long from;
    private Long to;
    private String engine;

    private Map<SearchResultType, Long> searchResultsSummary;
    private List<SearchResultData> searchResults;

    public SearchResult() {
    }

    public String getQuery() {
        return query;
    }

    public void setQuery(String query) {
        this.query = query;
    }

    public Long getTotalHits() {
        return totalHits;
    }

    public void setTotalHits(Long totalHits) {
        this.totalHits = totalHits;
    }

    public Long getFrom() {
        return this.from;
    }

    public void setFrom(Long from) {
        this.from = from;
    }

    public Long getTo() {
        return this.to;
    }

    public Long getTookInMillis() {
        return tookInMillis;
    }

    public void setTookInMillis(Long tookInMillis) {
        this.tookInMillis = tookInMillis;
    }

    public void setTo(Long to) {
        this.to = to;
    }

    public String getEngine() {
        return engine;
    }

    public void setEngine(String engine) {
        this.engine = engine;
    }

    public List<SearchResultData> getSearchResults() {
        return searchResults;
    }

    public void setSearchResults(List<SearchResultData> searchResults) {
        this.searchResults = searchResults;
    }

    public Map<SearchResultType, Long> getSearchResultsSummary() {
        return searchResultsSummary;
    }

    public void setSearchResultsSummary(Map<SearchResultType, Long> searchResultsSummary) {
        this.searchResultsSummary = searchResultsSummary;
    }
}


text:
import * as React from 'react';
import { StandardProps } from '..';
import { ButtonBaseProps, ButtonBaseClassKey } from '../ButtonBase';

export interface ListItemProps extends StandardProps<
  ButtonBaseProps & React.LiHTMLAttributes<HTMLElement>,
  ListItemClassKey,
  'component'
> {
  button?: boolean;
  component?: string | React.ComponentType<ListItemProps>;
  dense?: boolean;
  disabled?: boolean;
  disableGutters?: boolean;
  divider?: boolean;
}

export type ListItemClassKey =
  | ButtonBaseClassKey
  | 'container'
  | 'keyboardFocused'
  | 'default'
  | 'dense'
  | 'divider'
  | 'gutters'
  | 'button'
  | 'secondaryAction'
  ;

declare const ListItem: React.ComponentType<ListItemProps>;

export default ListItem;


text:
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="{{ page_lang.language_name }}"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="{{ page_lang.language_name }}"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="{{ page_lang.language_name }}"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="{{ page_lang.language_name }}"> <!--<![endif]-->
<head>
    <meta charset="utf-8">
    <title>{% block meta_title %}{{ SITE.name }}{% endblock %}</title>
    <meta name="robots" content="follow, all">
</head>

<body class="{% block body_classes %}lang-{{ page_lang.language_name }}{% endblock %}"{% block body_attrs %}{% endblock %}>
    {% block base_content %}{% endblock %}
</body>
</html>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
J. Cincinnati Soc. Nat. Hist. 8: 97 (1885)

#### Original name
Polyporus cincinnatus var. cincinnatus Morgan

### Remarks
null


text:
id: 2
name: 'port'
---
The port number to connect to. (Default: `3306`)


text:
from sys import maxsize
class Contacts:

    def __init__(self, name = None, middlename = None, lastname = None, nickname = None, company = None, companyaddress = None, homenumber = None, mobilenumber = None,
                     worknumber = None, faxnumber = None, email = None, email2 = None, email3 = None, homeaddress = None, secondhomenumber = None, notes = None, id = None, all_numbers_from_home_page=None, all_mails_from_home_page = None):
        self.name = name
        self.middlename = middlename
        self.lastname = lastname
        self.nickname = nickname
        self.company = company
        self.companyaddress = companyaddress
        self.homenumber = homenumber
        self.mobilenumber = mobilenumber
        self.worknumber = worknumber
        self.faxnumber = faxnumber
        self.email = email
        self.email2 = email2
        self.email3 = email3
        self.homeaddress = homeaddress
        self.secondhomenumber = secondhomenumber
        self.notes = notes
        self.id = id
        self.all_numbers_from_home_page = all_numbers_from_home_page
        self.all_mails_from_home_page = all_mails_from_home_page

    def __repr__(self):
        return "%s:%s:%s:%s:%s:%s" % (self.id, self.name, self.lastname, self.companyaddress, self.email, self.homenumber)

    def __eq__(self, other):
        return (self.id is None or other.id is None or self.id == other.id) and self.name == other.name and self.lastname == other.lastname

    def id_or_max(self):
        if self.id:
            return int(self.id)
        else:
            return maxsize


text:
<?php

namespace ConsumerrTest\Nette;

use Consumerr\DI\ConsumerrExtension;
use Nette;
use Nette\Application\Application;
use Tester;

abstract class TestCase extends Tester\TestCase
{

	protected function createContainer()
	{
		$config = new Nette\Configurator();
		$config->setTempDirectory(TEMP_DIR);
		$config->addParameters(array('appDir' => __DIR__));
		ConsumerrExtension::register($config);
		if (Nette\Framework::VERSION_ID < 20300) {
			$config->addConfig(__DIR__ . '/test-config-2.2.neon', $config::NONE);
		} else {
			$config->addConfig(__DIR__ . '/test-config.neon', $config::NONE);
		}

		$container = $config->createContainer();

		/** @var \Nette\DI\Container|\SystemContainer $container */

		return $container;
	}

	/**
	 * @return \Nette\DI\Container|\SystemContainer
	 */
	protected function initApplication()
	{
		$container = $this->createContainer();

		/** @var Application $application */
		$application = $container->getByType('Nette\\Application\\Application');
		$application->onStartup($application);

		return $container;
	}

}


text:
<?php
/**
 * Created by PhpStorm.
 * User: Felipe
 * Date: 15/10/2016
 * Time: 17:08
 */

namespace Application\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use DOMPDFModule\View\Model\PdfModel;

class PdfController extends AbstractActionController
{
    public function indexAction() {
        // Instantiate new PDF Model
        $pdf = new PdfModel();

        // set filename
        $pdf->setOption('filename', 'hello.pdf');

        // Defaults to "8x11"
        $pdf->setOption('paperSize', 'a4');

        // paper orientation
        $pdf->setOption('paperOrientation', 'portrait');

        $pdf->setVariables(array(
            'var1' => 'Liverpool FC',
            'var2' => 'Atletico Madrid',
            'var3' => 'Borussia Dortmund'
        ));

        return $pdf;
    }
}