• Breaking News

    Tuesday, July 28, 2020

    Starting a job as a junior C developer Ask Programming

    Starting a job as a junior C developer Ask Programming


    Starting a job as a junior C developer

    Posted: 28 Jul 2020 06:17 AM PDT

    This is my first programming job and I would like to know on what things should I put emphasis on. I'll code hardware but I've never done anything like that. My knowledge of C theoretical mostly. I've done many puzzles though.

    Is there anything more specific about C developement, other than the general differences compared to other languages, which should I know or start learning before starting?

    Thanks for your time!

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

    Keeping an updated tally of changing records

    Posted: 28 Jul 2020 07:58 PM PDT

    I have a list of students and their subjects:

    id student subject
    1 adam math
    2 bob english
    3 charlie math
    4 dan english
    5 erik math

    And I create a tally from the above list aggregating how many students are there in each subject:

    id subject students
    1 math 3
    2 english 2

    The student list will keep on expanding and this aggregation will be done at regular intervals.

    The reason I'm keeping the Tally in a separate table in the first place is because the original table is supposed to be massive (this is just a simplification of my original problem) and so querying the original table for a current tally on-the-fly is unfeasible to do quickly enough.

    Anyways, so the aggregating is pretty straight forward as long as the students don't change their subject.

    But now I want to add a feature to allow students to change their subject.

    My previous approach was this: while updating the Tally, I keep a counter variable up to which row of students I've already accounted for. Next time I only consider records added after that row.

    Also the reason why I keep a counter is because the Students table is massive, and I don't want to scan the whole table every time as it won't scale well.

    It works fine if all students are unique and no one changes their subject.

    But it breaks apart now because I can no longer account for rows that come before the counter and were updated.

    My second approach was using a updated_at field (instead of counter) and keep track of newly modified rows that way.

    But still I don't know how to actually update the Tally accurately.

    Say, Erik changes his subject from "math" to "english" in the above scenario. When I run the script to update the Tally, while it does finds the newly updated row but it simply says {"erik": "english"}. How would I know what it changed from? I need to know this to correctly decrement "math" in the Tally table while incrementing "english".

    Is there a way this can be solved?

    To summarize my question again, I want to find a way to be able to update the Tally table accurately (a process that runs at regular interval) with the updated/modified rows in the Student table.

    I'm using NodeJS and PostgreSQL if it matters.

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

    Best European Grad schools for MS in Computer Science with an emphasis on 3D graphics

    Posted: 28 Jul 2020 01:37 PM PDT

    Looking for grad schools out in Europe that offer a similar MS program to DigiPen's MS in Computer Science. Does anyone know of any? I love DigiPen's program, but I also want to study abroad. Does not have to be the exact same thing. Just sort of looking for something around image processing, 3D engine development, graphics processing, etc. Anything parallel to that realm.

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

    Anyone try ditching their multi-monitor setup?

    Posted: 28 Jul 2020 06:13 PM PDT

    I am sure many of us are now working from. At work I had two large monitors and thought I could never program on a just a laptop. I've been programming on just my laptop at home for several months now. I originally planned on setting up a multi-monitor workstation, but found that after a couple of weeks getting used to it I am actually more productive on my 13in laptop. I find I can get in the zone a bit more easily. Anyone else find this to be true?

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

    Design Question: Reject Requests at Scale

    Posted: 28 Jul 2020 05:51 PM PDT

    Usecase:

    • TeamA: Adds 5000 IDs to a blacklist per day and notifies other teams by publishing an SNS message per ID added that all other Teams listen to.
    • TeamB: Gets 4K TPS to its API, and if a given ID is within that blacklist, it must reject it that request.

    Notes:

    • When TeamA updates their blacklist, TeamB and all other Teams, have 30days to start rejected requests for that ID.
      • Getting a request for a blacklisted ID will only happen due to a race condition across Teams. I.e. TeamB has blacklisted the ID, but TeamC has not and TeamC calls TeamB with the blacklisted ID. This is an edge case. However it is not guaranteed that it will never happen again, it could totally happen that TeamB gets a request with a blacklisted ID after a year - TeamB must reject that ID.
    • ID length will be up to 256chars.
    • There is no repository to check whether a given ID is blacklisted or not.
    • TeamB has around ~200hosts in the fleet.
      • Hosts are deployed to on a daily basis - which causes a restart.

    Tenets to follow for design:

    • TeamB's availability should not be affected.
    • API latency should not increase.
    • If possible, avoid a adding a new dependency.

    Options considered:

    • A: TeamB adds all blacklisted IDs to a DB (Dynamo) which is then checked during all of its API requests.

      • Con: Adds latency to its API.
      • Con: Adds dependency on Dynamo - which effects its availability.
      • Con: Expensive to check DB just to handle an edge case.
    • B: TeamB stores all of the IDs in a local CSV file (or some format) which gets updated every 30days via cron job. Which TeamB then downloads locally every 30days as well, and loads into memory at startup.

      • Con: With 5000 IDs per day being added, it might not be scalable in the future (when the file size gets into the GBs).
    submitted by /u/jfkliving
    [link] [comments]

    How to design the data model for a version history system (e.g. Git commit history or Wikipedia page history) most efficiently?

    Posted: 28 Jul 2020 02:03 PM PDT

    As a hobby project, I'm trying to grow my programming skills by making a versioning system. Something similar to how Git works, or the edit history of a Wikipedia page: detecting changes to a document and saving them for a historical record of how that document changed over time.

    I've got most of it figured out, but I'm struggling with what exactly to save in the data model. I've got kind of a Catch-22 in my understanding:

    1) If I only save the diff for each step (e.g. the two lines that changed out of a 10,000-line document), it's very efficient for storage. But then if I wanted to see the full document at any particular point in its history, the system would have to go aaaaaaaaaaall the way back through every change in the history and apply them recursively to "compile" the document to that point, which is wildly inefficient.

    2) Conversely, I could save the full document in each step and just recalculate the diffs between any two version in the history as needed. This would improve the performance a lot, but also seems wildly inefficient to save an entire new copy of the file if you only changed one line.

    Can someone describe how this kind of thing is handled? I don't need specific code samples, just a conceptual understanding of how these systems store and retrieve their historical versions most efficiently.

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

    Need help reformatting/rearranging copy/pasted text string

    Posted: 28 Jul 2020 02:00 PM PDT

    I lack the vocabulary to Google what I'm trying to accomplish.

    In Windows, if I copy a string of text like this:

    LUV 2020-08-21 34.0 Calls

    I want it to be arranged in the following format, replacing the contents of the clipboard with this:

    BUY +100 LUV 100 21 AUG 20 34.0 CALL @ LMT

    Thats the basic idea. I dont know what tools I need to make it happen.

    Here's the actual nitty gritty. The input text will change but always be in this structure, with a single space between data:

    Input: "LUV 2020-08-21 34.0 Calls" is arranged as:

    [Ticker] [Date] [Strike] [Side] or [LUV] [2020-08-21] [34.0] [Calls]

    The output I want will always be the following static text, with the data from Input replacing the bracketed text after some reformatting

    Output: "BUY +100 LUV 100 21 AUG 20 34.0 CALL @ LMT"

    Brackets added to illustrate BUY +100 [Ticker] 100 [Date] [Strike] [Side] @ LMT or BUY +100 [LUV] 100 [21 AUG 20] [34.0] [CALL] @ LMT

    the "BUY +100, 100, @ LMT" will always be there in the base output string.

    Lastly here are the rough parameters for each input data, uh, section.

    [Ticker] can be used as is, whatever it is, move it to the new output string.

    [Date] needs to be reformatted from "2020-08-21" (year-month-day) to "21 AUG 20", thats day, 3 letter month, 2 digit year, space instead of dash.

    [Strike] can be used as is, moved to the new output string.

    [Side] input will either be "Calls" or "Puts", replace with "CALL" or "PUT" when moving to the output string.

    In my head I can sort of plan out how I'd have to script the rules, I started putting together an excel document that would parse a text file and kind of apply some rule based formatting but that was a whole other rabit hole. In reality I need a solution thats streamlined. I copy the text, hit a hotkey, the copied text gets processed and placed back in the clipboard ready for me to paste where ever.

    Can anybody point me in the right direction for this sort of action? I'm willing to learn and do the work I'm just not sure where to begin

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

    What's the best web platform to blog in python and jupyter notebooks?

    Posted: 28 Jul 2020 04:45 PM PDT

    I'm trying to learn coding and advertising myself through blogging. I'm going to post on Medium once I have an initial body of work. I want something that displays graphs and code beautifully. I also know posts for the first few months will be terrible, but I'd like to just get into the swing of things first. Thanks!

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

    How would a language look with all the main libraries where put in one file?

    Posted: 28 Jul 2020 07:43 AM PDT

    Imagine if C, C#, python, etc.. had all the main libraries on one single file, or that you wouldn't even needed to include them because it wouldn't even be necessary. How would it affect the code? Or the binary?

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

    Quickest Way to Make Python Script Communicating with G-Sheets Available to whole Team?

    Posted: 28 Jul 2020 04:26 PM PDT

    Hi all!

    Sorry for the vague description. In shortest terms, I wrote a little Python script which pulls a large chunk of Google Sheets data (~7000 rows with maybe 30-35 columns) goes through some operations based on predetermined variables and writes the edited range back into the sheet. However, as I have no programming background, I have no idea where to start with making this user-friendly and available to the whole team, as many people will have the need to write this script and ideally, more of the scripts of the same kind.

    Just the background of how little I know about how I would do this - I currently only know how to run this script myself from the terminal, so yeah :D Any suggestion is welcome. Ideally, I would love to make it as user-friendly as possible so that anyone from the team could just access it at any time and run it. I'm talking about real simple stuff - I just need two drop-downs and the run button, ideally accessible online.

    Background for anyone curious:

    I got in some kind of technical position without any prior experience or education in anything of the sort and I'm there for maybe year, year and a half. So far, I've been doing everything in Google Sheets - yes, I know it's far from ideal, but there's a huge number of reasons why Google Sheets are a must, not the least because boss very much prefer that we stay within Google ecosystem, so to speak. So, that explains why perhaps a very noob question and why Google Sheets.

    Also, and this might be a personal rant - Google officially offers 6 minutes runtime for the most basic G Suite solution. Unofficially, experience proves without any doubt (measured the time until timeout three times today) that in reality we get only 4 minutes of runtime.

    Why it takes more than 4 minutes for Google Apps Script to go through an array of ~7000 elements, I am really not sure. I know whole of the internet keeps on insisting that this shouldn't be happening, but again, experience proves otherwise. And yes, all the best practices have been followed, I literally have three getRange calls and one setValues at the very end. My Python script which is beyond basic does this in couple of seconds, so really not sure what's the issue.

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

    Possible new RNG method, but how good is it?

    Posted: 28 Jul 2020 02:56 PM PDT

    I was playing around with number sequences and I think a certain kind will be non-repeating. I'm not certain how to double check nor how to test it's ability as an rng, but it does seem like it'd possibly be a fast one using only additions and modulos and a division to make the output into a float between 0-1.

    Basically, the sequences are where you take the tribonacci concept but modulo it. So you'd have A, B, and C (the three previous results), add them up and modulo the result.

    I did this with several number bases (the modulo number) and both 12 and 60 seemed non-repeating. Of course, with my limits I was only able to check the first 100 or so (at least till I can hit up a real computer).

    I figured that maybe a modulo of a few bytes or a touch less might have a similar case of long periods. Not sure how good a quality you could get out of it, but it seems simpler than a bunch of multiplication, divisions, and other more advanced operations. I think bitshifts are cheaper but I don't know much about those.

    What do you guys think?

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

    How to convert Powerpoint slides(pptx) to HTML Pages

    Posted: 28 Jul 2020 02:27 PM PDT

    I have to convert a deck of Powerpoint slides into a static website. I would like to know about any tools and/or libraries available for doing this programmatically. I would prefer Javascript libraries but C#, Java or Python would work too.

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

    Best way to constantly monitor incoming log file and autoupdate phrases to something else?

    Posted: 28 Jul 2020 10:24 AM PDT

    For example if a program is generating a log file that's constantly updating is there a way to scan it as it is updating and change every '1' to a '2' as it finds it?

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

    FileNotFoundError

    Posted: 28 Jul 2020 01:56 PM PDT

    Hi all, I've been trying to run a program that generates deepfakes and I've come across some trouble. A link to the demo I've been using is here: https://colab.research.google.com/github/AliaksandrSiarohin/first-order-model/blob/master/demo.ipynb

    when I run the portion of the code labeled "Create a model and load checkpoints" it tells me there is an error in the third line of code. Here are the three lines of code:

    from demo import load_checkpoints
    generator, kp_detector = load_checkpoints(config_path='config/vox-256.yaml',
    checkpoint_path='/content/gdrive/My Drive/first-order-motion-model/vox-cpk.pth.tar')

    I looked through stack overflow and couldn't find anything useful. Any advice?

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

    How to learn Database Modelling?

    Posted: 28 Jul 2020 12:41 AM PDT

    Hi, I'm trying to design a time slot management interface for doctor appointments. (I have some knowledge in NonRelational document based architecture). Shall I use Relational DB for this? Which one would be more effective?

    Also, how can I learn to model this kind of data efficiently? Are there any particular models that I should use? Maybe you could recommend some books or other resources? How will the schema look like of such an application?

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

    How to shift my current IT career more toward programming

    Posted: 28 Jul 2020 12:20 PM PDT

    I have worked in IT for 10 years (since age 16) and my current job consists of general IT service for a rapidly expanding enterprise (we've hired consistently through the pandemic, even). It's a good position and a relatively good company, but I'm not positive I'm being paid as much as I should be based on my responsibilities. I was hired do relatively entry level/intermediate IT stuff, but due to circumstance, I am now (in addition to my other duties) in charge of programming, testing, and supporting the ACD/IVR for a multisite call center including remote employees and I'm consistently told I'm doing a fantastic job of it. I make about $48k.

    With that in mind, I have a couple of questions. 1: Am I being underpaid? I am doing semi-object based programming in the vendor's proprietary language which I learned of my own volition for a system which receives several thousand calls a day.

    And 2: is this experience enough to transition into a more programming focused job? I have basic experience with C++ and Java, and I'm working on an indie game in my spare time in GML. That said, I do not have an especially impressive or full portfolio of completed works (just a few jam-style games).

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

    I'm working with dataframes and I created a list which contains name of columns which I want to subtract, how do I create new column for subtraction of every two list items

    Posted: 28 Jul 2020 11:16 AM PDT

    Eg var = a,b,c,d

    I need new col1 = a-b then col2 = b-c so on and so forth till d-a

    I tried looping but I just get one column or index out of bound.

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

    What information is needed when connecting to a VPN server?

    Posted: 28 Jul 2020 10:56 AM PDT

    I'm trying to connect to this VPN server through a VPN app (from https://freevpn.me/accounts):

    ![See here]1

    The VPN app is asking me for a server address, server port, shared secret and more. The Shared Secret is freevpn.me but what should I add in the rest of the fields? I'm quite new to VPN so I'd appreciate your help. See screenshot:

    ![See here]2

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

    Strategy for updating a Tally table with changing rows in another table

    Posted: 28 Jul 2020 10:30 AM PDT

    I'm developing a reddit-like site where votes are stored per-user (instead of per-post).

    I have 2 tables (among others):

    • Votes: Registers User votes on Post

      id voter_id post_id type
      1 1 1 upvote
      2 2 1 upvote
    • Tally: Keeps a current tally of all the Votes received for each Post

      id post_id upvotes downvotes
      1 1 2 0

    Tally table basically serves as a quick look-up table to get all aggregated upvotes and downvotes because I'm expecting the Votes table to get quite large and it wouldn't be feasible to retrieve and calculate each post's votes on-the-fly quickly enough.

    When I periodically update this Tally table I don't want to have to go though the entire Votes table each time as it'll get quite large and it won't scale well.

    It seemed all quite simple until I considered the user ability to change or withdraw their vote.

    My initial approach for a cron job logic was something like this:

    1. Read a counter variable from a Metadata table (default = 0)

    2. Read all Votes with offset = counter

    3. Update Tally table with upvotes/downvotes.

    4. Update counter in Metadata (with number of rows it just read from Votes)

    5. Repeat. counter will make sure it only reads newly-added items in the Votes table.

    But what if the user changes their vote? counter won't help with the previous rows that were updated.

    Second approach:

    1. Read a last_updated_at variable from a Metadata table (default = 0)

    2. Read all Votes with updated_at > last_updated_at

    3. Update last_updated_at in Metadata (with Date.now())

    Ok, so I'll be able to get the record that was changed. Let's consider such a record:

    • Before:

      { "user_id": 1, "post_id": 1, "type": "upvote" } 
    • After:

      { "user_id": 1, "post_id": 1, "type": "downvote" } 

    But how do I now know what its previous value was, so as to update the Tally row accordingly? In this case I will have to decrement the "upvotes" by 2 - how do I get that info from just a single (updated) record - that would naively tell me to decrement by just 1 (a downvote, instead of remove previous upvote, and then downvote)?

    I could go back to the counter approach, and instead of updating the Votes I could just introduce a new "type"

    { "user_id": 1, "post_id": 1, "type": "remove-vote", "self_id": 123 } { "user_id": 1, "post_id": 1, "type": "downvote" } 

    This has two problems: First, I have to query the ID of the previous vote, which increases the overall operation time. Second, this complicates other things that I have to do with Votes that I won't bother you with, but it does. I'd really like it to not go this way, it seems unnecessarily complicated.

    Is there any other way that I'm not able to think?

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

    What type of course is good for integrating it with android?

    Posted: 28 Jul 2020 10:01 AM PDT

    I wanted to know what type of course or programming language to take to make a graduation project. My friends took android course and I wanted to take a full stack course to integrate it with an app, but I don't know if that is a good idea or even possible. So, if any one could help me with an info for what's the best thing to do.

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

    I heard a really good definition of what an API was, it compared it to a menu of a restaurant. Can anyone else tell me what it was?

    Posted: 28 Jul 2020 09:40 AM PDT

    A finished video or a song must be rendered before publication, what is the corresponding word in programming?

    Posted: 28 Jul 2020 09:08 AM PDT

    So, I have written the code in Visual Studio, what is the sort of 'final packaging' action called in programming?

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

    Need some insight on implementing algorithm to determine best locations to place rentable electric scooters in a city.

    Posted: 28 Jul 2020 08:45 AM PDT

    Hello!

    Im a third year computer engineering student who is gonna write his bachelor thesis starting January. Im looking for some insight in how to tackle this project, and have an idea myself that i want feedback on.

    Scenario

    Im working with a company that places out electric scooters in a city, which are rentable through a mobile application. There is planning involved every day to pick where to place these electric scooters where they will be used the most. I would like to automate the decision making of where to place the scooters, instead of them being placed in mostly fixed locations.

    Goal

    Through analyzing the available data, i want an algorithm to recognize patterns of use based on the conditions, and suggest the best places to park scooters for each day. The algorithm should also suggest the amount of bikes to place at each location.

    Data available

    About one years worth of data is available for the project. The data is the GPS location and timestamp for when a ride starts and ends. There are about 600 scooters available in the city at all times, and anything from 10 - 70 scooters are in use at any time. Each ride last for on average 15 minutes.

    With the GPS location and timestamps as data, i also want to retrieve weather data for each timestamp, as usage also is dependant on the weather.

    Examples of usage based on conditions

    Good vs bad weather will determine if the scooters are used for reaching indoors facilities such as indoors waterparks, city exploration, beach going etc.

    Time of day and day of week determines if the scooters are used for transportation to work/school, leisure activites, tours of landmarks, religious gatherings and more.

    Initial idea for solving

    My initial idea is to compact all the data into heatmaps that describe usage based based on each condition. For example there might be multiple heatmaps for usage based on temperature where there is one heatmap for each range of temperature (For example one heatmap for 15-17.5 °C , one for 17.5-20 °C ...). In the same way, there would be heatmaps based on ranges of time and each day of the week...

    To retrieve the suggested spots to place scooters at any given day, heatmaps are chosen that are the closest to the conditions for that day. With each heatmap contributing and being weighted differently, they are combined into a final heatmap that describes the most optimal locations to place for that day.

    Challenges

    A problem could be if the data is more random than anticipated, with patterns being hard to recognize.

    There is also the issue of creating heatmaps for each separate condition. For example, 1 pm on one day and 1 pm for another day will probably have different weather conditions, and so separating usage based on the time each day from weather conditions may prove difficult.

    I would really appreciate any suggestions on the challenges i might face, or if there are any other ideas to solve such a task. Thank you!

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

    Where to start for building web applications?

    Posted: 28 Jul 2020 03:20 AM PDT

    Hello! I have some very basic understanding of programming (learned some C++ in school, know the syntax of HTML and CSS, some very basic JS), but nothing more than that. I have a couple of ideas about web applications, one of which is basically a location-based hub for events around you, and my idea is to first make it accessible for browsers - both desktop and mobile, then make a mobile app. Obviously this is not a one man job, but I really want to know where to start in order to build like a simple prototype and I also want to know how to make applications that display the same information both to the web and to the mobile app. Any help will be much appreciated!

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

    No comments:

    Post a Comment