• Breaking News

    Saturday, February 5, 2022

    C# Reflection - How to get every information about each constructor and type it down ? Ask Programming

    C# Reflection - How to get every information about each constructor and type it down ? Ask Programming


    C# Reflection - How to get every information about each constructor and type it down ?

    Posted: 05 Feb 2022 12:37 AM PST

    Hello,

    I was trying to type down all the info about each of the constructors in my class named Cookie to a console.

    This is one of the constructors :

    public Cookie(string name, string? value) { } 

    I found this on the internet :

     ConstructorInfo[] constructorInfo = cookieType.GetConstructors(); foreach (System.Reflection.ConstructorInfo detail in constructorInfo) { Console.WriteLine(detail); } 

    Its nice, but it returns this : Void .ctor(System.String, System.String)

    I can get the Cookie from type.Name, how can I get constructor access modifier and for example string name instead of System.String ?

    Also I want to type down properties and methods, I think I am supposed to use medatada somehow. Any ideas ? Thanks :)

    submitted by /u/David39578
    [link] [comments]

    What's the easiest ML/AI APi /Framework to learn/use? Is there something that doesn't have a steep learning curve?

    Posted: 04 Feb 2022 08:52 PM PST

    I've tried to wrap my head around Tensorflow and other popular ML/AI frameworks, but outside of the hello world of ML (the digits ocr example) everything else seems like you need a PHD in vector math and all sorts of mathematical concepts just to classify your. Cat pics. Is there a simpler tool that abstracts as.much as possible?

    submitted by /u/abrandis
    [link] [comments]

    Take a specific element from an ArrayList and use it to initialize another ArrayList

    Posted: 04 Feb 2022 08:57 PM PST

    Hey everyone,

    So I'm trying to take an element from an ArrayList and use that to initialize another ArrayList. I'm making a Blackjack game, and I'm trying to make two ArrayLists in the event that the user splits. So the ArrayList for the first split would use the first card in the user's initial Array Hand, then the ArrayList for the second split would use the second card in the user's initial Array Hand. I've tried just directly adding the ArrayList element, but I keep getting the following error: "java.lang.NullPointerException: Cannot invoke "java.util.ArrayList.add(Object)" because "userHandSplit1.handArray" is null"

    I'd appreciate any advice! Thanks!

    Code: https://pastebin.com/n1VVDB0m

    submitted by /u/dwlakes
    [link] [comments]

    web scrapingIs there a way to webscrape data using the details of under Inspect -> Network? Example in post.

    Posted: 05 Feb 2022 12:21 AM PST

    Hi All,

    Usually I'm pretty good with googling solutions, but for this problem I don't even know what to search up.

    Basically I'm trying to webscrape data from a website that uses Javascript to update their page. I specifically want to avoid Selenium due to performance issues.

    I'm using Australia's NSW Rego check as an example (https://my.service.nsw.gov.au/MyServiceNSW/index#/rms/freeRegoCheck/details). If you provide a valid NSW car rego number, it will give you the details for the car and the insurer.

    This link shows the box where you enter the Rego Number. EBY60D is just a random car plate used for this example

    https://imgur.com/ggnqO0f

    My understanding is that the website then makes an API call to the database which fetches the details and returns it to the web browser. I'm thinking that if I can get the request url, headers and parameters used in making that call, I can get the details in a python script thats fairly optimised.

    Below is the item "apexremote" within inspect -> element which contains all the details of the car, you can see the details of interest under the PreviewTab

    https://imgur.com/S11vrdk

    The request URL is https://my.service.nsw.gov.au/MyServiceNSW/apexremote with a bunch of requests headers.

    https://imgur.com/iOq7TKd

    I'm completely lost here, where are the details of the car rego plate "EBY60D" being requested to the request URL. How do I go from the request URL to get the json response containing all the details of the vehicle. Any help is appreciated, even letting me know what to search in google to find more relevant results.

    Thanks

    submitted by /u/Phobicity
    [link] [comments]

    Hello, I need some help with a project I'm working on but the code is too long to type out. Can I dm someone for help?

    Posted: 04 Feb 2022 11:19 PM PST

    what is the best self-promotion practice and environment?

    Posted: 04 Feb 2022 10:47 PM PST

    some times self open source project need to promote but where and how to do. let's share you ideas to know the best websites, communities and how to create nice promoting post to keep eyes in that.

    submitted by /u/alguerocode
    [link] [comments]

    Trying to download a PDF in Vue but I can only get it to push a download if I href the file

    Posted: 04 Feb 2022 09:45 PM PST

    I don't fully understand why this is happening but I'm trying to hit my API to download a `application/pdf` when I try and Axios the endpoint it won't actually "download" the but when I actually a href to the endpoint it will. Is there something that I'm missing that would allow axios to download the pdf?

    submitted by /u/Character-Cat-5716
    [link] [comments]

    How much time do mobile devs spend on version updates?

    Posted: 04 Feb 2022 08:57 PM PST

    Has anybody come across a specific estimate they can share? I can find a lot of resources on how much time developers spend on general maintenance or tech debt, but I was interested in specifically how much effort goes into making sure an app works when a new Android/iOS SDK drops (off the top of my head, there will be a lot of regression testing, for example).

    submitted by /u/trexofwanting
    [link] [comments]

    Find solution without brute force? Help.

    Posted: 04 Feb 2022 08:40 PM PST

    I have the following problem and I am looking for some input what I should search for to get some answers or solution.

    I have a list of 30 values. If I press a button 3 defined values will either increase or decrease by a defined amount. There are multiple buttons (let's say 60). The goal is to get all values to 0. How do I find the best button combination (least amount of buttons) without trying every single possible combination.

    Is there a commonly known similar problem? Not looking for the exact solution but some ideas where I would find more information.

    submitted by /u/D4ngerD
    [link] [comments]

    WEB APP DEVELOPMENT VS MOBILE APP DEVELOPMENT

    Posted: 04 Feb 2022 08:05 PM PST

    a follow up post to my last post here, as most of the guys told me to go for web app instead of desktop app for developing a fitness using a c#. But for the final semester i only have 3 months to develop it while studying and getting busy on other things as well. Web app seems though, how easy is it to develop mobile app in comparison to a web app? And while developing mobile app, will it will be cross platforms? What are the c# frameworks for it ? I found xamarin and in xamarin when i develop a app will it be cross platform or i have to choose one platform specifically like ios or android?

    submitted by /u/HandDizzy
    [link] [comments]

    [C#] Access to path denied - unhandled exception

    Posted: 04 Feb 2022 02:50 PM PST

    I have some small C# WinForms app that I did for a friend. There is a point in app in which txt file is created and saved on desktop. Now, it's working for me, and it's working for my friend, but my friend has to install that app on few other peoples PCs and one of them got Access to path denied error when file was beeing created. I can't reproduce the error since its working for me on my 2 PCs so I don't know how to fix it. Is it some windows premissions thing? Can I put some access controls?
    I'm using .NET 6.

    Here's the code that writes to a file:

    private void SaveResultFile() { string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "someFile.txt"); using var writer = new StreamWriter(path); writer.WriteLine("Some text 1"); writer.WriteLine("Some text 2"); writer.WriteLine(Environment.NewLine); writer.WriteLine("Some text 3"); } 
    submitted by /u/iPopay
    [link] [comments]

    Where do you store your keys/certificates?

    Posted: 04 Feb 2022 06:35 PM PST

    I know is a bad practice to store any sort of key in source control.
    But what about if is a personal private repo? Do you trust github/gitlab to store your keys there?

    And in the case of a public one, do you store your keys only on your local? Maybe an external drive.
    Or do you upload them somewhere? I was thinking about using my Google drive and wrapping my keys in an encrypted zip/7z.

    submitted by /u/pe1uca
    [link] [comments]

    Question about pulling thousands of links to tiktoktv.com

    Posted: 04 Feb 2022 05:30 PM PST

    I have a small python script ( i can post below) that takes my downloaded TikTok data and parses the date and link for every video I've ever watched into two lists. One for dates and one for the link. There's about 71000 entries in the list. Can the list handle this much data?

    Secondly I'd like to take this link and date and access each in order with a next button that loads the next video. i only know about webbrowser() in python. I'd like to avoid javascript as i dont have experience with file access in js.

    Additionally I've wrote scripts in the past that would enumerate the lightshot website and scrape every image. They banned me for suspected ddosing. Would TikTok be likely to do the same for requesting so many links? How could I avoid this without time.sleep calls.

    submitted by /u/teethingrooster
    [link] [comments]

    How to improve mobile app and server data synchronization?

    Posted: 04 Feb 2022 04:17 PM PST

    Hi, I hope this is the right place to ask such question. I've been a developer for a bit more than year and currently I'm working on a system where there is a server which host a website and a mobile app which has some of the website functionalities.

    I won't go into the details of the features but basically the website allows users with the right roles to manage other users, which can see their data from the mobile app. They can also use the website but ofc if they haven't the right role, they can only manage their own data.For this reason the mobile app and the server must be synched and the mobile app has to work offline, so it has it's own database. When it goes online, it has to send the new data to the server, the server eventually resolves conflicts and send back the result of such operation.Now since my limited experience, this system is based on the mobile app to connect with the server and use rest apis to exchange data.

    For now what ensure the correct saving of data in both the app and the server is a timestamp of the last synchronization, thanks to how db transactions works, if something goes down, the next time the mobile app will try to synchronize again from the last successfull synchronization and onwards.

    What are the steps i can take/topics i should read about to improve this system and eventually make it scalable? To ensure data is correct etc?

    It's third party stuff like RabbitMq used for this kind of systems? Or any improvement without external dependencies that you can suggest me?

    Thanks a lot!

    submitted by /u/KevinTrevigiano
    [link] [comments]

    How does this piece of PHP (WP) code translates to "regular" looking PHP?

    Posted: 04 Feb 2022 02:30 PM PST

     <?php while ( have_posts() ) : the_post(); ?> <?php endwhile; ?> 

    Is it

     <?php while ( have_posts() ){ the_post(); } ?> 
    submitted by /u/adastrasemper
    [link] [comments]

    If SMS is free, why do we need to pay for SMS services like Twilio

    Posted: 04 Feb 2022 02:27 PM PST

    I don't know where else to ask this so if you can recommend a better subreddit, please do.

    Services like Twilio requires you to rent a phone number for $1.00/month so that it can send out SMS for something like $0.0025/message. Why can't we just use our mobile device number to send SMS programmatically?

    submitted by /u/eggtart_prince
    [link] [comments]

    No comments:

    Post a Comment