text:
require 'formatron/generators/bootstrap'

class Formatron
  class CLI
    module Generators
      # CLI command for bootstrap generator
      # rubocop:disable Metrics/ModuleLength
      module Bootstrap
        # rubocop:disable Metrics/MethodLength
        # rubocop:disable Metrics/AbcSize
        def bootstrap_options(c)
          c.option '-n', '--name STRING', 'The name for the configuration'
          c.option(
            '-s',
            '--s3-bucket STRING',
            'The S3 bucket to store encrypted configuration'
          )
          c.option(
            '-k',
            '--kms-key STRING',
            'The KMS key to use for encryption'
          )
          c.option(
            '-e',
            '--ec2-key-pair STRING',
            'The EC2 key pair to associate with EC2 instances'
          )
          c.option(
            '-z',
            '--hosted-zone-id STRING',
            'The Route53 Hosted Zone ID for the public hosted zone'
          )
          c.option(
            '-a',
            '--availability-zone STRING',
            'The AWS availability zone letter (region is already taken ' \
            'from the AWS credentials)'
          )
          c.option(
            '-b',
            '--cookbooks-bucket-prefix STRING',
            'Used to generate target specific S3 bucket names ' \
            '(PREFIX-TARGET) for the Chef Server to store its ' \
            'cookbook library'
          )
          c.option(
            '-o',
            '--organization-short-name STRING',
            'The short name of the organization to create on the ' \
            'Chef Server (should not contain spaces, etc)'
          )
          c.option(
            '-w',
            '--organization-full-name STRING',
            'The full name of the organization to create on the Chef Server'
          )
          c.option(
            '-u',
            '--username STRING',
            'The username to create on the Chef Server'
          )
          c.option(
            '-p',
            '--password STRING',
            'The password for the Chef Server user'
          )
          c.option(
            '-m',
            '--email STRING',
            'The email address for the Chef Server user'
          )
          c.option(
            '-f',
            '--first-name STRING',
            'The first name of the Chef Server user'
          )
          c.option(
            '-l',
            '--last-name STRING',
            'The last name of the Chef Server user'
          )
          c.option(
            '-i',
            '--instance-cookbook STRING',
            'The instance cookbook to apply additional ' \
            'configuration to the Chef Server'
          )
          c.option(
            '-x',
            '--protected-targets LIST',
            Array,
            'The protected targets (eg. production)'
          )
          c.option(
            '-q',
            '--unprotected-targets LIST',
            Array,
            'The unprotected targets (eg. test)'
          )
        end
        # rubocop:enable Metrics/AbcSize
        # rubocop:enable Metrics/MethodLength

        def bootstrap_directory(options)
          options.directory || ask('Directory? ') do |q|
            q.default = Dir.pwd
          end
        end

        def bootstrap_name(options, directory)
          options.name || ask('Name? ') do |q|
            q.default = File.basename directory
          end
        end

        def bootstrap_s3_bucket(options)
          options.s3_bucket || ask('S3 Bucket? ')
        end

        def bootstrap_kms_key(options)
          options.kms_key || ask('KMS Key? ')
        end

        def bootstrap_ec2_key_pair(options)
          options.ec2_key_pair || ask('EC2 Key Pair? ')
        end

        def bootstrap_hosted_zone_id(options)
          options.hosted_zone_id || ask('Hosted Zone ID? ')
        end

        def bootstrap_availability_zone(options)
          options.availability_zone || ask('Availability Zone? ')
        end

        def bootstrap_cookbooks_bucket_prefix(options)
          options.cookbooks_bucket_prefix || ask(
            'Chef Server Cookbooks Bucket Prefix? '
          ) do |q|
            q.default = "#{options.s3_bucket}-cookbooks"
          end
        end

        def bootstrap_organization_short_name(options)
          options.organization_short_name ||
            ask('Chef Server Organization Short Name? ')
        end

        def bootstrap_organization_full_name(options)
          options.organization_full_name ||
            ask('Chef Server Organization Full Name? ')
        end

        def bootstrap_username(options)
          options.username || ask('Chef Server Username? ')
        end

        def bootstrap_password(options)
          options.password || password('Chef Server Password? ')
        end

        def bootstrap_email(options)
          options.email || ask('Chef Server User Email? ')
        end

        def bootstrap_first_name(options)
          options.first_name || ask('Chef Server User First Name? ')
        end

        def bootstrap_last_name(options)
          options.last_name || ask('Chef Server User Last Name? ')
        end

        def bootstrap_protected_targets(options)
          options.protected_targets || ask('Protected Targets? ', Array) do |q|
            q.default = 'production'
          end
        end

        def bootstrap_unprotected_targets(options)
          options.unprotected_targets ||
            ask('Unprotected Targets? ', Array) do |q|
              q.default = 'test'
            end
        end

        def bootstrap_targets(options)
          protected_targets = bootstrap_protected_targets options
          unprotected_targets = bootstrap_unprotected_targets options
          targets = {}
          protected_targets.each do |target|
            targets[target.to_sym] = { protect: true }
          end
          unprotected_targets.each do |target|
            targets[target.to_sym] = { protect: false }
          end
          targets
        end

        # rubocop:disable Metrics/MethodLength
        def bootstrap_params(options, directory)
          {
            name: bootstrap_name(options, directory),
            s3_bucket: bootstrap_s3_bucket(options),
            kms_key: bootstrap_kms_key(options),
            ec2_key_pair: bootstrap_ec2_key_pair(options),
            hosted_zone_id: bootstrap_hosted_zone_id(options),
            availability_zone: bootstrap_availability_zone(options),
            chef_server: {
              cookbooks_bucket_prefix:
                bootstrap_cookbooks_bucket_prefix(options),
              organization: {
                short_name: bootstrap_organization_short_name(options),
                full_name: bootstrap_organization_full_name(options)
              },
              username: bootstrap_username(options),
              password: bootstrap_password(options),
              email: bootstrap_email(options),
              first_name: bootstrap_first_name(options),
              last_name: bootstrap_last_name(options)
            },
            targets: bootstrap_targets(options)
          }
        end
        # rubocop:enable Metrics/MethodLength

        def bootstrap_action(c)
          c.action do |_args, options|
            directory = bootstrap_directory options
            Formatron::Generators::Bootstrap.generate(
              directory,
              bootstrap_params(options, directory)
            )
          end
        end

        def bootstrap_formatron_command
          command :'generate bootstrap' do |c|
            c.syntax = 'formatron generate bootstrap [options]'
            c.summary = 'Generate a bootstrap configuration'
            c.description = 'Generate a bootstrap configuration'
            bootstrap_options c
            bootstrap_action c
          end
        end
      end
      # rubocop:enable Metrics/ModuleLength
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.intellij.internal.focus;

import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.wm.impl.FocusRequestInfo;
import com.intellij.ui.JBColor;
import com.intellij.ui.JBSplitter;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.ui.table.JBTable;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumnModel;
import java.awt.*;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Konstantin Bulenkov
 */
public class FocusTracesDialog extends DialogWrapper {
  private final JTextPane myStacktrace = new JTextPane();
  private final JBTable myRequestsTable;
  private final List<FocusRequestInfo> myRequests;
  private static final String[] COLUMNS = {"Time", "Forced", "Component"};

  public FocusTracesDialog(Project project, ArrayList<FocusRequestInfo> requests) {
    super(project);
    myRequests = requests;
    setTitle("Focus Traces");
    final String[][] data = new String[requests.size()][];
    for (int i = 0; i < data.length; i++) {
      final FocusRequestInfo r = requests.get(i);
      data[i] = new String[]{r.getDate(), String.valueOf(r.isForced()), String.valueOf(r.getComponent())};
    }
    setModal(false);
    myRequestsTable = new JBTable(new DefaultTableModel(data, COLUMNS) {
      @Override
      public boolean isCellEditable(int row, int column) {
        return false;
      }
    });
    final ListSelectionListener selectionListener = new ListSelectionListener() {
      @Override
      public void valueChanged(ListSelectionEvent e) {
        final int index = myRequestsTable.getSelectedRow();
        if (-1 < index && index < myRequests.size()) {
          myStacktrace.setText(myRequests.get(index).getStackTrace());
          myStacktrace.setCaretPosition(0);
        }
        else {
          myStacktrace.setText("");
        }
      }
    };
    myRequestsTable.getSelectionModel().addListSelectionListener(selectionListener);
    final TableColumnModel columnModel = myRequestsTable.getColumnModel();
    columnModel.getColumn(0).setMinWidth(120);
    columnModel.getColumn(0).setMaxWidth(120);
    columnModel.getColumn(0).setPreferredWidth(120);
    columnModel.getColumn(1).setMinWidth(60);
    columnModel.getColumn(1).setMaxWidth(60);
    columnModel.getColumn(1).setPreferredWidth(60);
    myRequestsTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    myRequestsTable.changeSelection(0, 0, false, true);
    init();
  }

  @Override
  protected String getDimensionServiceKey() {
    return "ide.internal.focus.trace.dialog";
  }

