Feature SIB0112b.mp.1
4689
public final void restore(List<DataSlice> dataSlices)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "restore", dataSlices);

    try
    {
      DataSlice slice = dataSlices.get(0);

      ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(slice.getBytes()));

      // First object stored should always be the version integer.
      restore(ois, ois.readInt());

      ois.close();
    }
    catch (IOException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.store.itemstreams.SIMPItemStream.restore",
        "1:372:1.54",
        this);

      SibTr.exception(tc, e);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "restore", e);

      throw new SIErrorException(e);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "restore");
  }
174251
def par_u1step(i):
    
    """

    global mp_U1
    grpind = slice(mp_grp[i], mp_grp[i+1])
    mp_U1[grpind] += mp_alpha*(mp_X[grpind] - mp_Y1[grpind])
1097187
function( buffer, name, mime_type ) {

		// Write control operation
		this.stream8.write( pack1b( CTRL_OP.EMBED ) );
		this.counters.op_ctr++;
		// Write string ID from the string lookup table
		this.stream16.write( pack2b( this.stringID(this.bundleName + "/" + name) ) );
		this.counters.ref_str+=2;
		// Encode primitive
		encodePrimitive( this, new BlobResource( buffer, mime_type) );
		
	}
1317313
function BmpEncoder(imgData){
	this.buffer = imgData.data;
	this.width = imgData.width;
	this.height = imgData.height;
	this.extraBytes = this.width%4;
	this.rgbSize = this.height*(3*this.width+this.extraBytes);
	this.headerInfoSize = 40;

	this.data = [];
	/******************header***********************/
	this.flag = "BM";
	this.reserved = 0;
	this.offset = 54;
	this.fileSize = this.rgbSize+this.offset;
	this.planes = 1;
	this.bitPP = 24;
	this.compress = 0;
	this.hr = 0;
	this.vr = 0;
	this.colors = 0;
	this.importantColors = 0;
}
619619
def mtf_image_transformer_base_imagenet_mp128():
  """"""
  hparams = mtf_image_transformer_base_imagenet()
  hparams.mesh_shape = "model:8;batch:4"
  hparams.layout = "batch:batch;d_ff:model;heads:model"
  hparams.batch_size = 8
  hparams.img_len = 128
  hparams.block_length = 128
  hparams.num_heads = 8
  hparams.num_decoder_layers = 4
  hparams.d_ff = 4096
  hparams.learning_rate_warmup_steps = 31250
  hparams.unconditional = True
  hparams.max_length = 256*256*3
  return hparams
819480
def evaluate_model_single_recording_multisymbol(model_file, recording):
    
    (preprocessing_queue, feature_list, model,
     output_semantics) = load_model(model_file)
    logging.info("multiple symbol mode")
    logging.info(recording)
    results = evaluate_model_single_recording_preloaded(preprocessing_queue,
                                                        feature_list,
                                                        model,
                                                        output_semantics,
                                                        recording)
    return results
684947
function BinaryCMapStream(data) {
    this.buffer = data;
    this.pos = 0;
    this.end = data.length;
    this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE);
  }
1174038
def libvlc_media_player_get_nsobject(p_mi):
    '''
    '''
    f = _Cfunctions.get('libvlc_media_player_get_nsobject', None) or \
        _Cfunction('libvlc_media_player_get_nsobject', ((1,),), None,
                    ctypes.c_void_p, MediaPlayer)
    return f(p_mi)
539513
public static void yu12ToBoof(byte[] data, int width, int height, ImageBase output) {

        if( output instanceof Planar) {
            Planar ms = (Planar) output;
            ms.reshape(width,height,3);

            if( BoofConcurrency.USE_CONCURRENT ) {
                if (ms.getBandType() == GrayU8.class) {
                    ImplConvertYV12_MT.yv12ToPlanarRgb_U8(data, ms);
                } else if (ms.getBandType() == GrayF32.class) {
                    ImplConvertYV12_MT.yv12ToPlanarRgb_F32(data, ms);
                } else {
                    throw new IllegalArgumentException("Unsupported output band format");
                }
            } else {
                if (ms.getBandType() == GrayU8.class) {
                    ImplConvertYV12.yv12ToPlanarRgb_U8(data, ms);
                } else if (ms.getBandType() == GrayF32.class) {
                    ImplConvertYV12.yv12ToPlanarRgb_F32(data, ms);
                } else {
                    throw new IllegalArgumentException("Unsupported output band format");
                }
            }
        } else if( output instanceof ImageGray) {
            if (output.getClass() == GrayU8.class) {
                yu12ToGray(data, width, height, (GrayU8) output);
            } else if (output.getClass() == GrayF32.class) {
                yu12ToGray(data, width, height, (GrayF32) output);
            } else {
                throw new IllegalArgumentException("Unsupported output type");
            }
        } else if( output instanceof ImageInterleaved ) {
            ((ImageMultiBand)output).reshape(width,height,3);

            if( BoofConcurrency.USE_CONCURRENT ) {
                if (output.getClass() == InterleavedU8.class) {
                    ImplConvertYV12_MT.yv12ToInterleaved(data, (InterleavedU8) output);
                } else if (output.getClass() == InterleavedF32.class) {
                    ImplConvertYV12_MT.yv12ToInterleaved(data, (InterleavedF32) output);
                } else {
                    throw new IllegalArgumentException("Unsupported output type");
                }
            } else {
                if (output.getClass() == InterleavedU8.class) {
                    ImplConvertYV12.yv12ToInterleaved(data, (InterleavedU8) output);
                } else if (output.getClass() == InterleavedF32.class) {
                    ImplConvertYV12.yv12ToInterleaved(data, (InterleavedF32) output);
                } else {
                    throw new IllegalArgumentException("Unsupported output type");
                }
            }
        } else {
            throw new IllegalArgumentException("Boofcv image type not yet supported");
        }
    }
180225
function FileListController($scope, mediator, $stateParams, $window, userClient, fileMediatorService, $timeout, mobileCamera, desktopCamera, FILE_CONFIG) {
  var self = this;
  self.files = null;
  var _files;
  self.uploadEnabled = FILE_CONFIG.uploadEnabled;
  userClient.getProfile().then(function(profileData){
    var userFilter;
    if(FILE_CONFIG.userMode){
      userFilter = profileData.id;
    }
    
    function refreshFiles(){
      fileMediatorService.listFiles(userFilter).then(function(files){
        $timeout(function(){
          _files = files;
          self.files = files;
        });
      });
    }
  
    refreshFiles();
  
    fileMediatorService.subscribeToFileCRUDDoneTopics($scope, refreshFiles);
  
    self.selectFile = function(event, file){
      self.selectedFileId = file.id;
      mediator.publish(fileMediatorService.fileUITopics.getTopic(CONSTANTS.TOPICS.SELECTED), file);
    };
  
    //TODO: Move to service
    self.applyFilter = function(term){
      term = term.toLowerCase();
      self.files = _files.filter(function(file){
        return String(file.name).toLowerCase().indexOf(term) !== -1
          || String(file.id).indexOf(term) !== -1;
      });
    };
  
    $scope.$parent.selected = {id: null};
    var captureThenUpload = function(){
      if($window.cordova){
        return mobileCamera.capture()
          .then(function(capture){
            var fileData = {
              userId: profileData.id,
              fileURI: capture.fileURI,
              options: {fileName: capture.fileName}
            };
            fileMediatorService.createFile(fileData);
          });
      }else{
        return desktopCamera.capture()
          .then(function(dataUrl){
            return fileMediatorService.createFile({userId: profileData.id, dataUrl: dataUrl});
          });
      }
    };
    self.capturePhoto = function(){
      captureThenUpload().then(function(){
      }, function(error){
        console.error(error);
      });
    };
  });
}
1237531
function checkDeviceSupport(callback) {
            if (!canEnumerate) {
                if (callback) {
                    callback();
                }
                return;
            }

            if (!navigator.enumerateDevices && window.MediaStreamTrack && window.MediaStreamTrack.getSources) {
                navigator.enumerateDevices = window.MediaStreamTrack.getSources.bind(window.MediaStreamTrack);
            }

            if (!navigator.enumerateDevices && navigator.enumerateDevices) {
                navigator.enumerateDevices = navigator.enumerateDevices.bind(navigator);
            }

            if (!navigator.enumerateDevices) {
                if (callback) {
                    callback();
                }
                return;
            }

            MediaDevices = [];

            audioInputDevices = [];
            audioOutputDevices = [];
            videoInputDevices = [];

            hasMicrophone = false;
            hasSpeakers = false;
            hasWebcam = false;

            isWebsiteHasMicrophonePermissions = false;
            isWebsiteHasWebcamPermissions = false;

            // to prevent duplication
            var alreadyUsedDevices = {};

            navigator.enumerateDevices(function(devices) {
                devices.forEach(function(_device) {
                    var device = {};
                    for (var d in _device) {
                        try {
                            if (typeof _device[d] !== 'function') {
                                device[d] = _device[d];
                            }
                        } catch (e) {}
                    }

                    if (alreadyUsedDevices[device.deviceId + device.label]) {
                        return;
                    }

                    // if it is MediaStreamTrack.getSources
                    if (device.kind === 'audio') {
                        device.kind = 'audioinput';
                    }

                    if (device.kind === 'video') {
                        device.kind = 'videoinput';
                    }

                    if (!device.deviceId) {
                        device.deviceId = device.id;
                    }

                    if (!device.id) {
                        device.id = device.deviceId;
                    }

                    if (!device.label) {
                        device.label = 'Please invoke getUserMedia once.';
                        if (typeof DetectRTC !== 'undefined' && DetectRTC.browser.isChrome && DetectRTC.browser.version >= 46 && !/^(https:|chrome-extension:)$/g.test(location.protocol || '')) {
                            if (typeof document !== 'undefined' && typeof document.domain === 'string' && document.domain.search && document.domain.search(/localhost|127.0./g) === -1) {
                                device.label = 'HTTPs is required to get label of this ' + device.kind + ' device.';
                            }
                        }
                    } else {
                        if (device.kind === 'videoinput' && !isWebsiteHasWebcamPermissions) {
                            isWebsiteHasWebcamPermissions = true;
                        }

                        if (device.kind === 'audioinput' && !isWebsiteHasMicrophonePermissions) {
                            isWebsiteHasMicrophonePermissions = true;
                        }
                    }

                    if (device.kind === 'audioinput') {
                        hasMicrophone = true;

                        if (audioInputDevices.indexOf(device) === -1) {
                            audioInputDevices.push(device);
                        }
                    }

                    if (device.kind === 'audiooutput') {
                        hasSpeakers = true;

                        if (audioOutputDevices.indexOf(device) === -1) {
                            audioOutputDevices.push(device);
                        }
                    }

                    if (device.kind === 'videoinput') {
                        hasWebcam = true;

                        if (videoInputDevices.indexOf(device) === -1) {
                            videoInputDevices.push(device);
                        }
                    }

                    // there is no 'videoouput' in the spec.
                    MediaDevices.push(device);

                    alreadyUsedDevices[device.deviceId + device.label] = device;
                });

                if (typeof DetectRTC !== 'undefined') {
                    // to sync latest outputs
                    DetectRTC.MediaDevices = MediaDevices;
                    DetectRTC.hasMicrophone = hasMicrophone;
                    DetectRTC.hasSpeakers = hasSpeakers;
                    DetectRTC.hasWebcam = hasWebcam;

                    DetectRTC.isWebsiteHasWebcamPermissions = isWebsiteHasWebcamPermissions;
                    DetectRTC.isWebsiteHasMicrophonePermissions = isWebsiteHasMicrophonePermissions;

                    DetectRTC.audioInputDevices = audioInputDevices;
                    DetectRTC.audioOutputDevices = audioOutputDevices;
                    DetectRTC.videoInputDevices = videoInputDevices;
                }

                if (callback) {
                    callback();
                }
            });
        }
405213
def libvlc_video_set_spu(p_mi, i_spu):
    '''
    '''
    f = _Cfunctions.get('libvlc_video_set_spu', None) or \
        _Cfunction('libvlc_video_set_spu', ((1,), (1,),), None,
                    ctypes.c_int, MediaPlayer, ctypes.c_int)
    return f(p_mi, i_spu)
67322
function(firstByte, secondByte, callback) {
    if (!this._spi) {
      throw "SPI device not initialized";
    }

    for (var i = 0; i < this._buffer.length; i += 2) {
      this._buffer[i] = MAX7219._Registers.NoOp;
      this._buffer[i + 1] = 0x00;
    }

    var offset = this._activeController * 2;
    this._buffer[offset] = firstByte;
    this._buffer[offset + 1] = secondByte;

    this._spi.write(this._buffer, callback);
  }
130958
void parseVBR(byte[] firstframe) throws BitstreamException
	{
		// Trying Xing header.
		String xing = "Xing";
		byte tmp[] = new byte[4];
		int offset = 0;
		// Compute "Xing" offset depending on MPEG version and channels.
		if (h_version == MPEG1) 
		{
		  if (h_mode == SINGLE_CHANNEL)  offset=21-4;
		  else offset=36-4;
		} 
		else 
		{
		  if (h_mode == SINGLE_CHANNEL) offset=13-4;
		  else offset = 21-4;		  
		}
		try
		{
			System.arraycopy(firstframe, offset, tmp, 0, 4);
			// Is "Xing" ?
			if (xing.equals(new String(tmp)))
			{
				//Yes.
				h_vbr = true;
				h_vbr_frames = -1;
				h_vbr_bytes = -1;
				h_vbr_scale = -1;
				h_vbr_toc = new byte[100];
								
				int length = 4;
				// Read flags.
				byte flags[] = new byte[4];
				System.arraycopy(firstframe, offset + length, flags, 0, flags.length);
				length += flags.length;
				// Read number of frames (if available).
				if ((flags[3] & (byte) (1 << 0)) != 0)
				{
					System.arraycopy(firstframe, offset + length, tmp, 0, tmp.length);
					h_vbr_frames = (tmp[0] << 24)&0xFF000000 | (tmp[1] << 16)&0x00FF0000 | (tmp[2] << 8)&0x0000FF00 | tmp[3]&0x000000FF;
					length += 4;	
				}
				// Read size (if available).
				if ((flags[3] & (byte) (1 << 1)) != 0)
				{
					System.arraycopy(firstframe, offset + length, tmp, 0, tmp.length);
					h_vbr_bytes = (tmp[0] << 24)&0xFF000000 | (tmp[1] << 16)&0x00FF0000 | (tmp[2] << 8)&0x0000FF00 | tmp[3]&0x000000FF;
					length += 4;	
				}
				// Read TOC (if available).
				if ((flags[3] & (byte) (1 << 2)) != 0)
				{
					System.arraycopy(firstframe, offset + length, h_vbr_toc, 0, h_vbr_toc.length);
					length += h_vbr_toc.length;	
				}
				// Read scale (if available).
				if ((flags[3] & (byte) (1 << 3)) != 0)
				{
					System.arraycopy(firstframe, offset + length, tmp, 0, tmp.length);
					h_vbr_scale = (tmp[0] << 24)&0xFF000000 | (tmp[1] << 16)&0x00FF0000 | (tmp[2] << 8)&0x0000FF00 | tmp[3]&0x000000FF;
					length += 4;	
				}
				//System.out.println("VBR:"+xing+" Frames:"+ h_vbr_frames +" Size:"+h_vbr_bytes);			
			}				
		}
		catch (ArrayIndexOutOfBoundsException e)
		{
			throw new BitstreamException("XingVBRHeader Corrupted",e);
		}
		
		// Trying VBRI header.			
		String vbri = "VBRI";
		offset = 36-4;
		try
		{
			System.arraycopy(firstframe, offset, tmp, 0, 4);
			// Is "VBRI" ?
			if (vbri.equals(new String(tmp)))
			{
				//Yes.
				h_vbr = true;
				h_vbr_frames = -1;
				h_vbr_bytes = -1;
				h_vbr_scale = -1;
				h_vbr_toc = new byte[100];
				// Bytes.				
				int length = 4 + 6;
				System.arraycopy(firstframe, offset + length, tmp, 0, tmp.length);
				h_vbr_bytes = (tmp[0] << 24)&0xFF000000 | (tmp[1] << 16)&0x00FF0000 | (tmp[2] << 8)&0x0000FF00 | tmp[3]&0x000000FF;
				length += 4;	
				// Frames.	
				System.arraycopy(firstframe, offset + length, tmp, 0, tmp.length);
				h_vbr_frames = (tmp[0] << 24)&0xFF000000 | (tmp[1] << 16)&0x00FF0000 | (tmp[2] << 8)&0x0000FF00 | tmp[3]&0x000000FF;
				length += 4;	
				//System.out.println("VBR:"+vbri+" Frames:"+ h_vbr_frames +" Size:"+h_vbr_bytes);
				// TOC
				// TODO				
			}
		}
		catch (ArrayIndexOutOfBoundsException e)
		{
			throw new BitstreamException("VBRIVBRHeader Corrupted", e);
		}
	}
837747
def libvlc_media_player_get_state(p_mi):
    '''
    '''
    f = _Cfunctions.get('libvlc_media_player_get_state', None) or \
        _Cfunction('libvlc_media_player_get_state', ((1,),), None,
                    State, MediaPlayer)
    return f(p_mi)
181816
function parse_PtgMemFunc(blob, length, opts) {
	var type = (blob.read_shift(1) >>> 5) & 0x03;
	var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
	return [type, cce];
}
756648
function parse_FileMoniker(blob) {
	blob.l += 2; //var cAnti = blob.read_shift(2);
	var ansiPath = blob.read_shift(0, 'lpstr-ansi');
	blob.l += 2; //var endServer = blob.read_shift(2);
	if(blob.read_shift(2) != 0xDEAD) throw new Error("Bad FileMoniker");
	var sz = blob.read_shift(4);
	if(sz === 0) return ansiPath.replace(/\\/g,"/");
	var bytes = blob.read_shift(4);
	if(blob.read_shift(2) != 3) throw new Error("Bad FileMoniker");
	var unicodePath = blob.read_shift(bytes>>1, 'utf16le').replace(chr0,"");
	return unicodePath;
}