Esempio n. 1
0
		public void PopulateFloatBackedTableTest()
		{
            int[] tmp = new int[]{
                 2,38
                 ,7,0,90,4,1,0,-12,-56,15,64,-98,35,12,64,0,0,0,0,0,0,0,0,46,1,17,1,0,0,0,0,96,-41,-104,36,122,-86,-46,-120
                 ,7,0,-66,4,1,0,96,-43,14,64,-63,49,13,64,0,0,0,0,0,0,0,0,56,1,17,1,0,0,0,0,112,125,77,38,122,-86,-46,-120
                 ,7,0,66,8,1,0,74,-68,6,64,-118,-7,8,64,0,0,0,0,0,0,0,0,93,1,46,1,0,0,0,0,-47,-104,2,40,122,-86,-46,-120
            };
            byte[] expected_binary_data = new byte[tmp.Length];
            for(int i=0;i<expected_binary_data.Length;i++) expected_binary_data[i] = (byte)tmp[i];
            run_metrics run = new run_metrics();
            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.extraction_metric_set());

            var run_param = new parameters();
            Assert.AreEqual(run_param.version(), 0);
            Assert.AreEqual(run.extraction_metric_set().MaxCycle, 1);

            read_info_vector reads = new read_info_vector();
            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                    "",
                    "",
                    1,
                    new flowcell_layout(2, 2, 2, 16),
                    new string_vector(),
                    new image_dimensions(),
                    reads
            ));
            run.legacy_channel_update(instrument_type.HiSeq);

            imaging_column_vector columnVector = new imaging_column_vector();
            c_csharp_imaging.create_imaging_table_columns(run, columnVector);
            map_id_offset rowOffsets = new map_id_offset();
            c_csharp_imaging.count_table_rows(run, rowOffsets);
            uint columnCount = c_csharp_imaging.count_table_columns(columnVector);
            var data = new float[rowOffsets.Count*columnCount];
            c_csharp_imaging.populate_imaging_table_data(run, columnVector, rowOffsets, data, (uint)data.Length);
            Assert.AreEqual(rowOffsets.Count, 3);
            Assert.AreEqual(data[0], 7);

		}
Esempio n. 2
0
		public void IntensityTest()
		{
            int[] tmp = new int[]{
                 2,38
                 ,7,0,90,4,1,0,-12,-56,15,64,-98,35,12,64,0,0,0,0,0,0,0,0,46,1,17,1,0,0,0,0,96,-41,-104,36,122,-86,-46,-120
                 ,7,0,-66,4,1,0,96,-43,14,64,-63,49,13,64,0,0,0,0,0,0,0,0,56,1,17,1,0,0,0,0,112,125,77,38,122,-86,-46,-120
                 ,7,0,66,8,1,0,74,-68,6,64,-118,-7,8,64,0,0,0,0,0,0,0,0,93,1,46,1,0,0,0,0,-47,-104,2,40,122,-86,-46,-120
            };
            byte[] expected_binary_data = new byte[tmp.Length];
            for(int i=0;i<expected_binary_data.Length;i++) expected_binary_data[i] = (byte)tmp[i];
            run_metrics run = new run_metrics();
            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.extraction_metric_set());

            var run_param = new parameters();
            Assert.AreEqual(run_param.version(), 0);
            Assert.AreEqual(run.extraction_metric_set().MaxCycle, 1);

            filter_options options = new filter_options(tile_naming_method.FourDigit);
            read_info_vector reads = new read_info_vector();
            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                    "",
                    "",
                    1,
                    new flowcell_layout(2, 2, 2, 16),
                    new string_vector(),
                    new image_dimensions(),
                    reads
            ));
            run.set_naming_method(tile_naming_method.FourDigit);
            run.legacy_channel_update(instrument_type.HiSeq);

            candle_stick_plot_data data = new candle_stick_plot_data();
            c_csharp_plot.plot_by_cycle(run, metric_type.Intensity, options, data);
            Assert.AreEqual(data.size(), 4);

		}