  @Override
  protected JComponent createCenterPanel() {
    JPanel panel = new JPanel(new BorderLayout());
    JBSplitter splitter = new JBSplitter(true, .5F, .2F, .8F);
    splitter.setFirstComponent(new JBScrollPane(myRequestsTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
    splitter.setSecondComponent(
      new JBScrollPane(myStacktrace, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
    panel.add(splitter, BorderLayout.CENTER);
    return panel;
  }

  @Override
  public JComponent getPreferredFocusedComponent() {
    return myRequestsTable;
  }

  @NotNull
  @Override
  protected Action[] createActions() {
    return new Action[] {getOKAction(), getCopyStackTraceAction()};
  }

  private Action getCopyStackTraceAction() {
    return new AbstractAction("&Copy stacktrace") {
      @Override
      public void actionPerformed(ActionEvent e) {
        CopyPasteManager.getInstance().setContents(new StringSelection(myStacktrace.getText()));
      }
    };
  }

  @Override
  public void show() {
    final BorderDrawer drawer = new BorderDrawer();
    drawer.start();
    super.show();
    drawer.setDone();
  }

  class BorderDrawer extends Thread {
    Component prev = null;
    private volatile boolean running = true;
    BorderDrawer() {
      super("Focus Border Drawer");
    }

    @Override
    public void run() {
      try {
        while (running) {
          sleep(100);
          paintBorder();
        }
        if (prev != null) {
          prev.repaint();
        }
      }
      catch (InterruptedException e) {//
      }
    }

    private void paintBorder() {
      final int row = FocusTracesDialog.this.myRequestsTable.getSelectedRow();
      if (row != -1) {
        final FocusRequestInfo info = FocusTracesDialog.this.myRequests.get(row);
        if (prev != null && prev != info.getComponent()) {
          prev.repaint();
        }
        prev = info.getComponent();
        if (prev != null && prev.isDisplayable()) {
          final Graphics g = prev.getGraphics();
          g.setColor(JBColor.RED);
          final Dimension sz = prev.getSize();
          UIUtil.drawDottedRectangle(g, 1, 1, sz.width - 2, sz.height - 2);
        }
      }
    }

    public void setDone() {
      running = false;
    }
  }
}


text:
package edu.stanford.me202.smartbike;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.Vibrator;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.InputType;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ControlActivity extends AppCompatActivity {
    private final String BLETAG = "Bluetooth";
    private final static String TAG = ControlActivity.class.getSimpleName();

    private BluetoothLEService bleService;
    private EditText bikeIdentifier;

    private String data = "";
    private boolean response2theft = false;

    // light settings
    @BindView(R.id.lightmode_switch) MaterialAnimatedSwitch lightMode_switch;
    @BindView(R.id.lightstate_switch) MaterialAnimatedSwitch lightState_switch;
    @BindView(R.id.lightmodeText) TextView lightMode_text;
    @BindView(R.id.lightstateText) TextView lightState_text;
    // bluetooth status parameters
    @BindView(R.id.connectionStatus) TextView connectionStatus;
    @BindView(R.id.bikecode) TextView bikeCode;
    @BindView(R.id.lock_unlock) TextView lock_unlock;

    private final ServiceConnection mServiceConnection = new ServiceConnection() {

        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
            BluetoothLEService.LocalBinder binder = (BluetoothLEService.LocalBinder)service;
            bleService = binder.getService();
        }

        @Override
        public void onServiceDisconnected(ComponentName name) {
            bleService = null;
        }
    };

    public BroadcastReceiver BluetoothReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (intent.getAction().equals(bleService.ACTION_DATA_AVAILABLE)){
                data += intent.getStringExtra(bleService.EXTRA_DATA);

                if (data.endsWith("@")) {
                    Log.d(BLETAG, "Accelerometer raw data: " + data);
                    String delim = "@";
                    String accelInfo = data.split(delim)[0];

                    if (accelInfo.endsWith("1")) {
                        // vibration for 800ms as reminder
                        ((Vibrator)getSystemService(VIBRATOR_SERVICE)).vibrate(800);

                        if (!response2theft) {
                            // show alert
                            AlertDialog.Builder theftAlertBuilder = new AlertDialog.Builder(ControlActivity.this);
                            theftAlertBuilder.setTitle(R.string.stealalert);
                            theftAlertBuilder.setIcon(R.drawable.warning);
                            theftAlertBuilder.setCancelable(true);
                            theftAlertBuilder.setPositiveButton("GOT IT!", new DialogInterface.OnClickListener() {
                                @Override
                                public void onClick(DialogInterface dialog, int which) {
                                    // for further map or GPS function
                                    response2theft = false;
                                }
                            }).setNegativeButton("DISMISS", new DialogInterface.OnClickListener() {
                                @Override
                                public void onClick(DialogInterface dialog, int which) {
                                    // do nothing
                                    response2theft = false;
                                }
                            }).show();

                            response2theft = true;
                        }
                    }

                    // reset data string
                    data = "";
                }
            }

            // Bluetooth Connected
            if (intent.getAction().equals(bleService.ACTION_GATT_CONNECTED)){
                // tell Arduino that BLE is connected
                Log.d(BLETAG, "CONNECTED");
                String string = "c";
                byte[] b = string.getBytes();
                bleService.writeRXCharacteristic(b);

                String bikeMAC = bikeIdentifier.getText().toString();
                Toast connectBluetoothToast = Toast.makeText(ControlActivity.this, "Successfully connected " + bikeMAC, Toast.LENGTH_SHORT);
                connectBluetoothToast.show();

                // update connection status and bike identifier on display
                connectionStatus.setText(R.string.connectionYes);
                lock_unlock.setText(R.string.lockhint);
                String bikeID = getString(R.string.bikeID) + bikeMAC;
                bikeCode.setText(bikeID);

                // allow access to light settings and show default settings
                lightMode_switch.setVisibility(View.VISIBLE);
                lightState_switch.setVisibility(View.VISIBLE);
                lightMode_text.setVisibility(View.VISIBLE);
                lightState_text.setVisibility(View.VISIBLE);
            }

            // Bluetooth Disconnected
            if (intent.getAction().equals(bleService.ACTION_GATT_DISCONNECTED)){
                // Show a toast
                Toast connectBluetoothToast = Toast.makeText(ControlActivity.this, R.string.disconnectwarning, Toast.LENGTH_SHORT);
                connectBluetoothToast.show();

                // hide light settings
                lightMode_switch.setVisibility(View.GONE);
                lightState_switch.setVisibility(View.GONE);
                lightMode_text.setVisibility(View.GONE);
                lightState_text.setVisibility(View.GONE);

                // update status
                connectionStatus.setText(R.string.connectionNo);
                lock_unlock.setText(R.string.unlockhint);
                bikeCode.setText(R.string.bikecodeNULL);
            }

        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_control);
        ButterKnife.bind(this);

        // Before unlocking, users have no access to light settings
        lightMode_switch.setVisibility(View.GONE);
        lightState_switch.setVisibility(View.GONE);
        lightMode_text.setVisibility(View.GONE);
        lightState_text.setVisibility(View.GONE);

        // check light state
        lightState_switch.setOnCheckedChangeListener(new MaterialAnimatedSwitch.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(boolean isChecked) {
                if (isChecked){ // light state: ON
                    // update light state text
                    lightState_text.setText(R.string.lightstateON);
                    // send string to Adafruit bluetooth module
                    Log.d(BLETAG, "ON");
                    String string = "n";
                    byte[] b = string.getBytes();
                    bleService.writeRXCharacteristic(b);
                } else { // light state: AUTO
                    lightState_text.setText(R.string.lightstateAUTO);
                    Log.d(BLETAG, "AUTO");
                    String string = "a";
                    byte[] b = string.getBytes();
                    bleService.writeRXCharacteristic(b);
                }
            }
        });

        lightMode_switch.setOnCheckedChangeListener(new MaterialAnimatedSwitch.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(boolean isChecked) {

                if (isChecked){ // light mode: BLINK
                    lightMode_text.setText(R.string.lightmodeBLINK);
                    Log.d(BLETAG, "BLINK");
                    String string = "b";
                    byte[] b = string.getBytes();
                    bleService.writeRXCharacteristic(b);
                } else { // light mode: SOLID
                    lightMode_text.setText(R.string.lightmodeSOLID);
                    Log.d(BLETAG, "SOLID");
                    String string = "s";
                    byte[] b = string.getBytes();
                    bleService.writeRXCharacteristic(b);
                }
            }
        });
    }

    @Override
    protected void onResume() {
        super.onResume();

        /* Service start: this service will live and die with this activity; unless we
           control the lifecycle of this this by using startService(intent), stopService(intent)
         */
        Intent intent = new Intent(ControlActivity.this,BluetoothLEService.class);
        bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE);

        IntentFilter filter = new IntentFilter(bleService.ACTION_DATA_AVAILABLE);
        filter.addAction(bleService.ACTION_GATT_CONNECTED );
        filter.addAction(bleService.ACTION_GATT_DISCONNECTED );

        LocalBroadcastManager.getInstance(this).registerReceiver(BluetoothReceiver,filter);
    }

    @Override
    protected void onStart() {
        super.onStart();
    }

    @Override
    protected void onStop() {
        super.onStop();
        LocalBroadcastManager.getInstance(this).unregisterReceiver(BluetoothReceiver);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        unbindService(mServiceConnection);
        bleService = null;
    }

    public void unlock(View view) {
        if (lock_unlock.getText().toString().equals(getString(R.string.unlockhint))) {
            // configure attributes of dialog
            AlertDialog.Builder unlockDialogBuilder = new AlertDialog.Builder(this);
            unlockDialogBuilder.setTitle(R.string.unlockDialogTitle);
            unlockDialogBuilder.setCancelable(true);
            unlockDialogBuilder.setIcon(R.drawable.bluetooth);

            bikeIdentifier = new EditText(ControlActivity.this);
            bikeIdentifier.setHint(R.string.unlockDialogHint);
            bikeIdentifier.setText(R.string.bikeIdentifier);
            bikeIdentifier.setInputType(InputType.TYPE_CLASS_TEXT);
            bikeIdentifier.setMaxLines(1);
            unlockDialogBuilder.setView(bikeIdentifier);

            unlockDialogBuilder.setPositiveButton(
                    R.string.unlockDialogYes,
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            if (bikeIdentifier.getText().toString().isEmpty()) {
                                Toast.makeText(ControlActivity.this, R.string.emptybikeIDerror, Toast.LENGTH_SHORT).show();
                            } else {
                                // get bike identifier user enters
                                String bike2connect = bikeIdentifier.getText().toString();
                                // show toast
                                Toast.makeText(ControlActivity.this, "Connecting " + bike2connect + "...", Toast.LENGTH_SHORT).show();
                                // Initialize bluetooth service
                                bleService.initialize();
                                // Try to connect to bluetooth of this address
                                bleService.connect(bike2connect);
                            }
                        }
                    });

            unlockDialogBuilder.setNegativeButton(
                    R.string.unlockDialogNo,
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            dialog.cancel();
                        }
                    });

            // show dialog
            final AlertDialog unlockDialog = unlockDialogBuilder.create();
            unlockDialog.show();
        }

        if (lock_unlock.getText().toString().equals(getString(R.string.lockhint))) {
            // tell Arduino to reset
            Log.d(BLETAG, "RESET");
            String string = "r";
            byte[] b = string.getBytes();
            bleService.writeRXCharacteristic(b);
            bleService.disconnect();
        }
    }

    public void showRideHistory(View view) {
        Intent intent = new Intent(this, RideHistoryActivity.class);
        startActivity(intent);
        lightState_text.setText(R.string.lightstateAUTO);
    }
}


