• Breaking News

    Sunday, July 12, 2020

    Save Which Languages? Ask Programming

    Save Which Languages? Ask Programming


    Save Which Languages?

    Posted: 12 Jul 2020 06:34 PM PDT

    You decide to finally quit smoking and really do it this time. You get home and have the last one in your pack, really savoring it. When it's done, you say goodbye, and you flick it away while promising that you'll never forget the good times. You can't bother yourself anymore with whether or not it's hurt by your decision to walk away.

    You go inside and lay down on the couch. It's been a long day and you fall asleep without realizing, which is why it's such a surprise to wake up to find your house on fire as though no time had passed. Based on where it's coming from, you know it's your fault; it hadn't rained in days, and the cigarette caught on thirsty twigs and leaves.

    "A fitting end," you say aloud.

    You rush into your office to grab what you can. You have hundreds of boxes stacked to the ceiling, each one containing a different programming language. You know that you can grab three of them safely, but any more and you risk tripping and losing them all, and likely your own life.

    What three do you grab, and why?

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

    [HTML/jQuery] Can't get CORS to play nice to pull a local file. Surprise?

    Posted: 12 Jul 2020 09:41 PM PDT

    I didn't see any rules or guidelines for posting to this subreddit specifically, so I'm just spitballing with charm and class.

    I'm working on a script for mIRC that can create HTML files that read data from my PC, with the end-goal being to make a Number Counter displayable through the "Browser Source" option of OBS or similar for use with Twitch streaming. Basically, I just need some functional HTML code, and then I can tell mIRC to re-create the whole thing, replacing key parts for user-customization.

    This code is going to be shared with the internet, so I prefer not to use any redneck fixes such as "Just disable your local CORS."

    Here is my current HTML code, with calls to jQuery. Literally everything works except for CORS rearing its ugly head.

    <html> <head> <!---- Load a font from Google. ----> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bangers"> <!---- Enable jQuery for all of your JavaScript needs. ----> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <!---- Center the Counter's and the Icon's divs in the middle of the webpage, and format the Counter's text. ----> <style> .counterDiv { color: Black; font-family: "Bangers"; font-size: 64px; -webkit-text-stroke-width: 2px; -webkit-text-stroke-color: white; margin: 0; position: absolute; top: 50%; transform: translateY(-50%); float: left; padding: 64px; } .iconDiv { margin: 0; position: absolute; top: 50%; transform: translateY(-50%); float: left; } </style> <!---- This block is simply to identify where the Divs are. It's temporary, and I ripped it straight from the internet. ----> <script type="text/javascript"> $(document).ready(function(){ $("div").css("border", "3px solid red"); }); </script> </head> <body> <!---- Pull the image for the Counter and place in a container. ----> <div class="iconDiv" id="icon"> <img src="Icon.png" /> </div> <!---- Create a container to hold the Counter value ----> <div class="counterDiv" id="counter"> </div> <!---- Update the "counter" div every second by replacing its current value with text from "counter.txt", a local file ----> <script type="text/javascript"> <!---- Define function "doRefresh" to replace the "counter" div's content. ----> function doRefresh() { <!---- Pull data from "counter.txt" to place into the "counter" div. ----> <!---- Also give CORS a heart attack. ----> $("#counter").load("counter.txt"); } <!---- Start the function "doRefresh" to activate every second. ----> $(document).ready(function(){ setInterval( doRefresh, 1000 ); }); </script> </body> </html> 

    I've tried to implement a sort of "proxy", if that is the appropriate word, with JavaScript code from Medium, but apparently I'm not smart enough to implement it.

    I have tried using their JavaScript to disable CORS, but loading the file causes my browser to emit even more errors, such as undefined functions or variables, which I have no idea how to fix.

    I am a total novice when it comes to HTML and jQuery. The last time I touched HTML/CSS was about seven years ago when I literally made a few HTML files link to each other and share a single CSS. I've never once looked at JavaScript.

    I have tried to find the answer on the web, but nothing is on my level of understanding, even the one post I found on this same subreddit that previously deals with CORS.

    Any help and all suggestions will be read. Thank you greatly for your assistance.

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

    Asking for assistance

    Posted: 12 Jul 2020 09:22 PM PDT

    Hey guys Was kindly asking for free links where I can learn data structures and algorithms in java..

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

    Program compile in my pc but not in my Professor Pc

    Posted: 12 Jul 2020 03:29 AM PDT

    Hi everyone! I'm a student of electronic engineer. During this semester we had to do a project which consisted in building a Database in C++. We were asked to use Clion for writing code. Me and my team did everything within the time limit. We tested our programs and we optimized it as much as we could. Anyway, it was responsive to all the request made by our Prof. I've attended the exam, passed it, and the week after we sent our project for evaluation. Yesterday we get an email from our prof which says that the project totalize 0 pt because he couldn't even compile it. With 0 in project you automatically fail the exam. So he told us that we will have to undergo an oral exam about all of course's program. I've replied to him asking for clarification and by sending him videos of the program compiling and running on my pc. He haven't explained to us what the problem may be, he simply stated that it doesn't compile on his pc so automatically failed (I'm from Italy, so with Covid and quarantine we can't go to school for attending exams, everything is done from home). I've send the file to some friends of mine asking them to download Clion and try my program. It compiles. Our prof has already decided to make us attend oral exam. But I would really like to know what the problem may be because I really can't get to the end of it.

    If you need anything I can provide it to you! Thank you, and have a nice day!

    p.s. sorry for any grammar mistake, not english native

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

    How does electron port Chrome's networking library into NodeJS?

    Posted: 12 Jul 2020 10:04 PM PDT

    In electron, there's a net module that you can use to make requests like chrome. They do not use XMLHttp or fetch. How did they do this? I know chromium is open sourced, but not sure how they made the networking library usable. Main reason I want to know if for browser finger printing, and trying to make my requests seem more chrome like.

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

    What's the bird's eye view of web development? What role do all the different products/frameworks play?

    Posted: 12 Jul 2020 08:20 PM PDT

    I have a lot of experience programming for engineering where I'm just trying to get some numbers, but I've never built any sort of application. I'm helping build one now for some data collection stuff and I'm kind of lost on what all the different pieces mean. I can look at a chart like this and it kind of helps, but I'm still mostly lost. What are the different pieces of web application design?

    What is React and does it replace or augment HTML/CSS? What is NodeJS and what kind of data does it carry? Where is the line between front end and back end, and why are there like three different databases? Do I need to use SQL? Why do I feel like Javascript hates me personally?

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

    [Python] For a ProjectEuler question I got the wrong answer and am comparing my code to the solution code and can't figure out why the answer is different. Code is below.

    Posted: 12 Jul 2020 01:43 PM PDT

    The goal of the code is to find the sum of all multiples of 3 and 5 under 1000 (natural numbers, so starting from 1).

    My code:

    sum_of_3 = 0 sum_of_5 = 0 for a in range (0, 1000, 3): sum_of_3 += a print(sum_of_3) 

    Output: 166833

    for b in range (0, 1000, 5) sum_of_5 += b print (sum_of_5) 

    Output: 99500

    total_sum = sum_of_3 + sum_of_5 print (total_sum) 

    Output: 266333

    My output is wrong. The correct code and output is:

    nums = range (1, 1000) sumofmultiples = 0 for i in nums: if i % 3 == 0 or i % 5 == 0: sumofmultiples = i + sumofmultiples print (sumofmultiples) 

    Output: 233168

    Why am I getting a different answer?

    submitted by /u/G-Fieri
    [link] [comments]

    VST question

    Posted: 12 Jul 2020 06:30 PM PDT

    Hey everyone! I don't know if this is the right sub or not, if not please remove and or help me find the right sub! Thank you:)

    I'm a dreamer, like many of you. Unlike many of you, I'm not talented in code what so ever.

    So here is my dumb question;

    I seperated my touchscreen from my old laptop, and I want to make a oscilloscope like VST for me to run on a Mac.

    So heres the plan, a visualizer for whatever my DAW inputs, while also being able to control it as a EQ (most likely physical controls) and possibly other options for me to manipulate the sound.

    My question is, how hard would this be to make? And if I decide to have someone write this program for me, how much can I expect to pay?

    Thank you for your imput!

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

    Whats the cheapest non-preemptive cloud GPU rental per time, regardless of its speed?

    Posted: 12 Jul 2020 10:32 AM PDT

    I have some experiments in multiplayer games to do that could each use a small gpu running continuously for a long time so I dont want to pay $180/month for each of them and underuse their GPU power.

    The problem with running many experiments at once on the same GPU is they are optimized for doing 1 thing at a time many times in parallel and have limits on the number of calls per second.

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

    Android script

    Posted: 12 Jul 2020 05:59 PM PDT

    I've been looking for a script or macro that will continuously hold down a part of the screen as if I was pressing it but all I can find are auto clicker, anyone got any suggestions?

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

    Algorithms and data structures in SQL (or relational algebra)?

    Posted: 12 Jul 2020 04:18 PM PDT

    [Python] Watching a video on for loops. Am confused with syntax she hasn't mentioned before.

    Posted: 12 Jul 2020 12:35 PM PDT

    Her loop looks like this:

    mysum = 0 for i in range(7,10): mysum += i print(mysum) 

    My question is, what does the "+=" mean?

    submitted by /u/G-Fieri
    [link] [comments]

    Best way to build a crossplattform app around a database

    Posted: 12 Jul 2020 08:25 AM PDT

    Hello everyone!

    Im a musician and I want to build an app where I can track my practice goals. Basically its only writing some data into a database. Ive started to learn swift, but then I realized that there are cross plattform solutions and maybe there's a way to do it more efficient. I would like to access the data from different devices (ios, android and web browser). I already read a lot of articles about firebase, budibase, xamarin (I started programming in C#) and so on, but Im a little bit confused now. What would be the best way to realise that? Nothing fancy, only accessing an sql database, without programming different apps in different languages.

    Thank you very much!

    regards Dennis

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

    When is using a C++ addon in Node.js good or bad idea?

    Posted: 12 Jul 2020 11:07 AM PDT

    I'm working on a Node.js algo trading bot; I'm not sure of the best way to store a copy of the entire Coinbase Pro limit order book the way I'd like to. Ideally, I want to keep it in a map that is self sorted. Each time an order is placed on the exchange a message is sent through their websocket feed. I'm only keeping the order_id (key) and the {price: number, size: number} (value) in two maps--one for bids, one for asks.

    I was thinking I could write an OrderBook C++ class, call the constructor in the .js file and send each received WebSocket message to a wrapped C++ function from js that would add/remove orders to/from the OrderBook. Does anyone have experience doing something like this?

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

    14M, getting a chance to meet a successful programmer soon. What questions shoud I ask?

    Posted: 12 Jul 2020 10:20 AM PDT

    Hi, I'm 14 years old, and in a few hours I will probably be able to have a 40-50min discussion with a successful programmer.

    I am interested in the field of computer sciences, and am interested to pursue a career in it. My current knowledge of programming is very limited, but I am a quick learner and memorizer, all thanks to God.

    What questions should I ask her?

    Thank you for any input.

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

    Problems with the getline () in the for loop (C++)

    Posted: 12 Jul 2020 09:42 AM PDT

    Hi everyone, I have a little problem with the getline() in C++. In a nutshell, I put more getline() in a for but from the second loop the first for is skipped, passing directly to the second ... Here below is the piece of code of the for:

    for (int i = 0; i < N; i++)

    `{` `cout << "Libro numero " << i + 1 << "\nInserisci nome del libro: ";` `getline(cin, libro[i].titolo);` `cout << "Inserisci autore libro: ";` `getline(cin, libro[i].autore);` `cout << "Inserisci anno dell'edizione: ";` `cin >> libro[i].annoedizione;` `libro[i].prezzo = rand() % prezzomassimo + 1;` `cout << "Prezzo calcolato: " << libro[i].prezzo;` `file << libro[i].titolo << "\t" << libro[i].autore << "\t" << libro[i].annoedizione << "\t" << libro[i].prezzo << endl;` `media += (float)libro[i].prezzo;` `if (libro[i].prezzo > librocaro)` `{` `librocaro = libro[i].prezzo;` `librocaronome = libro[i].titolo;` `}` `if (libro[i].annoedizione < librovecchio)` `{` `librovecchio = libro[i].annoedizione;` `librovecchionome = libro[i].titolo;` `}` `cout << endl << endl;` `}` 

    What can I do?

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

    Responsive site as an app?

    Posted: 12 Jul 2020 09:39 AM PDT

    I have a very mobile friendly node app. It is used by schools and I'd love kids to find it in the App Store- without having to go to the .com but I don't see a need to make a full mobile app out of it. Can I take any shortcuts?

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

    How to store passwords for other accounts in your db

    Posted: 12 Jul 2020 05:52 AM PDT

    I'm wondering how could someone securely store creds for other accounts. For example: storing creds for website that i need to log in and scrape. (That website does not have API)

    The problem is that I couldn't just encrypt it because someone could easily decrypt it, I couldn't hash it because I need to retrieve it afterwards.

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

    Which app would you want to be available?

    Posted: 12 Jul 2020 06:26 AM PDT

    [PHP/jQuery/MySQL] Dealing with automatic table refresh without interrupting what the user is doing.

    Posted: 12 Jul 2020 04:14 AM PDT

    Greetings. I began working on single page application sites just recently, pretty much self-taught myself HTML/PHP/jQuery.

    I'm currently working on an application for managing an auto repair shop, and I've managed to build editable tables. Pure jQuery application, double click and an input field is created in the cell ,allowing users to overwrite cell value then a checkbox is automatically ticked. An [update data] button is then used to scan for ticked boxes and the new data is updated in database, no problems so far.

    However, I plan on making these tables update every X amount of time, which is code-wise not difficult but I'm having problems dealing with the 'logistics' involved in this procedure. How would I deal with users who are currently in the middle of editing a cell value, or users who did change some values in the table but did not yet press the [update data] button. Refreshing the tables would technically ruin what they were doing. I tried looking into this topic but almost all questions are related to the 'live update' part, not the above-mentioned issues.

    I do appreciate your help.

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

    In which language should I start Competitive programming?

    Posted: 12 Jul 2020 02:26 AM PDT

    I want to start competitive programming but I am not sure which language should I choose. I have prior experience with C++ and a little bit of python but zero knowledge of Java. Should I stick to C++ or learn Java/python or any other suggestions?

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

    Should I study two things at once?

    Posted: 12 Jul 2020 01:55 AM PDT

    Hey, I am graduating this month finally (unfortunately not in CS nor any related field). I have been self-studying programming for a year now. I started out with web development and kept focusing on it till I realized that I know nothing about lower level stuff, the machine I'm working on, system APIs, memory management, CPUs, OSs, etc.

    So last month I decided I'll drop everything for a while and get my hands dirty with some C and algorithms and data structures. My plan was that I'd spend a long period of time building things in just C, maybe even dive into embedded systems for the sake of it, and I'll continue solving a lot of problems on Codewards and LeetCode. I did solve a lot of problems in JavaScript. However, I just found out that even the easiest problems for me in JavaScript are a huge pain in the a** for a beginner in C.

    Everything is going good and I'm on page 400 in Head First C. I also spend half of the studying period watching videos and reading about hardware and some circuits stuff. However, I miss the feeling of building a complete app. Providing that the next 3 months I'm going to have A LOT of free time (I have two WFH part-time jobs, they don't take much time of the day), so I thought it might be okay to do some web development at night. Am I gonna get confused if I started doing two things, one in the morning and one at night?

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

    How do I start learning Trees for competitive coding?

    Posted: 11 Jul 2020 11:12 PM PDT

    I am interested in competitive coding and want to learn Trees, the Data Structure. It would be of great help if you could suggest the topics and which order I should learn them. Thank you.

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

    No comments:

    Post a Comment