Esempio n. 3
0
            public string export(lambda i,string web_token) {
                string query="SELECT TOP 1 json,token FROM titanDWS_exports WITH (NOLOCK) WHERE [id]=@export_id AND [web_token]=@token";
                parameters param=new parameters();
                param.add("@token"     ,web_token);
                param.add("@export_id" ,i.export_id);

                System.Web.Script.Serialization.JavaScriptSerializer jss=new System.Web.Script.Serialization.JavaScriptSerializer();
                lambda export_input=null;
                security.titan_token s_token=null;
                data_set result=db.fetch("titan",query,param);

                if(null!=results) {
                    string json= (string)result[0,"json"];
                    string token=(string)result[0,"token"];
                    export_input=jss.Deserialize<lambda>(json);
                    s_token=jss.Deserialize<security.titan_token>(token);
                } else {
                    return null;                                                 //nothing... lets exit
                }
                                       
            if(null==export_input) return null;
            string name=String.Format("{0}-{1}-{2}.csv",export_input.group,export_input.method,DateTime.Now.ToLongTimeString());
            /*HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.ClearHeaders();
            HttpContext.Current.Response.ClearContent();
            HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=" + name);
            HttpContext.Current.Response.ContentType = "text/csv";
            HttpContext.Current.Response.AddHeader("Pragma", "public");
            */
            

            export_input.pageLength=0;
            export_input.page=0;
            this.input=export_input;

            StringBuilder sb=new StringBuilder();
            
            method m=new method();
            m.execute(input,true,s_token,false);
     
                int index=0;
                foreach (query.column c in results.columns) {
                    core.column mc=m.data_schema.Find(x=>x.name==c.name);
                    if(null!=mc && mc.export) {
                        if (index!=0) {
                            sb.Append(",");
                        }
                        index++;
                       sb.Append(String.Format("\"{0}\"",c.name));
                    }
                }        
                sb.Append("\r\n");
                   
                 
                foreach (string[] row in results.rows) {        //row
                    index=0;
                    foreach (string column in row) {        //column
                        if (index!=0) {
                            sb.Append(",");
                        }
                        index++;
                        sb.Append(String.Format("\"{0}\"",column));
                    }
                    sb.Append("\r\n");
                }

                return sb.ToString();
                //HttpContext.Current.Response.Flush();
                //HttpContext.Current.Response.End();
            }//end export
Esempio n. 4
0
 ProviderType.GoogleDrive => new GoogleDriveProvider(parameters, _cache),
Esempio n. 5
0
 public results getResults(parameters pa)
 {
     para = pa;
     func(para, out res);
     return(res);
 }