text:
/*
    Universidade Federal de São Carlos - Campus Sorocaba
    Compiladores: Trabalho 2
    Professora: Tiemi Christine Sakata

    Alunos:
        Arthur Pessoa de Souza
        João Eduardo Brandes Luiz
*/

package AST;

import java.io.PrintWriter;

abstract public class Expr {
    abstract public void genC( PW pw, boolean putParenthesis );
      // new method: the type of the expression
    abstract public Type getType();
}


text:
  margin:0px 0px 20px 20px;
}

#main .deedleframe td, #main .deedleframe th {
  padding:4px 10px 4px 10px;
  min-width:50px;
}
#main .deedleseries td, #main .deedleseries th {
  padding:4px 20px 4px 10px;
}
#main .deedleframe td:first-child, #main .deedleframe th:first-child {
  min-width:30px;
}
#main .deedleseries thead th,
#main .deedleseries td:first-child,
#main .deedleframe thead th,
#main .deedleframe td:first-child {
  padding:4px 20px 4px 10px;
  text-align:left;
  font-weight:bold;
}
#main .deedleseries table,
#main .deedleframe table {
  border-left:1px solid #e0e0e0;
  border-top:1px solid #e0e0e0;
}
#main .deedleseries td, #main .deedleseries th,
#main .deedleframe td, #main .deedleframe th {
  border-right:1px solid #e0e0e0;
  border-bottom:1px solid #e0e0e0;
}
#main .deedleseries thead th,
#main .deedleframe thead th,
#main .deedleframe tr.even {
  background:white;
}
#main .deedleseries tr.odd,
#main .deedleframe tr.odd {
  background:#f8f8f8;
}

#main .deedleseries p,
#main .deedleframe p {
  font-size:90%;
  margin:0px;
  padding:0px;
  line-height:normal;
}


