예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Informar o nome a ser calculado:");
            ar nomeLength = Console.ReadLine();

            Console.WriteLine($"O tamanho deste nome é: {nomeLength.Replace(" ", "").Length}");
            Console.ReadKey();
        }
예제 #2
0
 public void b()
 {
     GC.SuppressFinalize(this);
     this.a();
     this.az.Clear();
     this.n   = null;
     this.ag  = null;
     this.au  = null;
     this.at  = null;
     this.@as = null;
     this.ar  = null;
     this.aq  = null;
     this.ap  = null;
     this.ao  = null;
     this.an  = null;
     this.am  = null;
     this.al  = null;
     this.ak  = null;
     this.aj  = null;
     this.ai  = null;
     this.ah  = null;
     this.af  = null;
     this.ae  = null;
     this.ad  = null;
     this.ac  = null;
     this.ab  = null;
     this.aa  = null;
     this.z   = null;
     this.y   = null;
     this.x   = null;
     this.w   = null;
     this.v   = null;
     this.u   = null;
     this.t   = null;
     this.s   = null;
     this.r   = null;
     this.q   = null;
     this.p   = null;
     this.c   = null;
     this.av  = null;
     this.o   = null;
     this.m   = null;
     this.l   = null;
     this.k   = null;
     this.j   = null;
     this.i   = null;
     this.h   = null;
     this.g   = null;
     this.f   = null;
     this.e   = null;
     this.d   = null;
     this.b   = null;
     this.a   = null;
     this.aw  = null;
     this.ax  = null;
     this.ay  = null;
 }
예제 #3
0
 public y(ar A_0)
 {
     this.f = A_0;
     CoreManager.get_Current().add_ChatBoxMessage(new EventHandler <ChatTextInterceptEventArgs>(this.a));
     this.f.d(new EventHandler(this.b));
     this.f.a(new EventHandler(this.a));
     this.f.b(new EventHandler(this.c));
     this.g.a(new EventHandler(this.d));
     a.a("fvote", new a.c(this.a));
     PluginCore.PC.ProfileChanged += new PluginCore.EmptyDelegate(this.d);
     this.g.a(0x30d7);
     this.g.d();
 }