Esempio n. 6
0
 public SWIGTYPE_p_CoolPropDbl first_partial_deriv(parameters Of, parameters Wrt, parameters Constant)
 {
     SWIGTYPE_p_CoolPropDbl ret = new SWIGTYPE_p_CoolPropDbl(CoolPropPINVOKE.AbstractState_first_partial_deriv(swigCPtr, (int)Of, (int)Wrt, (int)Constant), true);
     if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
Esempio n. 7
0
 public double second_saturation_deriv(parameters Of1, parameters Wrt1, parameters Wrt2)
 {
     double ret = CoolPropPINVOKE.AbstractState_second_saturation_deriv(swigCPtr, (int)Of1, (int)Wrt1, (int)Wrt2);
     if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
Esempio n. 8
0
 public double first_two_phase_deriv_splined(parameters Of, parameters Wrt, parameters Constant, double x_end) {
   double ret = CoolPropPINVOKE.AbstractState_first_two_phase_deriv_splined(swigCPtr, (int)Of, (int)Wrt, (int)Constant, x_end);
   if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Esempio n. 9
0
 /// <summary>
 /// Parameter by Name
 /// </summary>
 /// <param name="Parameters"></param>
 /// <param name="Name"></param>
 /// <returns></returns>
 public static parameter Lookup(this parameters Parameters, string Name)
 {
     return Parameters.parameter.FirstOrDefault(p => { return p.name.Equals(Name); });
 }
 SetParameter(parameters, entity);
Esempio n. 11
0
 (type => type == typeof(long), (parameters, range) => CheckRangeLong(parameters, range))
Esempio n. 12
0
 (type => type == typeof(int) || type.IsEnum, (parameters, range) => CheckRangeInteger(parameters, range)),
 (type => type == typeof(long), (parameters, range) => CheckRangeLong(parameters, range))
Esempio n. 13
0
 (type => type == typeof(decimal), (parameters, range) => CheckRangeDecimal(parameters, range)),
 (type => type == typeof(int) || type.IsEnum, (parameters, range) => CheckRangeInteger(parameters, range)),
Esempio n. 14
0
 (type => type == typeof(double), (parameters, range) => CheckRangeDouble(parameters, range)),
 (type => type == typeof(decimal), (parameters, range) => CheckRangeDecimal(parameters, range)),
Esempio n. 15
0
 public double saturated_vapor_keyed_output(parameters key) {
   double ret = CoolPropPINVOKE.AbstractState_saturated_vapor_keyed_output(swigCPtr, (int)key);
   if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Esempio n. 16
0
 public double second_saturation_deriv(parameters Of1, parameters Wrt1, parameters Wrt2) {
   double ret = CoolPropPINVOKE.AbstractState_second_saturation_deriv(swigCPtr, (int)Of1, (int)Wrt1, (int)Wrt2);
   if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Esempio n. 17
0
 (type => type == typeof(float), (parameters, minimumRule, maximumRule) => CheckRangeFloat(parameters, minimumRule, maximumRule)),
 (type => type == typeof(double), (parameters, minimumRule, maximumRule) => CheckRangeDouble(parameters, minimumRule, maximumRule)),
Esempio n. 18
0
    public double second_two_phase_deriv(parameters Of, parameters Wrt1, parameters Constant1, parameters Wrt2,
                                         parameters Constant2)
    {
        var ret = CoolPropPINVOKE.AbstractState_second_two_phase_deriv(swigCPtr, (int)Of, (int)Wrt1, (int)Constant1,
                                                                       (int)Wrt2, (int)Constant2);

        if (CoolPropPINVOKE.SWIGPendingException.Pending)
        {
            throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Esempio n. 19
0
 (type => type == typeof(double), (parameters, minimumRule, maximumRule) => CheckRangeDouble(parameters, minimumRule, maximumRule)),
 (type => type == typeof(decimal), (parameters, minimumRule, maximumRule) => CheckRangeDecimal(parameters, minimumRule, maximumRule)),
Esempio n. 20
0
 (type => type == typeof(float), (parameters, range) => CheckRangeFloat(parameters, range)),
 (type => type == typeof(double), (parameters, range) => CheckRangeDouble(parameters, range)),
Esempio n. 21
0
 (type => type == typeof(decimal), (parameters, minimumRule, maximumRule) => CheckRangeDecimal(parameters, minimumRule, maximumRule)),
 (type => type == typeof(int) || type.IsEnum, (parameters, minimumRule, maximumRule) => CheckRangeInteger(parameters, minimumRule, maximumRule)),
Esempio n. 22
0
 public double trivial_keyed_output(parameters key)
 {
     double ret = CoolPropPINVOKE.AbstractState_trivial_keyed_output(swigCPtr, (int)key);
     if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
Esempio n. 23
0
 (type => type == typeof(int) || type.IsEnum, (parameters, minimumRule, maximumRule) => CheckRangeInteger(parameters, minimumRule, maximumRule)),
 (type => type == typeof(long), (parameters, minimumRule, maximumRule) => CheckRangeLong(parameters, minimumRule, maximumRule))
Esempio n. 24
0
 public SWIGTYPE_p_CoolPropDbl second_saturation_deriv(parameters Of1, parameters Wrt1, parameters Of2, parameters Wrt2)
 {
     SWIGTYPE_p_CoolPropDbl ret = new SWIGTYPE_p_CoolPropDbl(CoolPropPINVOKE.AbstractState_second_saturation_deriv(swigCPtr, (int)Of1, (int)Wrt1, (int)Of2, (int)Wrt2), true);
     if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
Esempio n. 25
0
 (type => type == typeof(long), (parameters, minimumRule, maximumRule) => CheckRangeLong(parameters, minimumRule, maximumRule))
Esempio n. 26
0
 select(parameters, FileLocation.Concat(l, r));
Esempio n. 27
0
        public data_set sp_fetch_all(string connection_string, string query, parameters parameters = null, bool meta = false)
        {
            query_params q = new query_params(connection_string, query, parameters, meta, query_types.sp_multiple);

            return(this.sql_query(q));
        }
Esempio n. 28
0
 ProviderType.Yandex => new YandexDiskProvider(parameters, _authenticator),
Esempio n. 29
0
        private parameters generate_crud_parameters(object o)
        {
            parameters param = new parameters();
            Type       T     = o.GetType();

            PropertyInfo[] properties = T.GetProperties();
            foreach (PropertyInfo pi in T.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))
            {
                string field_name = pi.Name;
                //if (field_name == "_table" || field_name == "_pk" || field_name == "_json") continue;              //dont paramaterize the base properties
                object property_value = pi.GetValue(o, null);

                /*if (null != _json) {
                 *  bool found = false;
                 *  foreach (string s in _json) {
                 *      if (s == field_name) {
                 *
                 *          string serial = JsonConvert.SerializeObject(property_value);
                 *          if (pi.GetValue(this, null) != null) {
                 *              param.add("@" + field_name, serial);
                 *              found = true;
                 *              break;
                 *          }
                 *      }
                 *  }
                 *  if (found) continue;
                 * }*/
                if (property_value is Guid)
                {
                    if (((Guid)property_value) == Guid.Empty)
                    {
                        continue;
                    }
                    param.add("@" + field_name, (Guid)property_value);
                    continue;
                }
                if (property_value is DateTime)
                {
                    if ((DateTime)property_value == DateTime.MinValue)
                    {
                        continue;
                    }
                    param.add("@" + field_name, (DateTime)property_value);
                    continue;
                }
                if (property_value is string)
                {
                    param.add("@" + field_name, (string)property_value);
                    continue;
                }
                if (property_value is int)
                {
                    param.add("@" + field_name, (int)property_value);
                    continue;
                }
                if (property_value is bool)
                {
                    param.add("@" + field_name, (bool)property_value);
                    continue;
                }
                if (pi.GetValue(this, null) != null)
                {
                    param.add("@" + field_name, property_value);
                    continue;
                }
            }
            return(param);
        }
Esempio n. 30
0
 var(parameters, paramValues) = captures;
Esempio n. 31
0
        public parameters run_parameters()
        {
            parameters ret = new parameters(c_csharp_run_metricsPINVOKE.run_metrics_run_parameters__SWIG_0(swigCPtr), false);

            return(ret);
        }
Esempio n. 32
0
 public double first_partial_deriv(parameters Of, parameters Wrt, parameters Constant) {
   double ret = CoolPropPINVOKE.AbstractState_first_partial_deriv(swigCPtr, (int)Of, (int)Wrt, (int)Constant);
   if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Esempio n. 33
0
        public static method from_json(string text, security.titan_token token, bool save = true)
        {
            method m = JsonConvert.DeserializeObject <method>(text, new JsonSerializerSettings {
                Error = delegate(object sender, ErrorEventArgs args){
                    Console.WriteLine(args.ErrorContext.Error.Message);
                    args.ErrorContext.Handled = true;
                }
            });


            if (null == m.data_schema)
            {
                m.data_schema = new List <titan.core.column>();
            }
            if (null == m.parameters)
            {
                m.parameters = new List <titan.core.parameter>();
            }

            m.parameters.RemoveAll(item => item == null);
            m.parameters.RemoveAll(item => String.IsNullOrWhiteSpace(item.name));

            parameters param = m.execute_load_parameters(token, null, true);

            if (m.regenerate_columns)
            {
                m.data_schema.Clear();
                data_set row   = db.fetch(m.connection_string, strip_comments(m.query), param); //no conn string denotes localhost, aything else is treated as a conn string.. (titan)
                int      index = 0;
                if (null != row)                                                                //only update the titan.core.columns if we have atlest 1 result.
                {
                    foreach (string key in row.Keys)
                    {
                        index++;
                        titan.core.column c = new titan.core.column(key, "text", index, true);
                        m.data_schema.Add(c);                                                 //only add if it doesnt exist...
                    }
                }
                //   if(null!=titan.core.columns) titan.core.columns.RemoveAll(item=> !row.ContainsKey(item.name) );
            }    //
            //global.reload();
            if (save)
            {
                if (!string.IsNullOrWhiteSpace(m.data_mapping_name))
                {
                    if (null == m.sig_init)
                    {
                        m.sig_init        = new external_data_defaults();
                        m.sig_init.group  = m.group;
                        m.sig_init.method = m.method;
                        m.sig_init.owner  = m.owner;
                    }

                    m.sig_init.save();
                }
                m.save();
                m.generate_queries();
            }
            else
            {
                m.generate_queries();
            }
            return(m);
        }
Esempio n. 34
0
 public double second_two_phase_deriv(parameters Of, parameters Wrt1, parameters Constant1, parameters Wrt2, parameters Constant2) {
   double ret = CoolPropPINVOKE.AbstractState_second_two_phase_deriv(swigCPtr, (int)Of, (int)Wrt1, (int)Constant1, (int)Wrt2, (int)Constant2);
   if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Esempio n. 35
0
 connection.Execute(Sql.Script(parameters, content));
Esempio n. 36
0
 public double saturation_ancillary(parameters param, int Q, parameters given, double value) {
   double ret = CoolPropPINVOKE.AbstractState_saturation_ancillary(swigCPtr, (int)param, Q, (int)given, value);
   if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Esempio n. 37
0
 public double first_partial_deriv(parameters Of, parameters Wrt, parameters Constant)
 {
     double ret = CoolPropPINVOKE.AbstractState_first_partial_deriv(swigCPtr, (int)Of, (int)Wrt, (int)Constant);
     if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
Esempio n. 38
0
 public double first_two_phase_deriv_splined(parameters Of, parameters Wrt, parameters Constant, double x_end)
 {
     double ret = CoolPropPINVOKE.AbstractState_first_two_phase_deriv_splined(swigCPtr, (int)Of, (int)Wrt, (int)Constant, x_end);
     if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
Esempio n. 39
0
 public double saturation_ancillary(parameters param, int Q, parameters given, double value)
 {
     double ret = CoolPropPINVOKE.AbstractState_saturation_ancillary(swigCPtr, (int)param, Q, (int)given, value);
     if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
Esempio n. 40
0
 public static bool match_pair(parameters key1, parameters key2, parameters x1, parameters x2, SWIGTYPE_p_bool swap)
 {
     bool ret = CoolPropPINVOKE.match_pair((int)key1, (int)key2, (int)x1, (int)x2, SWIGTYPE_p_bool.getCPtr(swap));
     if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
Esempio n. 41
0
 (type => type == typeof(DateTime), (parameters, fieldFrom, fieldTo) => CheckRangeBetweenDateTime(parameters, fieldFrom, fieldTo))