text:
function New-VSEC2ClientVpnEndpoint {
    <#
    .SYNOPSIS
        Adds an AWS::EC2::ClientVpnEndpoint resource to the template. Specifies a Client VPN endpoint. A Client VPN endpoint is the resource you create and configure to enable and manage client VPN sessions. It is the destination endpoint at which all client VPN sessions are terminated.

    .DESCRIPTION
        Adds an AWS::EC2::ClientVpnEndpoint resource to the template. Specifies a Client VPN endpoint. A Client VPN endpoint is the resource you create and configure to enable and manage client VPN sessions. It is the destination endpoint at which all client VPN sessions are terminated.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html

    .PARAMETER LogicalId
        The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template. Use the logical name to reference the resource in other parts of the template. For example, if you want to map an Amazon Elastic Block Store volume to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.

    .PARAMETER ClientCidrBlock
        The IPv4 address range, in CIDR notation, from which to assign client IP addresses. The address range cannot overlap with the local CIDR of the VPC in which the associated subnet is located, or the routes that you add manually. The address range cannot be changed after the Client VPN endpoint has been created. The CIDR block should be /22 or greater.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-clientcidrblock
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER ConnectionLogOptions
        Information about the client connection logging options.
If you enable client connection logging, data about client connections is sent to a Cloudwatch Logs log stream. The following information is logged:
+ Client connection requests
+ Client connection results successful and unsuccessful
+ Reasons for unsuccessful client connection requests
+ Client connection termination time

        Type: ConnectionLogOptions
        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-connectionlogoptions
        UpdateType: Mutable

    .PARAMETER SplitTunnel
        Indicates whether split-tunnel is enabled on the AWS Client VPN endpoint.
By default, split-tunnel on a VPN endpoint is disabled.
For information about split-tunnel VPN endpoints, see Split-Tunnel AWS Client VPN Endpoint: https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html in the *AWS Client VPN Administrator Guide*.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-splittunnel
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER Description
        A brief description of the Client VPN endpoint.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-description
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER TagSpecifications
        The tags to apply to the Client VPN endpoint during creation.

        Type: List
        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-tagspecifications
        ItemType: TagSpecification
        UpdateType: Immutable

    .PARAMETER VpcId
        The ID of the VPC to associate with the Client VPN endpoint. If no security group IDs are specified in the request, the default security group for the VPC is applied.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-vpcid
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER AuthenticationOptions
        Information about the authentication method to be used to authenticate clients.

        Type: List
        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-authenticationoptions
        ItemType: ClientAuthenticationRequest
        UpdateType: Immutable

    .PARAMETER ServerCertificateArn
        The ARN of the server certificate. For more information, see the AWS Certificate Manager User Guide: https://docs.aws.amazon.com/acm/latest/userguide/.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-servercertificatearn
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER DnsServers
        Information about the DNS servers to be used for DNS resolution. A Client VPN endpoint can have up to two DNS servers. If no DNS server is specified, the DNS address configured on the device is used for the DNS server.

        PrimitiveItemType: String
        Type: List
        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-dnsservers
        UpdateType: Mutable

    .PARAMETER TransportProtocol
        The transport protocol to be used by the VPN session.
Default value: udp

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-transportprotocol
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER SecurityGroupIds
        The IDs of one or more security groups to apply to the target network. You must also specify the ID of the VPC that contains the security groups.

        PrimitiveItemType: String
        Type: List
        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-securitygroupids
        UpdateType: Mutable

    .PARAMETER VpnPort
        The port number to assign to the Client VPN endpoint for TCP and UDP traffic.
Valid Values: 443 | 1194
Default Value: 443

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnendpoint.html#cfn-ec2-clientvpnendpoint-vpnport
        PrimitiveType: Integer
        UpdateType: Mutable

    .PARAMETER DeletionPolicy
        With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.

        To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER UpdateReplacePolicy
        Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.

        When you initiate a stack update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template and parameters. If you update a resource property that requires that the resource be replaced, AWS CloudFormation recreates the resource during the update. Recreating the resource generates a new physical ID. AWS CloudFormation creates the replacement resource first, and then changes references from other dependent resources to point to the replacement resource. By default, AWS CloudFormation then deletes the old resource. Using the UpdateReplacePolicy, you can specify that AWS CloudFormation retain or (in some cases) create a snapshot of the old resource.

        For resources that support snapshots, such as AWS::EC2::Volume, specify Snapshot to have AWS CloudFormation create a snapshot before deleting the old resource instance.

        You can apply the UpdateReplacePolicy attribute to any resource. UpdateReplacePolicy is only executed if you update a resource property whose update behavior is specified as Replacement, thereby causing AWS CloudFormation to replace the old resource with a new one with a new physical ID. For example, if you update the Engine property of an AWS::RDS::DBInstance resource type, AWS CloudFormation creates a new resource and replaces the current DB instance resource with the new one. The UpdateReplacePolicy attribute would then dictate whether AWS CloudFormation deleted, retained, or created a snapshot of the old DB instance. The update behavior for each property of a resource is specified in the reference topic for that resource in the AWS Resource and Property Types Reference. For more information on resource update behavior, see Update Behaviors of Stack Resources.

        The UpdateReplacePolicy attribute applies to stack updates you perform directly, as well as stack updates performed using change sets.

        Note
        Resources that are retained continue to exist and continue to incur applicable charges until you delete those resources. Snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots. UpdateReplacePolicy retains the old physical resource or snapshot, but removes it from AWS CloudFormation's scope.

        UpdateReplacePolicy differs from the DeletionPolicy attribute in that it only applies to resources replaced during stack updates. Use DeletionPolicy for resources deleted when a stack is deleted, or when the resource definition itself is deleted from the template as part of a stack update.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER DependsOn
        With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute.

        This parameter takes a string or list of strings representing Logical IDs of resources that must be created prior to this resource being created.

    .PARAMETER Metadata
        The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON or YAML to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.

        You must use a PSCustomObject containing key/value pairs here. This will be returned when describing the resource using AWS CLI.

    .PARAMETER UpdatePolicy
        Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

        You must use the "Add-UpdatePolicy" function here.
    .PARAMETER Condition
        Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.

    .FUNCTIONALITY
        Vaporshell
    #>
    [OutputType('Vaporshell.Resource.EC2.ClientVpnEndpoint')]
    [cmdletbinding()]
    Param
    (
        [parameter(Mandatory = $true,Position = 0)]
        [ValidateScript( {
                if ($_ -match "^[a-zA-Z0-9]*$") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String 'The LogicalID must be alphanumeric (a-z, A-Z, 0-9) and unique within the template.'))
                }
            })]
        [System.String]
        $LogicalId,
        [parameter(Mandatory = $true)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $ClientCidrBlock,
        [parameter(Mandatory = $true)]
        $ConnectionLogOptions,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.Boolean","Vaporshell.Function"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $SplitTunnel,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $Description,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "Vaporshell.Resource.EC2.ClientVpnEndpoint.TagSpecification"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $TagSpecifications,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $VpcId,
        [parameter(Mandatory = $true)]
        [ValidateScript( {
                $allowedTypes = "Vaporshell.Resource.EC2.ClientVpnEndpoint.ClientAuthenticationRequest"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $AuthenticationOptions,
        [parameter(Mandatory = $true)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $ServerCertificateArn,
        [parameter(Mandatory = $false)]
        $DnsServers,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $TransportProtocol,
        [parameter(Mandatory = $false)]
        $SecurityGroupIds,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.Int32","Vaporshell.Function"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $VpnPort,
        [ValidateSet("Delete","Retain","Snapshot")]
        [System.String]
        $DeletionPolicy,
        [ValidateSet("Delete","Retain","Snapshot")]
        [System.String]
        $UpdateReplacePolicy,
        [parameter(Mandatory = $false)]
        [System.String[]]
        $DependsOn,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.Management.Automation.PSCustomObject"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "The UpdatePolicy parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $Metadata,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "Vaporshell.Resource.UpdatePolicy"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $UpdatePolicy,
        [parameter(Mandatory = $false)]
        $Condition
    )
    Begin {
        $ResourceParams = @{
            LogicalId = $LogicalId
            Type = "AWS::EC2::ClientVpnEndpoint"
        }
        $commonParams = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable')
    }
    Process {
        foreach ($key in $PSBoundParameters.Keys | Where-Object {$commonParams -notcontains $_}) {
            switch ($key) {
                LogicalId {}
                DeletionPolicy {
                    $ResourceParams.Add("DeletionPolicy",$DeletionPolicy)
                }
                UpdateReplacePolicy {
                    $ResourceParams.Add("UpdateReplacePolicy",$UpdateReplacePolicy)
                }
                DependsOn {
                    $ResourceParams.Add("DependsOn",$DependsOn)
                }
                Metadata {
                    $ResourceParams.Add("Metadata",$Metadata)
                }
                UpdatePolicy {
                    $ResourceParams.Add("UpdatePolicy",$UpdatePolicy)
                }
                Condition {
                    $ResourceParams.Add("Condition",$Condition)
                }
                TagSpecifications {
                    if (!($ResourceParams["Properties"])) {
                        $ResourceParams.Add("Properties",([PSCustomObject]@{}))
                    }
                    $ResourceParams["Properties"] | Add-Member -MemberType NoteProperty -Name TagSpecifications -Value @($TagSpecifications)
                }
                AuthenticationOptions {
                    if (!($ResourceParams["Properties"])) {
                        $ResourceParams.Add("Properties",([PSCustomObject]@{}))
                    }
                    $ResourceParams["Properties"] | Add-Member -MemberType NoteProperty -Name AuthenticationOptions -Value @($AuthenticationOptions)
                }
                DnsServers {
                    if (!($ResourceParams["Properties"])) {
                        $ResourceParams.Add("Properties",([PSCustomObject]@{}))
                    }
                    $ResourceParams["Properties"] | Add-Member -MemberType NoteProperty -Name DnsServers -Value @($DnsServers)
                }
                SecurityGroupIds {
                    if (!($ResourceParams["Properties"])) {
                        $ResourceParams.Add("Properties",([PSCustomObject]@{}))
                    }
                    $ResourceParams["Properties"] | Add-Member -MemberType NoteProperty -Name SecurityGroupIds -Value @($SecurityGroupIds)
                }
                Default {
                    if (!($ResourceParams["Properties"])) {
                        $ResourceParams.Add("Properties",([PSCustomObject]@{}))
                    }
                    $ResourceParams["Properties"] | Add-Member -MemberType NoteProperty -Name $key -Value $PSBoundParameters[$key]
                }
            }
        }
    }
    End {
        $obj = New-VaporResource @ResourceParams
        $obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.EC2.ClientVpnEndpoint'
        Write-Verbose "Resulting JSON from $($MyInvocation.MyCommand): `n`n$(@{$obj.LogicalId = $obj.Props} | ConvertTo-Json -Depth 5)`n"
    }
}


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Examples extends MX_Controller {

	public function __construct()
	{
		parent::__construct();

		$this->load->database();
		$this->load->helper('url');

		$this->load->library('grocery_CRUD');
                $this->load->library('Grocery_CRUD_Multiuploader');

	}

        function example_callback_after_upload($uploader_response,$field_info, $files_to_upload)
{
    $this->load->library('image_moo');

    //Is only one file uploaded so it ok to use it with $uploader_response[0].
    $file_uploaded = $field_info->upload_path.'/'.$uploader_response[0]->name;

    $this->image_moo->load($file_uploaded)->resize(800,600)->save($file_uploaded,true);

    return true;
}

        public function multi_upload()
{
   $crud = new Grocery_CRUD_Multiuploader();
   $crud->set_table('images');

   $config = array(
        /* Destination directory */
        "path_to_directory" =>'assets/grocery_crud_multiuploader/GC_uploads/pictures/',

       /* Allowed upload type */
      "allowed_types" =>'gif|jpeg|jpg|png',

      /* Show allowed file types while editing ? */
      "show_allowed_types" => true,

     /* No file text */
     "no_file_text" =>'No Pictures',

     /* enable full path or not for anchor during list state */
     "enable_full_path" => false,

     /* Download button will appear during read state */
     "enable_download_button" => true,

     /* One can restrict this button for specific types...*/
    "download_allowed" => 'jpg'
  );

  $crud->new_multi_upload("images_url",$config);

  $output = $crud->render();
  $this->_example_output($output);
}

	public function _example_output($output = null)
	{
		$this->load->view('example.php',$output);
	}

	public function offices()
	{
		$output = $this->grocery_crud->render();

		$this->_example_output($output);
	}

	public function index()
	{
		$this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array()));
	}

	public function offices_management()
	{
		try{
			$crud = new grocery_CRUD();

			$crud->set_theme('datatables');
			$crud->set_table('offices');
			$crud->set_subject('Office');
			$crud->required_fields('city');
			$crud->columns('city','country','phone','addressLine1','postalCode');

			$output = $crud->render();

			$this->_example_output($output);

		}catch(Exception $e){
			show_error($e->getMessage().' --- '.$e->getTraceAsString());
		}
	}

        public function portfolio_management()
	{
			$crud = new grocery_CRUD();
                        $crud = new Grocery_CRUD_Multiuploader();
                        //$crud->new_multi_upload('images');
                        $this->config->set_item('grocery_crud_file_upload_allow_file_types','gif|jpeg|jpg|png');

			$crud->set_table('portfolio_items');
                        //$crud->set_relation_n_n('Categories', 'Portfolio_categories', 'Categories', 'portfolio_id', 'categories_id', 'category_name');
                        //$crud->set_relation_n_n('Categories', 'Portfolio_categories', 'Categories', 'categories_id', 'portfolio_id', 'category_name');
                        $crud->set_relation_n_n('categories', 'portfolio_categories', 'categories', 'portfolio_id', 'categories_id', 'category_name');
                        //$crud->set_relation('images_id', 'images', 'images_url');
                        //$crud->set_relation('images_id','images','images_url');

                        //$crud->set_relation_n_n('images', 'portfolio_images', 'images', 'portfolio_id', 'images_id', 'images_url');

                        $config = array(
        /* Destination directory */
        "path_to_directory" =>'assets/grocery_crud_multiuploader/GC_uploads/pictures/',

       /* Allowed upload type */
      "allowed_types" =>'gif|jpeg|jpg|png',

      /* Show allowed file types while editing ? */
      "show_allowed_types" => true,

     /* No file text */
     "no_file_text" =>'No Pictures',

     /* enable full path or not for anchor during list state */
     "enable_full_path" => false,

     /* Download button will appear during read state */
     "enable_download_button" => true,

     /* One can restrict this button for specific types...*/
    "download_allowed" => 'jpg'
  );

                        //$crud->new_multi_upload("images_url",$config);
                        //$crud->new_multi_upload("images",$config);
                        //$crud->set_field_upload('images_url','assets/uploads/files');
                          $crud->set_field_upload('images_url','assets/uploads/images');

    $crud->callback_after_upload(array($this,'example_callback_after_upload'));

			$output = $crud->render();

			$this->_example_output($output);
	}

	public function employees_management()
	{
			$crud = new grocery_CRUD();

			$crud->set_theme('datatables');
			$crud->set_table('employees');
			$crud->set_relation('officeCode','offices','city');
			$crud->display_as('officeCode','Office City');
			$crud->set_subject('Employee');

			$crud->required_fields('lastName');

			$crud->set_field_upload('file_url','assets/uploads/files');

			$output = $crud->render();

			$this->_example_output($output);
	}

	public function customers_management()
	{
			$crud = new grocery_CRUD();

			$crud->set_table('customers');
			$crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit');
			$crud->display_as('salesRepEmployeeNumber','from Employeer')
				 ->display_as('customerName','Name')
				 ->display_as('contactLastName','Last Name');
			$crud->set_subject('Customer');
			$crud->set_relation('salesRepEmployeeNumber','employees','lastName');

			$output = $crud->render();

			$this->_example_output($output);
	}

	public function orders_management()
	{
			$crud = new grocery_CRUD();

			$crud->set_relation('customerNumber','customers','{contactLastName} {contactFirstName}');
			$crud->display_as('customerNumber','Customer');
			$crud->set_table('orders');
			$crud->set_subject('Order');
			$crud->unset_add();
			$crud->unset_delete();

			$output = $crud->render();

			$this->_example_output($output);
	}

	public function products_management()
	{
			$crud = new grocery_CRUD();

			$crud->set_table('products');
			$crud->set_subject('Product');
			$crud->unset_columns('productDescription');
			$crud->callback_column('buyPrice',array($this,'valueToEuro'));

			$output = $crud->render();

			$this->_example_output($output);
	}

	public function valueToEuro($value, $row)
	{
		return $value.' €';
	}

	public function film_management()
	{
		$crud = new grocery_CRUD();

		$crud->set_table('film');
		$crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority');
		$crud->set_relation_n_n('category', 'film_category', 'category', 'film_id', 'category_id', 'name');
		$crud->unset_columns('special_features','description','actors');

		$crud->fields('title', 'description', 'actors' ,  'category' ,'release_year', 'rental_duration', 'rental_rate', 'length', 'replacement_cost', 'rating', 'special_features');

		$output = $crud->render();

		$this->_example_output($output);
	}

	public function film_management_twitter_bootstrap()
	{
		try{
			$crud = new grocery_CRUD();

			$crud->set_theme('twitter-bootstrap');
			$crud->set_table('film');
			$crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority');
			$crud->set_relation_n_n('category', 'film_category', 'category', 'film_id', 'category_id', 'name');
			$crud->unset_columns('special_features','description','actors');

			$crud->fields('title', 'description', 'actors' ,  'category' ,'release_year', 'rental_duration', 'rental_rate', 'length', 'replacement_cost', 'rating', 'special_features');

			$output = $crud->render();
			$this->_example_output($output);

		}catch(Exception $e){
			show_error($e->getMessage().' --- '.$e->getTraceAsString());
		}
	}

	function multigrids()
	{
		$this->config->load('grocery_crud');
		$this->config->set_item('grocery_crud_dialog_forms',true);
		$this->config->set_item('grocery_crud_default_per_page',10);

		$output1 = $this->offices_management2();

		$output2 = $this->employees_management2();

		$output3 = $this->customers_management2();

		$js_files = $output1->js_files + $output2->js_files + $output3->js_files;
		$css_files = $output1->css_files + $output2->css_files + $output3->css_files;
		$output = "
List 1
".$output1->output."
List 2
".$output2->output."
List 3
".$output3->output;

		$this->_example_output((object)array(
				'js_files' => $js_files,
				'css_files' => $css_files,
				'output'	=> $output
		));
	}

	public function offices_management2()
	{
		$crud = new grocery_CRUD();
		$crud->set_table('offices');
		$crud->set_subject('Office');

		$crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids")));

		$output = $crud->render();

		if($crud->getState() != 'list') {
			$this->_example_output($output);
		} else {
			return $output;
		}
	}

	public function employees_management2()
	{
		$crud = new grocery_CRUD();

		$crud->set_theme('datatables');
		$crud->set_table('employees');
		$crud->set_relation('officeCode','offices','city');
		$crud->display_as('officeCode','Office City');
		$crud->set_subject('Employee');

		$crud->required_fields('lastName');

		$crud->set_field_upload('file_url','assets/uploads/files');

		$crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids")));

		$output = $crud->render();

		if($crud->getState() != 'list') {
			$this->_example_output($output);
		} else {
			return $output;
		}
	}

	public function customers_management2()
	{
		$crud = new grocery_CRUD();

		$crud->set_table('customers');
		$crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit');
		$crud->display_as('salesRepEmployeeNumber','from Employeer')
			 ->display_as('customerName','Name')
			 ->display_as('contactLastName','Last Name');
		$crud->set_subject('Customer');
		$crud->set_relation('salesRepEmployeeNumber','employees','lastName');

		$crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/multigrids")));

		$output = $crud->render();

		if($crud->getState() != 'list') {
			$this->_example_output($output);
		} else {
			return $output;
		}
	}

}


text:
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

import UIManager from '../exports/UIManager';
import createDOMProps from '../modules/createDOMProps';
import { useImperativeHandle, useRef } from 'react';

function setNativeProps(node, nativeProps, classList, style, previousStyleRef) {
  if (node != null && nativeProps) {
    var domProps = createDOMProps(null, _objectSpread({}, nativeProps, {
      classList: [nativeProps.className, classList],
      style: [style, nativeProps.style]
    }));
    var nextDomStyle = domProps.style;

    if (previousStyleRef.current != null) {
      if (domProps.style == null) {
        domProps.style = {};
      }

      for (var styleName in previousStyleRef.current) {
        if (domProps.style[styleName] == null) {
          domProps.style[styleName] = '';
        }
      }
    }

    previousStyleRef.current = nextDomStyle;
    UIManager.updateView(node, domProps);
  }
}
/**
 * Adds non-standard methods to the hode element. This is temporarily until an
 * API like `ReactNative.measure(hostRef, callback)` is added to React Native.
 */

export default function usePlatformMethods(hostRef, classList, style) {
  var previousStyleRef = useRef(null);
  useImperativeHandle(hostRef, function () {
    var hostNode = hostRef.current;

    hostNode.measure = function (callback) {
      return UIManager.measure(hostNode, callback);
    };

    hostNode.measureLayout = function (relativeToNode, success, failure) {
      return UIManager.measureLayout(hostNode, relativeToNode, failure, success);
    };

    hostNode.measureInWindow = function (callback) {
      return UIManager.measureInWindow(hostNode, callback);
    };

    hostNode.setNativeProps = function (nativeProps) {
      return setNativeProps(hostNode, nativeProps, classList, style, previousStyleRef);
    };

    return hostNode;
  }, [classList, hostRef, style]);
}


text:
/**
 * This package contains randomizers for date and time types.
 */
package org.jeasy.random.randomizers.time;


text:
TypeScript is a primary language for Angular application development.
It is a superset of JavaScript with design-time support for type safety and tooling.

Browsers can't execute TypeScript directly. Typescript must be "transpiled" into JavaScript using the *tsc* compiler,
which requires some configuration.

This page covers some aspects of TypeScript configuration and the TypeScript environment
that are important to Angular developers, including details about the following files:

* [tsconfig.json](guide/typescript-configuration#tsconfig)—TypeScript compiler configuration.
* [typings](guide/typescript-configuration#typings)—TypesScript declaration files.

{@a tsconfig}

## *tsconfig.json*
Typically, you add a TypeScript configuration file called `tsconfig.json` to your project to
guide the compiler as it generates JavaScript files.

<div class="l-sub-section">

For details about `tsconfig.json`, see the official
[TypeScript wiki](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html).

</div>

The [Setup](guide/setup) guide uses the following `tsconfig.json`:

<code-example path="quickstart/src/tsconfig.1.json" title="tsconfig.json" linenums="false"></code-example>

This file contains options and flags that are essential for Angular applications.

{@a noImplicitAny}

### *noImplicitAny* and *suppressImplicitAnyIndexErrors*

TypeScript developers disagree about whether the `noImplicitAny` flag should be `true` or `false`.
There is no correct answer and you can change the flag later.
But your choice now can make a difference in larger projects, so it merits discussion.

When the `noImplicitAny` flag is `false` (the default), and if
the compiler cannot infer the variable type based on how it's used,
the compiler silently defaults the type to `any`. That's what is meant by *implicit `any`*.

The documentation setup sets the `noImplicitAny` flag to `true`.
When the `noImplicitAny` flag is `true` and the TypeScript compiler cannot infer
the type, it still generates the JavaScript files, but it also **reports an error**.
Many seasoned developers prefer this stricter setting because type checking catches more
unintentional errors at compile time.

You can set a variable's type to `any` even when the `noImplicitAny` flag is `true`.

When the `noImplicitAny` flag is `true`, you may get *implicit index errors* as well.
Most developers feel that *this particular error* is more annoying than helpful.
You can suppress them with the following additional flag:

<code-example format=".">
  "suppressImplicitAnyIndexErrors":true

</code-example>

The documentation setup sets this flag to `true` as well.

{@a typings}

## TypeScript Typings
Many JavaScript libraries, such as jQuery, the Jasmine testing library, and Angular,
extend the JavaScript environment with features and syntax
that the TypeScript compiler doesn't recognize natively.
When the compiler doesn't recognize something, it throws an error.

Use [TypeScript type definition files](https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html)—`d.ts files`—to tell the compiler about the libraries you load.

TypeScript-aware editors leverage these same definition files to display type information about library features.

Many libraries include definition files in their npm packages where both the TypeScript compiler and editors
can find them. Angular is one such library.
The `node_modules/@angular/core/` folder of any Angular application contains several `d.ts` files that describe parts of Angular.

**You need do nothing to get *typings* files for library packages that include `d.ts` files.
Angular packages include them already.**

### lib.d.ts

TypeScript includes a special declaration file called `lib.d.ts`. This file contains the ambient declarations for various common JavaScript constructs present in JavaScript runtimes and the DOM.

Based on the `--target`, TypeScript adds _additional_ ambient declarations
like `Promise` if the target is `es6`.

Since the QuickStart is targeting `es5`, you can override the
list of declaration files to be included:

<code-example format=".">
  "lib": ["es2015", "dom"]

</code-example>

Thanks to that, you have all the `es6` typings even when targeting `es5`.

### Installable typings files
Many libraries—jQuery, Jasmine, and Lodash among them—do *not* include `d.ts` files in their npm packages.
Fortunately, either their authors or community contributors have created separate `d.ts` files for these libraries and
published them in well-known locations.

You can install these typings via `npm` using the
[`@types/*` scoped package](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)
and Typescript, starting at 2.0, automatically recognizes them.

For instance, to install typings for `jasmine` you could do `npm install @types/jasmine --save-dev`.

QuickStart identifies two *typings*, or `d.ts`, files:

* [jasmine](http://jasmine.github.io/) typings for the Jasmine test framework.

* [node](https://www.npmjs.com/package/@types/node) for code that references objects in the *nodejs* environment;
you can view an example in the [webpack](guide/webpack) page.

QuickStart doesn't require these typings but many of the samples do.


text:
namespace content {
class BrowserContext;
}

namespace extensions {
class Extension;
class ExtensionPrefs;
class InstallSigner;
struct InstallSignature;

// This class implements verification that a set of extensions are either from
// the webstore or are allowlisted by enterprise policy.  The webstore
// verification process works by sending a request to a backend server to get a
// signature proving that a set of extensions are verified. This signature is
// written into the extension preferences and is checked for validity when
// being read back again.
//
// This class should be kept notified of runtime changes to the set of
// extensions installed from the webstore.
class InstallVerifier : public KeyedService,
                        public ManagementPolicy::Provider {
 public:
  InstallVerifier(ExtensionPrefs* prefs, content::BrowserContext* context);

  InstallVerifier(const InstallVerifier&) = delete;
  InstallVerifier& operator=(const InstallVerifier&) = delete;

  ~InstallVerifier() override;

  // Convenience method to return the InstallVerifier for a given |context|.
  static InstallVerifier* Get(content::BrowserContext* context);

  // Returns whether install verification should be enforced.
  static bool ShouldEnforce();

  // Returns whether |extension| is of a type that needs verification.
  static bool NeedsVerification(const Extension& extension,
                                content::BrowserContext* context);

  // Determines if an extension claims to be from the webstore.
  static bool IsFromStore(const Extension& extension,
                          content::BrowserContext* context);

  // Initializes this object for use, including reading preferences and
  // validating the stored signature.
  void Init();

  // Returns the timestamp of our InstallSignature, if we have one.
  base::Time SignatureTimestamp();

  // Returns true if |id| is either verified or our stored signature explicitly
  // tells us that it was invalid when we asked the server about it.
  bool IsKnownId(const std::string& id) const;

  // Returns whether the given |id| is considered invalid by our verified
  // signature.
  bool IsInvalid(const std::string& id) const;

  // Attempts to verify a single extension and add it to the verified list.
  void VerifyExtension(const std::string& extension_id);

  // Attempts to verify all extensions.
  void VerifyAllExtensions();

  // Call this to add a set of ids that will immediately be considered allowed,
  // and kick off an aysnchronous request to Add.
  void AddProvisional(const ExtensionIdSet& ids);

  // Removes an id or set of ids from the verified list.
  void Remove(const std::string& id);
  void RemoveMany(const ExtensionIdSet& ids);

  // Returns whether an extension id is allowed by policy.
  bool AllowedByEnterprisePolicy(const std::string& id) const;

  // ManagementPolicy::Provider interface.
  std::string GetDebugPolicyProviderName() const override;
  bool MustRemainDisabled(const Extension* extension,
                          disable_reason::DisableReason* reason,
                          std::u16string* error) const override;

 private:
  // We keep a list of operations to the current set of extensions.
  enum OperationType {
    ADD_SINGLE,         // Adding a single extension to be verified.
    ADD_ALL,            // Adding all extensions to be verified.
    ADD_ALL_BOOTSTRAP,  // Adding all extensions because of a bootstrapping.
    ADD_PROVISIONAL,    // Adding one or more provisionally-allowed extensions.
    REMOVE              // Remove one or more extensions.
  };

  // This is an operation we want to apply to the current set of verified ids.
  struct PendingOperation {
    OperationType type;

    // This is the set of ids being either added or removed.
    ExtensionIdSet ids;

    explicit PendingOperation(OperationType type);
    ~PendingOperation();
  };

  // Returns the set of IDs for all extensions that potentially need to be
  // verified.
  ExtensionIdSet GetExtensionsToVerify() const;

  // Bootstrap the InstallVerifier if we do not already have a signature, or if
  // there are unknown extensions which need to be verified.
  void MaybeBootstrapSelf();

  // Try adding a new set of |ids| to the list of verified ids.
  void AddMany(const ExtensionIdSet& ids, OperationType type);

  // Record the result of the verification for the histograms, and notify the
  // ExtensionPrefs if we verified all extensions.
  void OnVerificationComplete(bool success, OperationType type);

  // Removes any no-longer-installed ids, requesting a new signature if needed.
  void GarbageCollect();

  // Returns whether the given |id| is included in our verified signature.
  bool IsVerified(const std::string& id) const;

  // Returns true if the extension with |id| was installed later than the
  // timestamp of our signature.
  bool WasInstalledAfterSignature(const std::string& id) const;

  // Begins the process of fetching a new signature, based on applying the
  // operation at the head of the queue to the current set of ids in
  // |signature_| (if any) and then sending a request to sign that.
  void BeginFetch();

  // Saves the current value of |signature_| to the prefs;
  void SaveToPrefs();

  // Called with the result of a signature request, or NULL on failure.
  void SignatureCallback(std::unique_ptr<InstallSignature> signature);

  raw_ptr<ExtensionPrefs> prefs_;

  // The context with which the InstallVerifier is associated.
  raw_ptr<content::BrowserContext> context_;

  // Have we finished our bootstrap check yet?
  bool bootstrap_check_complete_;

  // This is the most up-to-date signature, read out of |prefs_| during
  // initialization and updated anytime we get new id's added.
  std::unique_ptr<InstallSignature> signature_;

  // The current InstallSigner, if we have a signature request running.
  std::unique_ptr<InstallSigner> signer_;

  // A queue of operations to apply to the current set of allowed ids.
  base::queue<std::unique_ptr<PendingOperation>> operation_queue_;

  // A set of ids that have been provisionally added, which we're willing to
  // consider allowed until we hear back from the server signature request.
  ExtensionIdSet provisional_;

  base::WeakPtrFactory<InstallVerifier> weak_factory_{this};
};

// Instances of this class can be constructed to disable install verification
// during tests.
class ScopedInstallVerifierBypassForTest {
 public:
  enum ForceType {
    kForceOn,
    kForceOff,
  };

  explicit ScopedInstallVerifierBypassForTest(ForceType force_type = kForceOff);

  ScopedInstallVerifierBypassForTest(
      const ScopedInstallVerifierBypassForTest&) = delete;
  ScopedInstallVerifierBypassForTest& operator=(
      const ScopedInstallVerifierBypassForTest&) = delete;

  ~ScopedInstallVerifierBypassForTest();

 private:
  ForceType value_;
  raw_ptr<ForceType> old_value_;
};

}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_


text:
#include "NetFavorites.hpp"
#include "Network.hpp"
#include "NetCommon.hpp"
#include "NetLng.hpp"
#include "guid.hpp"
#include <PluginSettings.hpp>
#include <string>
#include <vector>

const wchar_t SZ_FAVORITES[] = L"Favorites";
const wchar_t SZ_USERNAME[] = L"UserName";
const wchar_t SZ_USERPASS[] = L"Password";
static wchar_t szFavProv[] = L"Far Favorites Provider";

std::vector<std::wstring> SplitPath(const wchar_t* lpRemoteName)
{
	// lpRemoteName = Favorite\\share \\machine\share or \\machine
	// result  {Favorite , machine, share} or {Favorite , machine}
	// machine name must be in uppercase
	std::vector<std::wstring> result;
	result.reserve(3);
	std::wstring remote_name{lpRemoteName};
	result.emplace_back(SZ_FAVORITES);
	if (remote_name.find(SZ_FAVORITES) == 0)
	{
		remote_name = remote_name.substr(std::size(SZ_FAVORITES));
	}

	size_t i = 0;
	while (remote_name[i] == L'\\')
	{
		i++;
	}

	std::wstring machine_name{remote_name.substr(i)};
	auto const pos = machine_name.find(L'\\');
	if (pos != std::string::npos)
	{
		auto share_name = machine_name.substr(pos + 1);
		machine_name = machine_name.substr(0, pos);
		CharUpperBuffW(machine_name.data(), static_cast<DWORD>(machine_name.size()));
		result.push_back(machine_name);
		result.push_back(share_name);
	}
	else
	{
		CharUpperBuffW(machine_name.data(), static_cast<DWORD>(machine_name.size()));
		result.push_back(machine_name);
	}

	return result;
}

bool EnumFavorites(const NetResource* pNR, NetResourceList* pList)
{
	if (!pNR)
	{
		NetResource tmp{};
		tmp.dwDisplayType = RESOURCEDISPLAYTYPE_DOMAIN;
		tmp.lpProvider = szFavProv;
		pList->Push(tmp);
		return false;
	}
	else if (pNR->lpProvider == szFavProv)
	{
		PluginSettings settings(MainGuid, PsInfo.SettingsControl);
		size_t favorites_root = settings.CreateSubKey(0, SZ_FAVORITES);

		FarSettingsEnum fse{};
		if (settings.Enum(favorites_root, &fse))
		{
			for (size_t i = 0; i < fse.Count; i++)
			{
				if (fse.Items[i].Type == FST_SUBKEY)
				{
					wchar_t szSrc[MAX_PATH] = L"\\\\";
					lstrcat(szSrc, fse.Items[i].Name);
					NetResource tmp{};

					if (Opt.FavoritesFlags & FAVORITES_CHECK_RESOURCES)
					{
						tmp.lpRemoteName = szSrc;
						tmp.dwDisplayType = RESOURCEDISPLAYTYPE_SERVER;
						pList->Push(tmp);
					}
					else if (NetBrowser::GetResourceInfo(szSrc, tmp))
					{
						pList->Push(tmp);
					}
				}
			}
		}
		return true;
	}
	return false;
}

bool CheckFavoriteItem(const NetResource* pNR)
{
	return pNR && pNR->lpProvider == szFavProv;
}

bool InFavoriteExists(const wchar_t* lpRemoteName)
{
	if (!lpRemoteName)
	{
		return false;
	}
	auto split_path = SplitPath(lpRemoteName);

	PluginSettings settings(MainGuid, PsInfo.SettingsControl);
	size_t level_root = 0;
	for (const auto& piece: split_path)
	{
		level_root = settings.OpenSubKey(level_root, piece.c_str());
		if (level_root == 0)
			return false;
	}
	return true;
}

void WriteFavoriteItem(const FAVORITEITEM* lpFavItem)
{
	auto split_path = SplitPath(lpFavItem->lpRemoteName);
	PluginSettings settings(MainGuid, PsInfo.SettingsControl);
	size_t level_root = 0;
	for (const auto& piece: split_path)
	{
		level_root = settings.CreateSubKey(level_root, piece.c_str());
		if (level_root == 0)
			return;
	}
	settings.Set(level_root, SZ_USERNAME, lpFavItem->lpUserName);
	settings.Set(level_root, SZ_USERPASS, lpFavItem->lpPassword);
}

bool ReadFavoriteItem(FAVORITEITEM* lpFavItem)
{
	if (lpFavItem)
	{
		auto split_path = SplitPath(lpFavItem->lpRemoteName);
		PluginSettings settings(MainGuid, PsInfo.SettingsControl);
		size_t level_root = 0;
		for (const auto& piece: split_path)
		{
			level_root = settings.OpenSubKey(level_root, piece.c_str());
			if (level_root == 0)
				return false;
		}

		lpFavItem->lpUserName = _wcsdup(settings.Get(level_root, SZ_USERNAME, L""));
		lpFavItem->lpPassword = _wcsdup(settings.Get(level_root, SZ_USERPASS, L""));
		return true;
	}
	return false;
}

bool GetFavoritesParent(const NetResource& SrcRes, NetResource* lpParent)
{
	if (!lpParent)
		return false;

	if (SrcRes.dwDisplayType == RESOURCEDISPLAYTYPE_SHARE)
		return false;

	if (SrcRes.lpProvider == szFavProv)
	{
		return false;
	}

	if (InFavoriteExists(SrcRes.lpRemoteName.c_str()))
	{
		wchar_t res[MAX_PATH];
		lstrcpy(res, GetMsg(MFavorites));

		*lpParent = {};
		lpParent->lpProvider = szFavProv;
		lpParent->dwDisplayType = RESOURCEDISPLAYTYPE_DOMAIN;
		lpParent->lpRemoteName = res;

		return true;
	}

	return false;
}

bool GetFavoriteResource(const wchar_t* SrcName, NetResource* DstNetResource)
{
	wchar_t szKey[MAX_PATH];
	if (InFavoriteExists(SrcName))
	{
		auto p1 = FSF.PointToName(SrcName);
		if (DstNetResource)
		{
			lstrcpy(szKey, L"\\\\");
			lstrcat(szKey, p1);
			*DstNetResource = {};
			DstNetResource->lpRemoteName = CharUpper(szKey);
			DstNetResource->dwDisplayType = RESOURCEDISPLAYTYPE_SERVER;
		}

		return true;
	}

	return false;
}

bool RemoveFromFavorites(const wchar_t* SrcName)
{
	auto split_path = SplitPath(SrcName);
	PluginSettings settings(MainGuid, PsInfo.SettingsControl);

	size_t level_root = 0;
	for (const auto& piece: split_path)
	{
		level_root = settings.CreateSubKey(level_root, piece.c_str());
		if (level_root == 0)
			return false;
	}
	settings.DeleteSubKey(level_root);
	return true;
}


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Authentication Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines are used during authentication for various
    | messages that we need to display to the user. You are free to modify
    | these language lines according to your application's requirements.
    |
    */

    'failed'   => 'Deze combinatie van e-mailadres en wachtwoord is niet geldig.',
    'throttle' => 'Teveel gefaalde login pogingen. Probeer het over :seconds seconden nogmaals.',

];


text:
<?php declare(strict_types = 1);

namespace spec\jschreuder\SpotDesk\Entity;

use jschreuder\SpotDesk\Entity\Department;
use jschreuder\SpotDesk\Entity\Mailbox;
use jschreuder\SpotDesk\Value\MailTransportSecurityValue;
use PhpSpec\ObjectBehavior;
use Ramsey\Uuid\UuidInterface;

class MailboxSpec extends ObjectBehavior
{
    /** @var  UuidInterface */
    private $id;

    /** @var  string */
    private $name;

    /** @var  ?Department */
    private $department;

    /** @var  string */
    private $imapServer;

    /** @var  int */
    private $imapPort;

    /** @var  MailTransportSecurityValue */
    private $imapSecurity;

    /** @var  string */
    private $imapUser;

    /** @var  string */
    private $imapPass;

    /** @var  \DateTimeInterface */
    private $lastCheck;

    public function let(UuidInterface $id, Department $department) : void
    {
        $this->beConstructedWith(
            $this->id = $id,
            $this->name = 'name',
            $this->department = $department,
            $this->imapServer = 'server.io',
            $this->imapPort = 587,
            $this->imapSecurity = MailTransportSecurityValue::get(MailTransportSecurityValue::SECURITY_SSL),
            $this->imapUser = 'user',
            $this->imapPass = 'pass',
            $this->lastCheck = new \DateTimeImmutable('-1 month')
        );
    }

    public function it_is_initializable() : void
    {
        $this->shouldHaveType(Mailbox::class);
    }

    public function it_can_access_its_properties() : void
    {
        $this->getId()->shouldReturn($this->id);
        $this->getName()->shouldReturn($this->name);
        $this->getDepartment()->shouldReturn($this->department);
        $this->getImapServer()->shouldReturn($this->imapServer);
        $this->getImapPort()->shouldReturn($this->imapPort);
        $this->getImapSecurity()->shouldReturn($this->imapSecurity);
        $this->getImapUser()->shouldReturn($this->imapUser);
        $this->getImapPass()->shouldReturn($this->imapPass);
        $this->getLastCheck()->shouldReturn($this->lastCheck);
    }

    public function it_can_instantiate_without_department() : void
    {
        $this->beConstructedWith(
            $this->id,
            $this->name,
            null,
            $this->imapServer,
            $this->imapPort,
            $this->imapSecurity,
            $this->imapUser,
            $this->imapPass,
            $this->lastCheck
        );
        $this->getDepartment()->shouldReturn(null);
    }

    public function it_can_change_some_properties(Department $department) : void
    {
        $name = 'new';
        $this->setName($name);
        $this->getName()->shouldReturn($name);

        $this->setDepartment($department);
        $this->getDepartment()->shouldReturn($department);

        $server = 'server.com';
        $this->setImapServer($server);
        $this->getImapServer()->shouldReturn($server);

        $port = 25;
        $this->setImapPort($port);
        $this->getImapPort()->shouldReturn($port);

        $security = MailTransportSecurityValue::get(MailTransportSecurityValue::SECURITY_TLS);
        $this->setImapSecurity($security);
        $this->getImapSecurity()->shouldReturn($security);

        $user = 'newuser';
        $this->setImapUser($user);
        $this->getImapUser()->shouldReturn($user);

        $pass = 'newpass';
        $this->setImapPass($pass);
        $this->getImapPass()->shouldReturn($pass);

        $lastCheck = new \DateTimeImmutable();
        $this->setLastCheck($lastCheck);
        $this->getLastCheck()->shouldReturn($lastCheck);
    }
}


text:
'use strict';

var expect = require('chai').expect;
var spec = require('../util.js').setup();

describe('lesshint', function () {
    describe('#emptyRule()', function () {
        it('should have the proper node types', function () {
            var source = '.foo { color: red; }';

            return spec.parse(source, function (ast) {
                expect(spec.linter.nodeTypes).to.include(ast.root.first.type);
            });
        });

        it('should allow rules with declarations', function () {
            var source = '.foo { color: red; }';

            return spec.parse(source, function (ast) {
                var result = spec.linter.lint({}, ast.root.first);

                expect(result).to.be.undefined;
            });
        });

        it('should not allow empty rules', function () {
            var source = '.foo {}';
            var expected = [{
                message: "There shouldn't be any empty rules present."
            }];

            return spec.parse(source, function (ast) {
                var result = spec.linter.lint({}, ast.root.first);

                expect(result).to.deep.equal(expected);
            });
        });

        it('should not allow empty rules with a space', function () {
            var source = '.foo { }';
            var expected = [{
                message: "There shouldn't be any empty rules present."
            }];

            return spec.parse(source, function (ast) {
                var result = spec.linter.lint({}, ast.root.first);

                expect(result).to.deep.equal(expected);
            });
        });

        it('should allow rules with only mixins (#16)', function () {
            var source = '.foo { .mixin(); }';

            return spec.parse(source, function (ast) {
                var result = spec.linter.lint({}, ast.root.first);

                expect(result).to.be.undefined;
            });
        });

        it('should allow rules with only atrules (#200)', function () {
            var source = '.foo { @atrule(); }';

            return spec.parse(source, function (ast) {
                var result = spec.linter.lint({}, ast.root.first);

                expect(result).to.be.undefined;
            });
        });

        it('should not check mixin calls', function () {
            var source = '.mixin();';

            return spec.parse(source, function (ast) {
                var result = spec.linter.lint({}, ast.root.first);

                expect(result).to.be.undefined;
            });
        });

        it('should not check atrule calls (#200)', function () {
            var source = '@atrule();';

            return spec.parse(source, function (ast) {
                var result = spec.linter.lint({}, ast.root.first);

                expect(result).to.be.undefined;
            });
        });

        it('should not check mixin definitions', function () {
            var source = '.header-def(@rules) {h1,h2,h3,h4,h5,h6 {@rules();}}';

            return spec.parse(source, function (ast) {
                var result = spec.linter.lint({}, ast.root.first);

                expect(result).to.be.undefined;
            });
        });
    });
});


text:
import * as Websocket from 'ws';

export function getWsLatency(address: string) {
    const socket = new Websocket(address);
        let start;
        return new Promise((resolve, reject) => {
            socket.on('open', () => {
                start = Date.now();
                socket.send('ping');
            });
            socket.on('message', (msg) => {
                socket.close();
                return resolve((Date.now() - start)/2);
            });
            socket.on('error', (e) => {
                return reject();
            })
        });
}


text:
<?php
require_once __DIR__ . '/vendor/autoload.php';

use RedBean_Facade as ORM;
use Symfony\Component\HttpFoundation\Request;

/** @var Application $app */
$app          = new Silex\Application();
$app['debug'] = true;

/** @var Template Engine $tpl */
$tpl = new Smarty();

/** Database connect */
ORM::setup('sqlite:data/simplenote.sqlite');

/**
 * Home
 * Add new note
 */
$app->get('/', function () use ($tpl) {
    $tpl->display('index.tpl');
    return false;
});

/**
 * Load JSON notes
 */
$app->post('/load.json', function () use ($app) {
    $notes = ORM::findAll('notes', 'ORDER BY publication DESC');
    // print_r($notes);
    $obj = array();
    foreach ($notes as $row) {
        $obj[] = array(
            'id' => $row['id'],
            'fullname' => $row['fullname']
        );
    }
    return $app->json($obj);
});

/**
 * Edit note
 */
$app->get('/edit/{id}', function ($id) use ($tpl) {
    $notes = ORM::load('notes', $id);
    $tpl->assign('row', $notes);
    $tpl->display('edit.tpl');
    return false;
});

/**
 * Action form note
 */
$app->post('/process', function (Request $request) use ($app, $tpl) {

    $id          = (int)$request->get('id');
    $publication = time();

    if ($id != 0) {

        $notes              = ORM::load('notes', $id);
        $notes->fullname    = $request->get('fullname');
        $notes->memo        = $request->get('memo');
        $notes->publication = $publication;
        ORM::store($notes);

        $tpl->assign('row', $notes);
        $tpl->display('edit.tpl');
        return $app->redirect(sprintf('/edit/%d', $id), 301);

    } else {

        $notes              = ORM::dispense('notes');
        $notes->fullname    = $request->get('fullname');
        $notes->memo        = $request->get('memo');
        $notes->publication = $publication;
        ORM::store($notes);

        $tpl->display('index.tpl');
        return $app->redirect('/', 301);
    }
});

/**
 * Delete note
 */
$app->get('/delete/{id}', function ($id) use ($app) {
    $notes = ORM::load('notes', $id);
    ORM::trash($notes);
    return $app->redirect('/', 301);
});

$app->run();


text:
@class VIMVideoAsset;

extern NSString *const VIMUploadTaskQueueTracker_CurrentVideoAssetDidChangeNotification;
extern NSString *const VIMUploadTaskQueueTracker_DidRefreshQueuedAssetsNotification;
extern NSString *const VIMUploadTaskQueueTracker_DidAddQueuedAssetsNotification;
extern NSString *const VIMUploadTaskQueueTracker_DidRemoveQueuedAssetsNotification;
extern NSString *const VIMUploadTaskQueueTracker_DidRemoveFailedAssetsNotification;
extern NSString *const VIMUploadTaskQueueTracker_QueuedAssetDidFailNotification;
extern NSString *const VIMUploadTaskQueueTracker_FailedAssetDidRetryNotification;

extern NSString *const VIMUploadTaskQueueTracker_AssetIndicesKey;
extern NSString *const VIMUploadTaskQueueTracker_OriginalIndexKey;
extern NSString *const VIMUploadTaskQueueTracker_NewIndexKey;
extern NSString *const VIMUploadTaskQueueTracker_QueuedAssetsKey;
extern NSString *const VIMUploadTaskQueueTracker_FailedAssetsKey;
extern NSString *const VIMUploadTaskQueueTracker_AssetsKey;
extern NSString *const VIMUploadTaskQueueTracker_SessionIdentifierKey;

@interface VIMUploadTaskQueueTracker : NSObject

@property (nonatomic, strong, readonly) VIMVideoAsset *currentVideoAsset;
@property (nonatomic, strong, readonly) NSMutableArray *videoAssets;
@property (nonatomic, strong, readonly) NSMutableArray *failedAssets;

- (instancetype)initWithSessionIdentifier:(NSString *)sessionIdentifier;

// This method must be called when a user "ignores" a failed asset [AH]
- (void)ignoreFailedAsset:(VIMVideoAsset *)videoAsset;

- (VIMVideoAsset *)assetForIdentifier:(NSString *)identifier;

@end


text:
package com.teleca.jamendo.dialog;

import com.teleca.jamendo.api.JamendoGet2Api;
import com.teleca.jamendo.api.Track;
import com.teleca.jamendo.api.WSError;
import com.teleca.jamendo.api.impl.JamendoGet2ApiImpl;
import com.teleca.jamendo.R;

import android.app.Activity;
import android.app.Dialog;
import android.os.AsyncTask;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ViewFlipper;

/**
 * Dialog representing lyrics
 *
 * @author Lukasz Wisniewski
 */
public class LyricsDialog extends Dialog {

	private Activity mActivity;

	/**
	 * Remember last used track
	 */
	private static Track mTrack;

	/**
	 * Remember last used lyrics
	 */
	private static String mLyrics;

	private ViewFlipper mViewFlipper;
	private TextView mTextView;

	public LyricsDialog(Activity context, Track track) {
		super(context);
		init(context, track);
	}

	/**
	 * Sharable code between constructors
	 *
	 * @param context
	 * @param track
	 */
	private void init(Activity context, Track track){
		mActivity = context;
		setContentView(R.layout.lyrics);
		setTitle(R.string.lyrics);

		mViewFlipper = (ViewFlipper)findViewById(R.id.LyricsViewFlipper);
		mTextView = (TextView)findViewById(R.id.LyricsTextView);

		if(track != mTrack){
			new LyricsTask().execute(track);
		} else {
			showLyrics();
		}
	}

	/**
	 * Show us the lyrics
	 */
	private void showLyrics(){
		if(mLyrics == null || mLyrics.equals("null")){
			mTextView.setText(R.string.no_lyrics);
		}else{
			mTextView.setText(mLyrics);
		}
		mViewFlipper.setDisplayedChild(1);
	}

	/**
	 * do background JamendoGet2Api.getTrackLyrics
	 *
	 * @author Lukasz Wisniewski
	 */
	private class LyricsTask extends AsyncTask<Track, WSError, String>{

		@Override
		public String doInBackground(Track... params) {
			JamendoGet2Api service = new JamendoGet2ApiImpl();
			try {
				return service.getTrackLyrics(params[0]);
			} catch (WSError e) {
				publishProgress(e);
				dismiss();
				this.cancel(true);
				return null;
			}
		}

		@Override
		public void onPostExecute(String result) {
			super.onPostExecute(result);
			mLyrics = result;
			showLyrics();
		}

		@Override
		protected void onProgressUpdate(WSError... values) {
			Toast.makeText(mActivity, values[0].getMessage(), Toast.LENGTH_LONG).show();
			super.onProgressUpdate(values);
		}
	}

}


text:
// Copyright (c) The Perspex Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.

using System.Linq;
using Perspex.Controls;
using Perspex.Controls.Presenters;
using Perspex.Controls.Primitives;
using Perspex.Controls.Templates;
using Perspex.Styling;

namespace Perspex.Themes.Default
{
    /// <summary>
    /// The default style for the <see cref="ContentControl"/> control.
    /// </summary>
    public class ContentControlStyle : Styles
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ContentControlStyle"/> class.
        /// </summary>
        public ContentControlStyle()
        {
            AddRange(new[]
            {
                new Style(x => x.OfType<ContentControl>())
                {
                    Setters = new[]
                    {
                        new Setter(TemplatedControl.TemplateProperty, new ControlTemplate<ContentControl>(Template)),
                    },
                },
            });
        }

        /// <summary>
        /// The default template for a <see cref="ContentControl"/> control.
        /// </summary>
        /// <param name="control">The control being styled.</param>
        /// <returns>The root of the instantiated template.</returns>
        public static Control Template(ContentControl control)
        {
            return new Border
            {
                [~Border.BackgroundProperty] = control[~TemplatedControl.BackgroundProperty],
                Child = new ContentPresenter
                {
                    Name = "contentPresenter",
                    [~ContentPresenter.ContentProperty] = control[~ContentControl.ContentProperty],
                }
            };
        }
    }
}