Example #1
0
        static void Main(string[] args)
        {
            val pressure    = new val();
            val temperature = new val();
            val humidity    = new val();
            val rain        = new val();

            // Open database
            string path          = "/Users/enrico/Documents/gibb_csharp/weather_data/Wetterdaten2011.csv";
            var    database_file = new StreamReader(path);
            // get database size
            var lineCount = File.ReadAllLines(@"/Users/enrico/Documents/gibb_csharp/weather_data/Wetterdaten2011.csv").Length;

            //string[] y = x.Split(';');
            //Console.WriteLine(y[0]);
            //Double val = Double.Parse(y[1]);
            Console.WriteLine(lineCount);



            for (var i = 0; i < lineCount; i++)
            {
                string   line  = database_file.ReadLine();
                string[] array = line.Split(';');
                Console.WriteLine(line);
                pressure.new_val    = Double.Parse(array[0]);
                temperature.new_val = Double.Parse(array[1]);
                humidity.new_val    = Double.Parse(array[2]);
                rain.new_val        = Double.Parse(array[3]);

                database.updateAll();
            }
        }
Example #2
0
        async public Task <IActionResult> Post([FromBody] val body)
        {
            Db.Connection.Open();
            var que = new logicinsert(Db);
            await que.addDevice(body);

            Db.Connection.Close();
            return(Ok());
        }
Example #3
0
        async public Task <IActionResult> Put(int device_id, [FromBody] val body)
        {
            Db.Connection.Open();
            var query = new logicupdate(Db);

            body.device_id = device_id;
            await query.updateDevice(body);

            Db.Connection.Close();
            return(Ok());
        }
Example #4
0
    public void NullOperand()
    {
        val nullVal = null;

        //AND
        aQuery = new Query <ColumnInfo>();
        aQuery.And(val.of("NUM") == 10 & null);
        Assert.AreEqual("NUM = 10", aQuery.GetWhereExp());

        aQuery = new Query <ColumnInfo>();
        aQuery.And(null & val.of("NUM") == 10);
        Assert.AreEqual("NUM = 10", aQuery.GetWhereExp());

        aQuery = new Query <ColumnInfo>();
        //aQuery.And(nullVal And nullVal)
        Assert.AreEqual("", aQuery.GetWhereExp());

        //OR
        aQuery = new Query <ColumnInfo>();
        aQuery.And(val.of("NUM") == 10 | null);
        Assert.AreEqual("NUM = 10", aQuery.GetWhereExp());

        aQuery = new Query <ColumnInfo>();
        aQuery.And(null | val.of("NUM") == 10);
        Assert.AreEqual("NUM = 10", aQuery.GetWhereExp());

        aQuery = new Query <ColumnInfo>();
        //aQuery.And(nullVal Or nullVal)
        Assert.AreEqual("", aQuery.GetWhereExp());

        //XOR
        aQuery = new Query <ColumnInfo>();
        aQuery.And(val.of("NUM") == 10 ^ null);
        Assert.AreEqual("NUM = 10", aQuery.GetWhereExp());

        aQuery = new Query <ColumnInfo>();
        aQuery.And(null ^ val.of("NUM") == 10);
        Assert.AreEqual("NUM = 10", aQuery.GetWhereExp());

        aQuery = new Query <ColumnInfo>();
        //aQuery.And(nullVal Xor nullVal)
        Assert.AreEqual("", aQuery.GetWhereExp());
    }
Example #5
0
        public PlayingCard DealCardFromPack()
        {
            Suit suit = (Suit)randomCardSelector.Next(NumSuits);

            while (this.IsSuitEmpty(suit))
            {
                suit = (Suit)randomCardSelector.Next(NumSuits);
            }

            Value value = (Value)randomCardSelector.Next(CardsPerSuit);

            while (this.IsCardAlreadyDealt(suit, value))
            {
                val ue = (Value)randomCardSelector.Next(CardsPerSuit);
            }

            PlayingCard card = this.cardPack[(int)suit, (int)value];

            this.cardPack[(int)suit, (int)value] = null;
            return(card);
        }
Example #6
0
 public void LoadContent()
 {
     level = new Levels(content);
     level.CreateWorld(lvl);
     enemy = new enemys(content, level.colli, lvl);
     enemy.CreateEnemy();
     camera    = new Camera(graphicsDevice.Viewport);
     texture   = content.Load <Texture2D>("Hero/spritesheet");
     valsstrik = content.Load <Texture2D>("Level/dood");
     exit      = content.Load <Texture2D>("Level/exit");
     hero      = new Speler(texture, level.colli, content);
     spring    = content.Load <SoundEffect>("Geluid/spring");
     if (!lvl)
     {
         bgtexture = content.Load <Texture2D>("Background/level1background");
     }
     else
     {
         bgtexture = content.Load <Texture2D>("Background/level2background");
     }
     ex   = new exit(exit, lvl);
     vals = new val(valsstrik);
     vals.CreateVal();
 }
Example #7
0
 var(val, mode) = parameter;
Example #8
0
 red          = SetValue(val, isDec);
Example #9
0
 cell.AsRange().AssignValue(val, customProjection, dataFormatOverride);