예제 #4
0
        public Iar Create(
            ImmutableList <IarCrossJoinElement> value)
        {
            Iar crossJoin = null;

            try
            {
                crossJoin = new ar(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(crossJoin);
        }
예제 #5
0
 public ev(CoreManager A_0, PluginHost A_1, PluginCore A_2)
 {
     this.aw = A_0;
     this.ax = A_1;
     this.ay = A_2;
     this.a  = new b2(this.ay);
     this.az.Add(this.a);
     this.b = new j();
     this.az.Add(this.b);
     this.d = new aj();
     this.az.Add(this.d);
     this.e = new cd((FileService)this.aw.get_FileService(), this);
     this.az.Add(this.e);
     this.f = new d6();
     this.az.Add(this.f);
     this.g = new dv(this);
     this.az.Add(this.g);
     this.z = new s(this.aw);
     this.az.Add(this.z);
     this.h = new cs(this);
     this.az.Add(this.h);
     this.i = new dg(this);
     this.az.Add(this.i);
     this.j = new dl(this);
     this.az.Add(this.j);
     this.k = new eo(this);
     this.az.Add(this.k);
     this.l = new bh();
     this.az.Add(this.l);
     this.m = new fq();
     this.az.Add(this.m);
     this.o = new bw();
     this.az.Add(this.o);
     this.c = new cLogic(this.g, this.ay, this.z);
     this.az.Add(this.c);
     this.p = new cj(new cj.a(ad.a), A_1.get_Actions());
     this.az.Add(this.p);
     this.q = new b5(this.aw, this.ay);
     this.az.Add(this.q);
     this.r = new cz(this.ay, this.aw, this.ax, this.p);
     this.az.Add(this.r);
     this.s = new ag();
     this.az.Add(this.s);
     this.t = new fc(this.aw, this.ay);
     this.az.Add(this.t);
     this.u = new b0(this.aw, this.ay, this.p);
     this.az.Add(this.u);
     this.v = new el(this.aw);
     this.az.Add(this.v);
     this.w = new bd();
     this.az.Add(this.w);
     this.x = new bv(this.aw);
     this.az.Add(this.x);
     this.y = new a7(this.aw);
     this.az.Add(this.y);
     this.n = new fn(this.aw, this.p);
     this.az.Add(this.n);
     this.aa = new d0(this.aw);
     this.az.Add(this.aa);
     this.ab = new da(this.p, this.ay);
     this.az.Add(this.ab);
     this.ac = new bj();
     this.az.Add(this.ac);
     this.ad = new fs();
     this.az.Add(this.ad);
     this.ae = new b9();
     this.az.Add(this.ae);
     this.af = new en();
     this.az.Add(this.af);
     this.ah = new e0();
     this.az.Add(this.ah);
     this.ai = new ar();
     this.az.Add(this.ai);
     this.aj = new y(this.ai);
     this.az.Add(this.aj);
     this.ak = new cRechargeManager();
     this.az.Add(this.ak);
     this.al = new q();
     this.az.Add(this.al);
     this.am = new fr();
     this.az.Add(this.am);
     this.an = new ei(this.g, this.p);
     this.az.Add(this.an);
     this.ao = new ca(this.x, this.an);
     this.az.Add(this.ao);
     this.ap = new cr(this.ay);
     this.az.Add(this.ap);
     this.aq = new bp();
     this.az.Add(this.aq);
     this.ar = new ay(this.p);
     this.az.Add(this.ar);
     this.@as = new h();
     this.az.Add(this.@as);
     this.at = new du();
     this.az.Add(this.at);
     this.au = new ac();
     this.az.Add(this.au);
     this.ag = new cc();
     this.az.Add(this.ag);
 }
예제 #6
0
 BinaryUpdate(ar, OldValue, NewValue,
              System.Array.BinarySearch(ar, OldValue),
예제 #7
0
 return new UFix(ar / b._value, 
예제 #8
0
        private static void CrearTicketExpo(Entidades.Sesion Sesion, out LoginTicket ticket, out ar.gov.afip.wsw.Service objWS, out ar.gov.afip.wsfexv1.Service objWSFEXV1)
        {
            string RutaCertificado = "";
            ticket = new LoginTicket();

            DB.Ticket ticketDB = new DB.Ticket(Sesion);
            bool SolicitarTicket = false;

            if (Sesion.Ticket == null)
            {
                if (Sesion.Cuit.UsaCertificadoAFIPPropio)
                {
                    Sesion.Ticket = ticketDB.Leer(Sesion.Cuit.Nro, TipoServicios.FacturaEX);
                }
                else
                {
                    Sesion.Ticket = ticketDB.Leer("30710015062", TipoServicios.FacturaEX);
                }
            }
            else
            {
                if (Sesion.Ticket.Cuit != Sesion.Cuit.Nro || Sesion.Ticket.Service != TipoServicios.FacturaEX)
                {
                    if (Sesion.Cuit.UsaCertificadoAFIPPropio)
                    {
                        Sesion.Ticket = ticketDB.Leer(Sesion.Cuit.Nro, TipoServicios.FacturaEX);
                    }
                    else
                    {
                        if (Sesion.Ticket.Cuit != "30710015062")
                        {
                            Sesion.Ticket = ticketDB.Leer("30710015062", TipoServicios.FacturaEX);
                        }
                    }
                }
            }
            if (Sesion.Ticket.Cuit == null)
            {
                SolicitarTicket = true;
            }
            else if (Convert.ToInt64(Sesion.Ticket.ExpirationTime.ToString("yyyyMMddHHmmss")) <= Convert.ToInt64(DateTime.Now.ToString("yyyyMMddHHmmss")))
            {
                SolicitarTicket = true;
            }
            else
            {
                ticket.ObjAutorizacionfexv1 = new ar.gov.afip.wsfexv1.ClsFEXAuthRequest();
                ticket.ObjAutorizacionfexv1.Cuit = Convert.ToInt64(Sesion.Cuit.Nro);
                ticket.ObjAutorizacionfexv1.Sign = Sesion.Ticket.Sign;
                ticket.ObjAutorizacionfexv1.Token = Sesion.Ticket.Token;
            }

            if (SolicitarTicket)
            {
                ticket = new LoginTicket();
                if (Sesion.Cuit.UsaCertificadoAFIPPropio)
                {
                    RutaCertificado = System.Web.HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["RutaCertificadoAFIP"] + Sesion.Cuit.Nro + ".p12");
                }
                else
                {
                    RutaCertificado = System.Web.HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["RutaCertificadoAFIP"] + Convert.ToInt64("30710015062") + ".p12");
                }
                ticket.ObtenerTicket(RutaCertificado, Convert.ToInt64(Sesion.Cuit.Nro), "wsfex");

                //Guardar Ticket de AFIP
                Sesion.Ticket = new Entidades.Ticket();
                Sesion.Ticket.Cuit = ticket.ObjAutorizacionfev1.Cuit.ToString().Trim();
                Sesion.Ticket.Service = ticket.Service;
                Sesion.Ticket.UniqueId = ticket.UniqueId.ToString().Trim();
                Sesion.Ticket.GenerationTime = ticket.GenerationTime;
                Sesion.Ticket.ExpirationTime = ticket.ExpirationTime;
                Sesion.Ticket.Sign = ticket.Sign;
                Sesion.Ticket.Token = ticket.Token;
                ticketDB.Modificar(Sesion.Ticket);

                SolicitarTicket = false;
            }
            objWS = new ar.gov.afip.wsw.Service();
            objWS.Url = System.Configuration.ConfigurationManager.AppSettings["ar_gov_afip_wsw_Service"];
            objWS.Proxy = ticket.Wp;
            objWSFEXV1 = new ar.gov.afip.wsfexv1.Service();
            objWSFEXV1.Url = System.Configuration.ConfigurationManager.AppSettings["ar_gov_afip_wsfexv1_Service"];
            objWSFEXV1.Proxy = ticket.Wp;
        }
예제 #9
0
 _ => VisitUnknowEventChunkType(ar, eventInfo)
예제 #10
0
 "fortBenchEvent" => VisitFortBenchEvent(ar, eventInfo),
예제 #11
0
 "PlayerStateEncryptionKey" => VisitPlayerStateEncryptionKey(ar, eventInfo),
 "fortBenchEvent" => VisitFortBenchEvent(ar, eventInfo),
예제 #12
0
 "AthenaReplayBrowserEvents" => VisitAthenaReplayBrowserEvents(ar, eventInfo),
 "PlayerStateEncryptionKey" => VisitPlayerStateEncryptionKey(ar, eventInfo),
예제 #13
0
 "playerElim" => VisitPlayerElimChunk(ar, eventInfo),
 "AthenaMatchStats" => VisitAthenaMatchStats(eventInfo),
예제 #14
0
파일: UFix.cs 프로젝트: cephdon/systemsharp
 return(new UFix(ar / b._value,
예제 #15
0
 public static void SerializarCExpo(out string LoteXML, ar.gov.afip.wsfexv1.ClsFEXRequest Lc)
 {
     //Serializar ( pasar de FeaEntidades.InterFacturas.lote_comprobantes a string XML )
     MemoryStream ms = new MemoryStream();
     XmlTextWriter writer = new XmlTextWriter(ms, System.Text.Encoding.GetEncoding("ISO-8859-1"));
     System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(Lc.GetType());
     x.Serialize(writer, Lc);
     ms = (MemoryStream)writer.BaseStream;
     LoteXML = ByteArrayToString(ms.ToArray());
     ms.Close();
     ms = null;
 }
예제 #16
0
        private static void Main(string[] args)
        {
            var allUsers = ReadUsers("users.json");
            var allPosts = ReadPosts("posts.json");

            // 1 - find all users having email ending with ".net".
            var users1 = from u in allUsers
                         where u.Email.EndsWith(".net")
                         select u;

            var users2 = allUsers.Where(x => x.Email.EndsWith(".net"));

            var emails = allUsers.Select(x => x.Email).ToList();

            // 2 - find all posts for users having email ending with ".net".

            var postsUserEndingInNet = from p in allPosts
                                       join u in allUsers
                                       on p.UserId equals u.Id
                                       where u.Email.EndsWith(".net")
                                       select new
            {
                u.Name,
                u.Email,
                p.Id,
                p.Title,
                p.Body
            };

            Console.WriteLine("Posts of users with email ending in .net");
            foreach (var p in postsUserEndingInNet)
            {
                Console.WriteLine("===========================================");
                Console.WriteLine($"Username: {p.Name}");
                Console.WriteLine($"Email: {p.Email}");
                Console.WriteLine($"PostID: {p.Id}");
                Console.WriteLine($"Post Title: {p.Title}");
                Console.WriteLine("===========================================");
                Console.WriteLine($"{p.Body}");
                Console.WriteLine();
            }

            // 3 - print number of posts for each user.

            var result = allPosts.GroupBy(p => p.UserId)
                         .Select(g => new
            {
                UserId        = g.Key,
                NumberOfPosts = g.Count()
            });

            foreach (var x in result)
            {
                Console.WriteLine($"UID: {x.UserId}");
                Console.WriteLine($"POSTS: {x.NumberOfPosts}");
            }



            // 4 - find all users that have lat and long negative.

            Console.WriteLine("Users with negative long and lat");
            var userslatlongneg = from user in allUsers
                                  where user.Address.Geo.Lat[0] == '-' && user.Address.Geo.Lng[0] == '-'
                                  select user;

            foreach (var user in userslatlongneg)
            {
                Console.WriteLine(user.Name);
                Console.WriteLine(user.Address.Geo.Lat);
                Console.WriteLine(user.Address.Geo.Lng);
            }

            // 5 - find the post with longest body.
            var longestpost = from p in allPosts
                              orderby p.Body.Length descending
                              select p;

            Console.WriteLine("Longest Post");
            var thelongestpost = longestpost.First();

            Console.WriteLine($"POST ID: {thelongestpost.Id}");
            Console.WriteLine(thelongestpost.Body);



            // 6 - print the name of the employee that have post with longest body.

            var employeeWithLongestBody = from p in allPosts
                                          join u in allUsers
                                          on p.UserId equals u.Id
                                          orderby p.Body.Length descending
                                          select new
            {
                u.Name,
                u.Email,
                p.Id,
                p.Title,
                p.Body
            };

            Console.WriteLine("EMPLOYEE WITH LONGEST POST:");
            Console.WriteLine(employeeWithLongestBody.First().Name);

            // 7 - select all addresses in a new List<Address>. print the list.

            IEnumerable <Address> addresses = new List <Address>();

            addresses = from address in allUsers
                        select address.Address;

            Console.WriteLine("LIST OF ADDRESSES:");
            foreach (Address address in addresses)
            {
                Console.WriteLine("===============================");
                Console.WriteLine($"City: {address.City}");
                Console.WriteLine($"Street: {address.Street}");
                Console.WriteLine($"Suite: {address.Suite}");
                Console.WriteLine($"ZIP: {address.Zipcode}");
                Console.WriteLine();
            }


            // 8 - print the employee with min lat
            var employeeMinLat = from u in allUsers
                                 orderby u.Address.Geo.Lat
                                 select u;


            Console.WriteLine("Employee Minimum lat");
            Console.WriteLine(employeeMinLat.First().Name);
            Console.WriteLine(employeeMinLat.First().Address.Geo.Lat);



            // 9 - print the user with max long

            var employeeMaxLong = from u in allUsers
                                  orderby u.Address.Geo.Lng descending
                                  select u;


            Console.WriteLine("Employee MAX LNG");
            Console.WriteLine(employeeMaxLong.First().Name);
            Console.WriteLine(employeeMaxLong.First().Address.Geo.Lng);


            // 10 - create a new class: public class UserPosts { public User User {get; set}; public List<Post> Posts {get; set} }
            //    - create a new list: List<UserPosts>
            //    - insert in this list each user with his posts only

            Console.WriteLine("USER POSTS");
            var list = new List <UserPosts>();

            foreach (var user in allUsers)
            {
                list.Add(new UserPosts
                {
                    User  = user,
                    Posts = allPosts.Where(p => p.UserId == user.Id).ToList()
                });
            }

            foreach (var u in list)
            {
                Console.WriteLine($"{u.User.Name}'s POSTS:");
                foreach (var p in u.Posts)
                {
                    Console.WriteLine("=============================");
                    Console.WriteLine($"PID: {p.Id}");
                    Console.WriteLine($"Post title: {p.Title}");
                    Console.WriteLine("--------------");
                    Console.WriteLine(p.Body);
                }
            }

            // 11 - order users by zip code
            var usersbyzip = from user in allUsers
                             orderby user.Address.Zipcode
                             select user;

            Console.WriteLine("USERS BY ZIP: ");
            foreach (var user in usersbyzip)
            {
                Console.WriteLine(user.Name);
                Console.WriteLine(user.Address.Zipcode);
                Console.WriteLine();
            }



            // 12 - order users by number of posts
            ar  first10Posts = allPosts.Take(10).ToList();
            var next10Posts  = allPosts.Skip(10).Take(10).ToList();

            foreach (var p in first10Posts)
            {
                Console.WriteLine("=============================");
                Console.WriteLine($"PID: {p.Id}");
                Console.WriteLine($"Post title: {p.Title}");
                Console.WriteLine("--------------");
                Console.WriteLine(p.Body);
            }

            foreach (var p in first10Posts)
            {
                Console.WriteLine("=============================");
                Console.WriteLine($"PID: {p.Id}");
                Console.WriteLine($"Post title: {p.Title}");
                Console.WriteLine("--------------");
                Console.WriteLine(p.Body);
            }
        }
예제 #17
0
        public static bool PopulateArFromFile(this tsEntities db, string fileName)
        {
            try
            {
                string[] lines = File.ReadAllLines(fileName);

                Debug.WriteLine(fileName);
                for (int i = 0; i < lines.Length; i++)
                {
                    Debug.WriteLine(i.ToString() + lines[i]);
                    if (lines[i].Trim().Contains("-"))
                    {
                        ar       a  = new ar();
                        string[] sy = lines[i].Split('-');
                        a.rt = sy[0].Trim();

                        if (a.rt.Trim() == string.Empty)
                        {
                            int lll = 0;
                        }
                        a.ex = sy[1].Trim();
                        i++; i++;

                        double pr = 0;
                        if (!double.TryParse(lines[i], out pr))
                        {
                            pr = 0;
                        }
                        i++;

                        pr p = new pr();
                        p.rt    = a.rt;
                        p.ex    = a.ex;
                        p.price = pr;

                        try
                        {
                            pr pd = db.prs.SingleOrDefault(p1 => (p1.rt.Trim() == p.rt.Trim() && p1.ex.Trim() == p.ex.Trim()));
                            if (pd == null)
                            {
                                db.prs.Add(p);
                                db.SaveChanges();
                                db.RefreshDatabase(p);
                            }
                            else
                            {
                                //pd.price = p.price;
                                //db.SaveChanges();
                                //db.RefreshDatabase(pd);
                            }
                        }
                        catch (Exception ex)
                        {
                            Debug.WriteLine(ex.ToString());
                        }

                        double ht = 0;
                        if (!double.TryParse(lines[i], out ht))
                        {
                            ht = 0;
                        }
                        i++;
                        a.ht = ht;

                        double lt = 0;
                        if (!double.TryParse(lines[i], out lt))
                        {
                            lt = 0;
                        }
                        i++;
                        a.lt = lt;

                        double met = 0;
                        if (!double.TryParse(lines[i], out met))
                        {
                            met = 0;
                        }
                        i++;
                        a.met = met;

                        double mdt = 0;
                        if (!double.TryParse(lines[i], out mdt))
                        {
                            mdt = 0;
                        }

                        a.mdt = mdt;
                        try
                        {
                            ar ad = db.ars.SingleOrDefault(p1 => (p1.rt.Trim() == p.rt.Trim() && p1.ex.Trim() == p.ex.Trim()));
                            if (ad == null)
                            {
                                db.ars.Add(a);
                                db.SaveChanges();
                                db.RefreshDatabase(a);
                            }
                            else
                            {
                                ad.ht  = a.ht;
                                ad.lt  = a.lt;
                                ad.met = a.met;
                                ad.mdt = a.mdt;
                                db.SaveChanges();
                                db.RefreshDatabase(ad);
                            }
                        }
                        catch (Exception ex)
                        {
                            Debug.WriteLine(ex.ToString());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
            }



            return(true);
        }