• Breaking News

    Tuesday, June 30, 2020

    On a daily basis I face dead times (compilation, regression testing, blocked by another devs, etc ). I have multiple projects, do you think is sane and efficient to work on the other projects on this time? Ask Programming

    On a daily basis I face dead times (compilation, regression testing, blocked by another devs, etc ). I have multiple projects, do you think is sane and efficient to work on the other projects on this time? Ask Programming


    On a daily basis I face dead times (compilation, regression testing, blocked by another devs, etc ). I have multiple projects, do you think is sane and efficient to work on the other projects on this time?

    Posted: 30 Jun 2020 11:07 AM PDT

    Lets says that between compilation and regression testing I have chunks of 15-20 minutes, but sometimes I feel that if I use those 15-20 minutes on the side projects I wont focus enough to make a real progress or when I go back to main project I wont be 100% focused (because I will be still thinking on how to fix stuff on the side project).

    Does anybody have an opinion or strategy for this ?

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

    Hi, I'm doing an english project and would really appreciate if you guys could answer me a few questions!

    Posted: 30 Jun 2020 03:08 PM PDT

    Hi, I'm a student and I need to ask a few questions for my interview project. Could you guys answer some questions for me? I would really appreciate it. Breaking anonymity is not required!

    1. Why and how did you choose programming as your career?
    2. How is your daily life like being a programmer?
    3. Does your career interfere with your personal life?
    4. Did quarantine affect your work? How?
    5. Do you consider programming your lifetime career?
    6. What are the easiest and hardest parts of being a programmer?

    Thank you very much!

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

    Node Js Algo Trading Bot: Stuck trying to sync live Websocket feed with data obtained from HTTP GET request

    Posted: 30 Jun 2020 09:09 PM PDT

    I'm attempting to keep a live order book using the Coinbase Pro API. So far I've been able to get the entire order book from a 'snapshot' using a method 'buildOrderBook' from the LiveOrderBook class I've made.

    buildOrderBook(snapshot) { for(let i = 0; i < snapshot.bids.length; i++) { this.addOrderForBook(snapshot.bids[i], this.bids); } for(let i = 0; i < snapshot.asks.length; i++) { this.addOrderForBook(snapshot.asks[i], this.asks); } this.setSequence(snapshot.sequence); }; 

    The problem is that when I run the program he buildOrderBook(result)'method always runs before the client starts receiving messages (line 12 in the block below). And, by the time the LiveOrderBook object called 'book' is built, messages are missed. This can be confirmed with the 'sequence' property sent in each message. Right now my order book is not properly maintained. This can be checked using sequence numbers. I need to ensure that I'm getting every message from the websocket starting with snapshot.sequence + 1.

    const client = require("./src/initClient")(channels); const restcli = client.rest; async function getOrderBookSnapshot() { console.log("Getting level " + level + " orderbook snapshot for: " + productId +" ..." ); let result = await restcli.product.getProductOrderBook(productId, {level}); //console.log(result); return result; } var book = new LiveOrderBook; // Listen to WebSocket channel updates client.ws.on(WebSocketEvent.ON_MESSAGE, message => { book.handleOrder(message); console.log(message); }); // Listen to WebSocket channel updates client.ws.on(WebSocketEvent.ON_ERROR, errorMessage => { // Receive message from WebSocket channel throw new Error(`${errorMessage.message}: ${errorMessage.reason}`); }); client.ws.on(WebSocketEvent.ON_OPEN, () => { client.ws.subscribe(channels); }); async function main() { const connection = async () => client.ws.connect(); await connection(); await getOrderBookSnapshot().then(function(result) { book.buildOrderBook(result); }); book.printBook(); } main(); 

    My solution was to change the LiveOrderBook class to include a static variable indicating whether or not the snapshot had been taken, and to include an array for messages that would need to be populated before requesting a snapshot. I could use these and the sequence numbers to check this in the buildOrderBook method like so:

    buildOrderBook(snapshot) { try { if(!LiveOrderBook.waiting[0] || (LiveOrderBook.waiting[LiveOrderBook.waiting.length - 1].sequence > snapshot.sequence + 1)) { setTimeout(this.buildOrderBook(), 100); } else { for(let i = 0; i < snapshot.bids.length; i++) { this.addOrderForBook(snapshot.bids[i], this.bids); } for(let i = 0; i < snapshot.asks.length; i++) { this.addOrderForBook(snapshot.asks[i], this.asks); } this.setSequence(snapshot.sequence); LiveOrderBook.bookinialized = true; for(let i = 0; i < LiveOrderBook.waiting.length; i++) { this.handleOrder(LiveOrderBook.waiting[i]); } } } catch (err) { setTimeout(this.buildOrderBook(), 100); } }; 

    I'm guessing using setTimeout isn't the way to go. Is this the problem with Node Js not being multithreading? Any help would be appreciated, I understand this is a lot.

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

    How can I Display CSV data in DataGridView in C++ with Winforms

    Posted: 30 Jun 2020 09:04 PM PDT

    Hello I am still a beginner, I have a college proyect where I need to read a csv file in a data gridview but I haven't found anything online on how to do it with C++ or not using sql. In this proyect I can't use mysql, only files to manage the data for the proyect . Thanks in advance

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

    I'm trying to learn arrays and I'm not sure how to apply labels when printing values in a 2-D array in a table format. I'm using C

    Posted: 30 Jun 2020 08:56 PM PDT

    How do you go about printing labels with the values?

    Using a table of student data as an example:

    StudentID English Math
    Martha 1001 90 78
    Steve 1002 89 69
    Alan 1003 70 87
    Mark 1004 76 91
    Jack 1005 85 82

    I've already got the headers down but I don't know how to get the names at the side while using a for loop to print the values stored in the array

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

    Will I still be able to animate math stuff when switching from JavaScript to python?

    Posted: 30 Jun 2020 03:21 AM PDT

    I want to do some basic stuff like animate a unit circle, some geometry etc. It's really just a visual aid for myself.

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

    Question About Word & Excel

    Posted: 30 Jun 2020 04:43 PM PDT

    Before I spend hours teaching myself VBA for nothing, I wanted to ask if it's even possible.

    Job: permitting facilities. I receive hard copy application form, have digital word document reference files, hard copy reference files, and excel spreadsheet calcs that run an iterative calculation, a cheat sheet checklist that has all info added to it, and an old and new permit document.

    Idea: add a few sheets to the iterative calc excel document, write VBA code to search a digital database for a specific code that it pulls from the document (initial manual entry is ok), then pulls info from those documents and auto fills the cheat sheet and calc spaces. In an ideal world, it would automatically run the goal/seek formula I use for the calcs, and print the answers to my spreadsheet and cheat sheet.

    That way I can manually enter the facility code (which is individual to facility, but has the same alpha numerical layout every time), it'll pre-populate info into pre-determined spaces pulled from digital word documents, then allow me to either manually calc the calc, or initiate a macro to run it, then fill the cheat sheet and print all pages to hard copy because fuck the environment we need file storage to be redundant.

    Anywho, that's my idea and I'm gonna try it regardless I just wondered how far the light in the tunnel was.

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

    What do I do now?

    Posted: 30 Jun 2020 02:17 PM PDT

    I spent 2019 learning how to make games in unity. Throughout this time I learned all the fundamentals off OOP to the point of objects and inheritance like the back of my hand. I realised game dev is not for me and I'm lost.

    Over the past few months I've tried everything from c++ to python and can always understand up to the point of inheritance and then can't figure out where to go next. Is it time I find a library or framework to learn that I'm interested in? Or is there more to learn? I feel I'm not good enough to work on something long term but also feel I'm not progressing. I'd like to stick to python and eventually get into ML. What to do?

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

    How many of you are (mostly) keyboard only?

    Posted: 30 Jun 2020 08:01 PM PDT

    I encontour people here and there that are phenomenal on a keyboard. Whether it's just cool or not, they seem to move faster especially when they know exactly what they want to do.

    I mostly work in c++ on a bigger project...so there's a lot of jumping file to file. Not just opening single files in Vim. I use visual studio, but also have visual studio code.

    Just currious to hear people's expierences that work like this and hear about how they work!

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

    Company stock management web app

    Posted: 30 Jun 2020 07:02 PM PDT

    Hello everyone :D

    as a part of one my college course i have to make a web app which will need to have both front and backend. Basic description of the webapp is that it should have a database list of all the employees and a list of all computer parts (monitors, pc/laptops, keyboards, mice, etc...) Every piece of equipment should have its manufacturer, model name, stock number, etc. listed as a description. App should also be able to assign equipment to an employee, and also be able to reverse that action when an employee returns the item back to the company. Do you have any tips on what stack to use when building this or some kind of a tutorial to follow and learn along? Thanks a lot for your answers!!

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

    C#

    Posted: 30 Jun 2020 06:55 PM PDT

    G'day!

    I have been learning C# for a while now (I'm still a beginner).

    The more I see what languages there are, and which are the best, the more I see I shouldn't have gone with C#.

    I'm into programming AI and machine learning. I didn't know C# isn't made for machine learning.

    With that being said, is it possible to do either of these things in a productive way? If not, what is C# good/meant for?

    Thank you for your help!

    P.S. I will learn another language once I'm proficient at C#. The reason I wouldn't like to switch now is because I already have. I briefly learned C++ but stopped after I realized it was borderline obsolete.

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

    Python vs JavaScript? fastest to employment (with no CS degree)

    Posted: 30 Jun 2020 06:45 PM PDT

    I'm just curious how the two compare. I want to try and get a job as soon as I possibly can. When I search for jobs I seem to get plenty of Python jobs that aren't really asking for much more than knowing Python. That being said they seem to usually want someone with a fair bit of experience. Often when I come across JavaScript jobs they seem to be wanting you to know a few frameworks and libraries really well too. I often see that they prefer if you know another coding language as well with C languages always popping up on the requirements as well. But that only seems to be the case when I look at JavaScript jobs which I guess just always means web dev either front end, back end, or full stack.

    So what I'm trying to ask is, will I have a fair bit more learning to do and thus take me longer to get a job going the web dev JavaScript route? I've thought about doing a bootcamp to speed the time up. but that's also pricey.

    I realize I haven't done extensive job searching so I don't know if this is always the case, and I'm just there are libraries and/or frameworks companies will want you to know for Python. I suppose that depends on the type of work though.

    I have completed a web dev bootcamp course on Udemy which taught full stack development. So I am now familiar with html, css, js, node js, express, and monogdb. but just familiar. i'm still not the best with javascript even though I feel like I have a fairly decent understanding of the basics.

    I've only just been learning Python now this past week since I've been questioning the direction I want to go, but mainly questioning what is the quickest way into the industry. I haven't done much with Python yet, just learning the syntax right now and have only made a rock, paper, scissors game versus the computer. no score count or anything, just one round.

    So yeah, those are my current thoughts, and that's the little bit of coding experience I have. I should probably make it clear that I'm not looking to be a front end developer either. at the end of the day I would take a front end job, but with web dev i'm more interested in either full stack or back end. i'm not even necessarily looking for web dev either. i mean, of course that's the route i'll go if people recommend i go that route and stick with javascript, but if I can get into the tech industry faster with Python, then I'd rather devote all my attention that way. At the very least I know Python is said to be the easiest programming language, and given that you can do more with less code I'd imagine projects would take less time. So that's part of my thinking there.

    Basically I'm looking for the easiest in and/or the fastest in.

    If I go web dev/JavaScript what would you say are the most common frameworks and libraries companies are looking for right now?

    If I go Python what would you say are the most common frameworks and libraries companies are looking for right now? Also what kind of work do you typically do with Python? I realize it can be used for so many things, and when it comes to web dev, i'm only familiar with it being used with Django on the back end. I'm also not sure how popular it is compared to Node js on the back end. I'm familiar with some big tech giants using it, just not sure about the entire industry.

    BONUS STUPID QUESTION: I realize due to Node js, javascript isn't necessarily totally stuck to web development anymore. I'm only familiar with its usage with websites though, and I'm curious what kind of stuff can be done with it outside of the web, and perhaps there are non web dev jobs in that direction as well?

    THANKS IN ADVANCE!!

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

    What's the point of interfaces in Java?

    Posted: 30 Jun 2020 06:12 PM PDT

    As far as I understand, when you implement an interface, you have to define all the methods of the interface in the class you implemented the interface in. Why not just define the methods anyway then? I don't get the reason why you would just add restrictions to a class? Does implementing an interface do something else besides provide restrictions? Maybe I'm not understanding what interfaces are and how they work, but idk.

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

    Is there a way to make certain text or images appear onscreen when specific words are entered into an text input bar?

    Posted: 30 Jun 2020 04:57 PM PDT

    Hello! Please ream me over the coals if this ends up being a confusing explanation; I've tried Googling an answer but can't figure out the keywords I'd need to use. I'm very, very new to coding and am making my own website. On one page of the site, I have an "input type="text"" field with a submit button, and I was wondering if there's a way to make certain keywords entered in this field bring up text or images on the page. For example, if a user types in the word "dog", images and an explanation of dogs will show up on the screen. If they type in "cat", the same will happen with cats. I suppose I don't know if this is even possible! I just think it'd be a fun addition.

    Again, if I'm being confusing, I'll try to answer any questions I can. TYIA for any and all help!!

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

    Looking for a way to back up and sync certain folders between two computers seamlessly, and I was wondering if a raspberry pi can be involved in this process.

    Posted: 30 Jun 2020 04:28 PM PDT

    Hi. I'm an aspiring web developer, and I do a decent amount of development/learning on either my desktop (windows 10), or my laptop (ubuntu). However, it's sometimes difficult to maintain the same pile of notes and projects between the two computers short of manually moving them around or manually backing up to github. I'd really like to make a folder on my desktop (or laptop, OR my raspberry pi, which is always on and always connected to my home network, unlike my two main computers, which may be asleep at any given time) that gets synced a lot between at least the two main computers.

    I'm sure that something like this exists, but I've been having trouble finding something like it. I think in a perfect world, the best way I'd like to implement this would be something "hosted" on my raspberry pi that would allow this behavior (cross-computer folder synchronization of a specific folder). Can someone point me in the right direction for a tool that could do something like this, if one exists? I'd really appreciate it. Tagged as "embedded" because I'm not sure what would be best.

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

    Youtube Data API v3 requires https website - is there an easier way?

    Posted: 30 Jun 2020 12:11 PM PDT

    I'm working on a python script that will be able to add videos to a playlist on my youtube account. I went to https://console.developers.google.com/ to get the api, but apparently I need an OAuth consent screen, despite the fact that I will be the only one signing into it? It's asking me for an authorised top level domain just to get this OAuth key for editing my playlists... there has to be an easier way

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

    Recursion vs. Iteration

    Posted: 30 Jun 2020 02:33 PM PDT

    I've been programming for more than 10 years, but except for programming exercises in college I never used recursion at my job. At the project I'm currently working on someone used recursion for iterating through a JSON hierarchy. This surprised me, because I would have just used a loop. Did I miss something?

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

    A "hello world" program in C compiled with MinGW gets detected as a trojan, wtf?

    Posted: 30 Jun 2020 08:28 AM PDT

    I haven't done any development on Windows in months and this is what I come back to.

    This is the source code.

    I ran the 44kb executable on VirusTotal, 26 engines out of 72 detect it as malware.

    The compiler is latest and acquired from https://osdn.net/projects/mingw/releases/

    Please. Send help.

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

    Layout manager java

    Posted: 30 Jun 2020 02:15 PM PDT

    Any good reference about layout manager? Please not oracle, i am a beginner and i can't follow what i'm reading in oracle but it is a good source if you have basic idea about class or functions.

    What i need is reference about layout manager, and/or swing jpanel/jframe. Thaaaanks :)

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

    Visual Studio: how to find the "earliest" reference of a function or variable?

    Posted: 30 Jun 2020 02:02 PM PDT

    Hi all. Basically looking to comment out a section of code that sets in motion a chain of unnecessary app actions but can't find the original source or reference "call". I know the file name of the culprit. How, using Visual Studio can I find the earliest reference/call to this file? Thanks for any newbie pointers..

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

    Question about C++ programming

    Posted: 30 Jun 2020 09:55 AM PDT

    I'm currently a Java programmer and recently I've been learning C++.

    Are C++ programs supposed to be written in a different manner than Java programs?

    I think I understand C++ syntax and all that, but everytime I code a C++ program I always do it the way I would program something in Java.

    Is this fine, or should I have a different etiquette when programming in C++?

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

    Please explain this PIR Sensor code:

    Posted: 30 Jun 2020 09:10 AM PDT

    Here is the code:

    int ledPin = 13; // choose the pin for the LED int inputPin = 2; // choose the input pin (for PIR sensor) int pirState = LOW; // we start, assuming no motion detected int val = 0; // variable for reading the pin status void setup() { pinMode(ledPin, OUTPUT); // declare LED as output pinMode(inputPin, INPUT); // declare sensor as input Serial.begin(9600); } void loop(){ val = digitalRead(inputPin); // read input value if (val == HIGH) { // check if the input is HIGH digitalWrite(ledPin, HIGH); // turn LED ON if (pirState == LOW) { // we have just turned on Serial.println("Motion detected!"); // We only want to print on the output change, not state pirState = HIGH; } 

    I'm confused about pirState = LOW. If that means no motion is detected, then HIGH means motion detected?

    if (pirState == LOW) = no motion detected.

    if (pirState == HIGH) means motion detected?

    Here is link to code

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

    What's the best way to get fluent in a language?

    Posted: 30 Jun 2020 12:56 PM PDT

    I know how to program complex things and the logic behind it, just getting used to the syntax is hard to do where i have to keep googling how to do basic stuff like increment a list or reverse an array

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

    (JAVA) Difference between JPanel and JFrame? Help with this homework? :(

    Posted: 30 Jun 2020 11:43 AM PDT

    Hi, I'm new to programming so most of what I have found I don't really get what they're saying :(

    I have this homework. I'm supposed to do a program that converts different measurements. Each type of measurement (weight,distance and storage) will be a package and within that package there will be two classes one will be graphical (Jframe or JPane idk) and another that will have methods to convert between them (cm to m and so on). All of this using encapsulation.

    I kind of know how to do this but I don't really know how to handle the "graphical" part. Any help will be apprecuated. If I didn't made myself clear with something I'll answer in comments

    thx in advance <3

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

    What tools and techniques can I bring into an engineering team doing data science in python?

    Posted: 30 Jun 2020 07:39 AM PDT

    I am a process control systems engineer who is getting support for creating an in-house data science program. We work in a manufacturing environment, we have data pulling in from all over our plant that is managed in a sql server, which we can pull into python as needed. Our current development looks like a few engineers on our team solving small problems with one script at a time, maybe reporting the results via an email. My question is how to bring structure to our development process and work towards building a sustainable system. We have support for acquiring an expensive data science PC, which will be our workhorse. Likely will be a lenovo p920. What software infrastructure should I have to ensure that our remote engineers can write their code on their device, but run the code on our workstation? In addition, I have been looking at docker as an opportunity to standardize the form our coding projects will take, and allow for their scheduled/orchestrated use using kubernetes and helm, and the potential for distribution to other plants using a standard image. However, I dont know what I dont know. I am still grasping the concepts of docker, and I have little support from IT. Consider me the most tech-savvy person on this project.

    Are there much easier ways to get these tasks accomplished? The biggest problems we are facing:

    How can we write code remote that is processed by workstation and gives results back to remote user (Jupyter Notebook)?

    How do we set our python scripts to run at specific intervals or given certain conditions (I have had issues with task scheduler in the past)?

    How can I set up this workstation to run our conditional scripts 24/7?

    What tools or techniques can I enforce for my small team so that we can create robust tools for use in production setting?

    How do I get my team to write code that takes advantage of the nice PC we are looking to use?

    Is Docker recommended for this project?

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

    No comments:

    Post a Comment