Example #10
0
 comparer(
     val,
     args[i].Item1,
Example #11
0
 // see also: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libast/common/uwin/getpass.c
 var(val, err) = unix.IoctlGetTermios(fd, unix.TCGETS);
Example #12
0
				this.send_msg_data(val)

		@socket.onmessage = (msg) =>
Example #13
0
 public byte[] Make(Dictionary<UInt32, val> settings)
 {
     Byte [] pack = new Byte [settings.Count*2*sizeof(UInt32)+4];
     Buffer.BlockCopy(BitConverter.GetBytes(settings.Count), 0, pack, 0, sizeof(UInt32));
     int offset = 0;
     foreach(var pair in settings){
         offset+=4;
         Buffer.BlockCopy(BitConverter.GetBytes(pair.Key), 0 , pack, offset, sizeof(UInt32));
         offset+=4;
         val i = new val();
         i = pair.Value;
         Buffer.BlockCopy(BitConverter.GetBytes(i.flag), 0, pack, offset, sizeof(UInt32));
         offset+=4;
         Buffer.BlockCopy(BitConverter.GetBytes(i.values), 0, pack, offset, sizeof(UInt32));
     }
     return pack;
 }
Example #14
0
        public Dictionary<UInt32, val> Extract(byte [] stream)
        {
            Dictionary<UInt32, val> pack = new Dictionary<UInt32, val>  ();
            UInt32 count = BitConverter.ToUInt32(stream, 0);
            int offset=4;
            val v = new val();
            for(int i=0; i< count; i++){
                UInt32 id = BitConverter.ToUInt32(stream, offset);
                offset+=4;
                v.flag = BitConverter.ToUInt32(stream, offset);
                offset+=4;
                v.values = BitConverter.ToUInt32(stream, offset);
                offset+=4;

                pack.Add(id, v);
            }
            return pack;
        }
Example #15
0
    /**
     * ゲイン調整済みデータ受信時の動作
     */
    private void receiveData(BrainDataFeedbacker nfb, Hot2gEnumerations.EnumHot2gMeasResult e, object data, DataLogger logger)
    {
        switch (e)
        {
        /*XB-01*/
        case Hot2gEnumerations.EnumHot2gMeasResult.Ac1ch:
            //Debug.Log("Ac1ch:" + LitJson.JsonMapper.ToJson(data));

            //- check afterGainCounter
            checkAfterGainCounter();


            if (Hot2gApplication.Instance.datastore.stability.Count > 1)
            {
                Debug.Log("Ac1chRec: [ " + Hot2gApplication.Instance.mode.ToString() +
                          " ]/[ " + Hot2gApplication.Instance.datastore.stability[Hot2gApplication.Instance.datastore.stability.Count - 1] +
                          " ]/[: " + Hot2gApplication.Instance.state2.ToString() +
                          " ]/[G1: " + Hot2gApplication.Instance.m_gc.getL1Gain() + "][G3: " + Hot2gApplication.Instance.m_gc.getL3Gain() +
                          " ]/[Raw 1: " + Hot2gApplication.Instance.datastore.l1Ac[Hot2gApplication.Instance.datastore.l1Ac.Count - 1] +
                          " ]/[Raw 3: " + Hot2gApplication.Instance.datastore.l3Ac[Hot2gApplication.Instance.datastore.l3Ac.Count - 1] +
                          " ]/ after MGC: " + Hot2gApplication.Instance.afterMGC_counter.ToString()
                          );
            }

            Xb01data xbData = this.dataStore.add(data as Hot2gMeasData1chAc, nfb.calcActivenessFromBuffered());

            state2 = updateStatusOnHead(); //- check XB-01 On head status

            nfb.bufferActiveness();        //- calc Brain activation level


            if (logger != null)
            {
                logger.write(xbData.ConvCSV());
            }

            break;

#if false
        case Hot2gEnumerations.EnumHot2gMeasResult.Ac2ch:
        {
            when(Hot2gDevInfo().valDevType)
            {
                /* HOT-2000 */
                Hot2gEnumerations.EnumHot2gDevType.HOT2000->{
                    val hot2Data = this.dataStore.add(data as Hot2gMeasData2chAc)
                                   logger?.write(hot2Data)
                }
                /* HOT-1000 */
                Hot2gEnumerations.EnumHot2gDevType.HOT1000->{
                    val hot1data = this.dataStore.add(data as Hot2gMeasData2chAc)
                                   logger?.write(hot1data)
                }
            }
#endif
        /* 心拍数 */
        case Hot2gEnumerations.EnumHot2gMeasResult.HeartRate:
            this.dataStore.add(data as Hot2gMeasDataHR);
            break;

        /* 脈波振幅関連係数 */
        case Hot2gEnumerations.EnumHot2gMeasResult.HRElement1:
            this.dataStore.add(data as Hot2gMeasDataHRElement);
            break;

        /* 姿勢変化のチェック */
        case Hot2gEnumerations.EnumHot2gMeasResult.MotionBatt:
            GyroScope.Stability s_pre = this.dataStore.stability[this.dataStore.stability.Count - 1];
            GyroScope.Stability s     = this.dataStore.add(data as Hot2gMeasDataMotBatt);
            break;
        }
    }
 return translateByte(val).ToString("X");
 private View createCustomAnimationView()
 {
     val customView = LayoutInflater.from(this).inflate(R.layout.marker_view, null)
 }
Example #18
0
 var(val, stat) = vstat_struct;