• Breaking News

    Sunday, August 25, 2019

    Music -> Programming Ask Programming

    Music -> Programming Ask Programming


    Music -> Programming

    Posted: 25 Aug 2019 01:12 PM PDT

    Any past musicians on here who moved into programming? How was the transition and what were your motivations behind the transition?

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

    Question to anyone who frequents coding contests.

    Posted: 25 Aug 2019 06:58 PM PDT

    What's the usually etiquette for using external or public code in competitions? I've been trying to get more into them, but the barrier to entry seems to be having a premade snippet of every kind of algorithm to actually be competitive (for instance, having to write an efficient prime generator for a question based on primes will take up allot of time, when the hard/time-consuming part should be figuring out how to actually use them to solve the problem). I've found popular import libraries are often blocked, which makes having such premade algorithms even more essential.

    Is it typically expected that everything is something you've written? Or is it considered acceptable to use a snippet found online which solves some subproblem (something which solves the whole problem seems to just defeat the purpose of the problem.) And if it is considered acceptable to use a public library, are there any such public libraries that cover the typical algorithms required as pieces in these contests?

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

    [HELP] Difference between "knowing a language" and "knowing how to program"

    Posted: 25 Aug 2019 04:29 PM PDT

    Last year I took a class in highschool called AP Computer Science and I learned java and got a 3 on my AP test. I can say I know java but I dont know how to create a program. We never used a IDE, everything was done online. My question is how can I get started to create programs, my IDE of choice is Eclipse? Thank you!

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

    [C] Writing an int to binary file and then reading it gives different number

    Posted: 25 Aug 2019 05:53 PM PDT

    I am learning C, currently testing how binary files works... The thing is, i write an int to the file, but when i try to read it i get a random number. It has been a couple of hours now since i'm trying to solve this, testing different thigs, so maybe it's something really dumb, but i can not see it... here is the code:

    #include <stdio.h> int main() { FILE *tempFilePointer; FILE *tempFilePointer2; struct tempStruct { int anio; }; struct tempStruct registro1 = {2018}; printf("w %d\n", registro1.anio); tempFilePointer = fopen("pruebas.dat", "wb"); fwrite(&registro1, sizeof(struct tempStruct), 1, tempFilePointer); fclose(tempFilePointer); struct tempStruct registro2; tempFilePointer2 = fopen("pruebas.dat", "wr"); fread(&registro2, sizeof(struct tempStruct), 1, tempFilePointer2); printf("r %d\n", registro2.anio); return 0; } 

    Please pardon the variable's names and the strings in spanish, but i thinks it would not make a big difference.

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

    Which language should I use for this?

    Posted: 25 Aug 2019 09:34 PM PDT

    So my plan is to make a program for my D&D game. I have a touchscreen laptop, and I want to be able to track my spells by tapping the ones I've used. I have experience in JavaScript and C, but I'm not sure how to go about this in either language. If anyone has any recommendations, I'd really appreciate it.

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

    Using a select input and multiple data attributes to filter out elements in JQuery?

    Posted: 25 Aug 2019 09:29 PM PDT

    Hi everyone,

    Is there a way to filter out a set of elements depending on the items selected in multiple select inputs in JQuery?

    Say there are 3 optional select inputs used to filter out items, in this case select inputs for "Category", "Topic", and "Year".

    <!-- Select Fields -->

    <form>
    <select name="Category">
    <option value="Category 1">Category 1</option>
    <option value="Category 2">Category 2</option>
    <option value="Category 3">Category 3</option>
    </select>

    <select name="Topic">
    <option value="Topic 1">Topic 1</option>
    <option value="Topic 2">Topic 2</option>
    <option value="Topic 3">Topic 3</option>
    </select>

    <select name="Year">
    <option value="2019">2019</option>
    <option value="2018">2018</option>
    <option value="2017">2017</option>
    </select>
    </form>

    <!-- Elements -->

    <div class="element" data-category="Category 1" data-topic="Topic 2" data-year="2019">
    <p>Element 1</p>
    </div>

    <div class="element" data-category="Category 2" data-topic="Topic 1" data-year="2019">
    <p>Element 1</p>
    </div>

    <div class="element" data-category="Category 3" data-topic="Topic 3" data-year="2017">
    <p>Element 1</p>
    </div>

    If the user selects a "Category" it will filter out and only show items with the data-category attribute that matches what is selected on the "Category" select input.

    But once the user also selects something on the other two select inputs i.e. a "Topic" is selected and a "Year" is selected then it will only show div elements with the data-topic and data-year attributes together with the data-category that has been selected earlier already.

    Is there any way to pull this off in jQuery?

    Any help would be greatly appreciated.

    Thanks!

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

    How can you remove the noise generated from transforming to .png?

    Posted: 25 Aug 2019 09:16 PM PDT

    So I made some black circles with Paint with a white background, they are perfectly symmetrical. But when I exported them to .PNG, noisy pixels were generated on the borders of the circle. These pixels are not completely black nor white, they are in between (greyscale).

    I tried 3 things:

    • Assume everything != white is black
      • This generated asymmetric circles (can't process them correctly)
    • Assume everything != black is white
      • This generated some islands of pixels: pixels that got separated from the circle with white space in between (can't process this either)
    • Let them be
      • Turns out this is actually the same as assuming everything != white is black

    Therefore, my theory is that there must be some threshold for determining which part of the pixels are part and which of them are not part of the original circle. I need them to be 100% symmetric after cleaning (as they used to be) for my project.

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

    SQL - Query returning different # of rows on multiple left join

    Posted: 25 Aug 2019 05:23 PM PDT

    Hello,

    I have written two queries. I would have assumed that both would return the same number of rows. However, query #2 returns more rows than query #1 (for example, if I do WHERE fce.id_experience = 43861, it'll return like 6 in example query #2 while only 1 in query #1).

    Am I doing something wrong?

    Query #1

    SELECT fce.id_experience , DATE(CAST(fce.ts_booked_at AS TIMESTAMP)) AS ds , fce.m_total_booking_price , dec.dim_vertical , dec.dim_category , dec.dim_sub_category , fce.dim_guests FROM core_experiences.fct_experience_bookings AS fce LEFT JOIN ( SELECT DISTINCT id_experience , ds , dim_vertical , dim_category , dim_sub_category FROM exp_ops.dim_experience_categories) AS dec ON dec.id_experience = fce.id_experience WHERE dec.ds = '{{ presto.latest_partition('exp_ops.dim_experience_categories') }}' and fce.id_experience = 43861 

    Query #2

    SELECT fce.id_experience , DATE(CAST(fce.ts_booked_at AS TIMESTAMP)) AS ds , fce.m_total_booking_price , dec.dim_vertical , dec.dim_category , dec.dim_sub_category , fce.dim_guests FROM core_experiences.fct_experience_bookings AS fce LEFT JOIN ( SELECT DISTINCT id_experience , ds , dim_vertical , dim_category , dim_sub_category FROM exp_ops.dim_experience_categories) AS dec ON dec.id_experience = fce.id_experience Left Join ( SELECT DISTINCT id_experience , dim_mt_market , dim_title FROM core_experiences.dim_experiences) AS de ON de.id_experience = fce.id_experience WHERE dec.ds = '{{ presto.latest_partition('exp_ops.dim_experience_categories') }}' and fce.id_experience = 43861 

    Thanks in advance!

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

    [3D Modeling] How can I implement 3D objects into an application or website?

    Posted: 25 Aug 2019 07:35 PM PDT

    Hey guys, thanks for any answers ahead of time. I've got an idea that I want to work on, I just don't really know where to start with this aspect. I want to use something similar to character creation in a project, but it's going to be for objects, not rpg characters.

    I assume that I'll have to make 3d objects for the idea to work.

    For example, in the use of the app, the user could select an object. let's say it's a couch. the users couch will render on the screen and they can select colors for the couch. on top of that, the user can also select throw pillows to go on top of the couch, or maybe a cover blanket. now the image is rendered with the pillows and blanket on top of the couch. the user can then spin the object around by touching the screen or moving the mouse.

    Can anyone give me leads of where to start learning how to code or implement this?

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

    I don't know if I have what it takes to learn programming.

    Posted: 25 Aug 2019 07:31 PM PDT

    Our instructor emailed us yesterday saying there would be a problem solving session tomorrow. He said it would be on the level of the first 10 problems of Project Euler. Problem is, I've only solved 2. I have no idea how to solve the others. Classes started a month ago and I feel like I am lagging behind my other classmates. I really don't know what to do. Should I pursue a different course? I really really love computer engineering but it just looks like I don't have what it takes. What are some good sources to learn programming? How much of my day should I allot to study?

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

    Do some machine instructions create more heat than others?

    Posted: 25 Aug 2019 01:01 AM PDT

    I was reading an article that said that xor eax eax and sub eax eax both take one clock cycle and are therefore interchangeable. Instructions that zero registers are handled specially in hardware so this won't illustrate the point but I'm intrigued by the 'no. clock cycles is the only bottleneck' part.

    I have a program where, at one point I know that eax and ebx have no 1 bits at the same index. In other words

    xorl eax ebx addl eax ebx orl eax ebx 

    will all have the same effect.

    These are all 1 cycle instructions but are some operations hotter than others?

    Thermodynamically, xorl is the most reversible, orl the least. On the other hand, an orl will use the fewest transistors.

    avx512 is disabled by a lot of compilers purely because it is so hot. I was wondering if this is a consideration compiler developers often have to think about.

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

    How to start my career hunt with a bang?

    Posted: 25 Aug 2019 06:25 PM PDT

    I'll be a senior this year, and by next May I hope to have a bachelors in computer science; I want to get right into the work force ASAP so what are somethings I can/should be doing? It's kind of a daunting thing to me to suddenly have to worry about how I'm going to convince someone to hire me.

    If it makes a difference I intend to look for work in either the Seattle or SF/Bay area but I don't live in either of those two areas so I don't know if that makes things easier or harder.

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

    [C++] How to determine if an object is deleted?

    Posted: 25 Aug 2019 10:00 AM PDT

    Here is the question:

    a1 etc will be cleaned up when out of scope. How could you confirm this?

    Here is a1:

    std::array<int, 3> a1 = {8, 77, -50}; 

    I've got no idea, I tried using:

    delete a1; and delete[] a1; 

    Neither worked because I assume it isn't a pointer and I tried looking up the question but keep getting "You shouldn't have to because it will be deleted when out of scope"

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

    Parsing mathematical equations into a tree cleanly

    Posted: 25 Aug 2019 04:55 PM PDT

    I want to construct a parse tree for mathematical equations, so 5+10 would have a root node of '+' and then two child nodes for 5 and 10. To parse arbitrary expressions I'm thinking the tree needs to be constructing in quite a weird way, going up and down depending on the input etc, rather than a simple recursive function that just adds new nodes going down as it sees new tokens. To construct it in this cleaner way, the tokens would need to already be ordered in some fashion such that the resulting parse tree can be parsed with the right operands and with the correct mathematical precedence. My question then is are there any known good ways to parse the equation into a data structure that can then be fed into a tree more easily?

    One that immediately comes to mind is postfix notation, but this is equally as hard if not harder to construct a tree out of, as operators come next to each other (you can have 523+-) and so token can definitely not be taken one at a time, as two operators next to each other in a parse tree makes no sense.

    Thanks.

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

    [C++] I'm having some compiling issues.

    Posted: 25 Aug 2019 04:45 PM PDT

    I have been using notepad++ to write my code in and I have been using mingw to compile. The way I would do this is by saving my cpp file and then dragging it to the c++ compiler within the bin directory. This had been working fine until I decided to move my application to another computer (both are windows 10). When I ran the application it would give me an error: "libgcc_2_dw2-1.dll was not found". Is there a way I can compile my program without the need for this library?

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

    How would I dynamically generate content based off a domain name?

    Posted: 25 Aug 2019 09:31 AM PDT

    Hello there,

    Lets say I had 10 domains pointing to one php script. I want to have a skeleton webpage generated and filled in with domain specific content whenever a domain name is accessed.

    In my head I would want the dns of each domain to send a keyword to the server, a php script would read the keyword and generate a dynamic webpage based on that keyword. I currently can't find a solution for what I'm trying to do.

    I don't want to web forward and the keyword cannot be read from the domain name, how would I do this?

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

    How should I go about learning programming if my goal is solely to really understand how things work?

    Posted: 25 Aug 2019 08:59 AM PDT

    This ones a little different.

    I don't wan't to learn to code to accomplish any one goal, I have no projects or career goals in mind, and most advice tends to be centered around, "if you're looking to do x, you should start by learning y".

    My curiosity is coming solely from a place of desire for a holistic + in depth understanding, knowledge for its own sake.

    Keeping that motivation in mind, how would you recommend I move forward?

    Do I start with something easier like Python and work my way down to C, or get right into the thick of it with C and work my way up to the higher level languages later on?

    Most have said Python, but I'm worried that starting with so much abstraction will teach me to think about things in a way that might hinder me later on.

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

    How can I change numbers on a webpage using tamper monkey?

    Posted: 25 Aug 2019 08:04 AM PDT

    Hi guys,

    Is there a way to edit numbers on a webpage using tamper monkey? It is in a table and I can't change it looping through a replace function.

    Thanks

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

    Is JVM the Java Complier?

    Posted: 25 Aug 2019 06:13 AM PDT

    [Javascript] the $ string not working

    Posted: 25 Aug 2019 04:22 AM PDT

    let test = 'text'
    console.log('${test}')

    I'm using webstorm and the output is :
    "${test}"
    can somebody help?

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

    How modern days data breaches across websites have passwords in them? Since 2000 from forums I knew I should encode password in the database, never store it in plain.

    Posted: 25 Aug 2019 04:05 AM PDT

    I just don't understand. They decrypt passwords somehow or what? I see data breaches with passwords since 2010 and they continue to appear.

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

    Film Festival Screener Scheduler

    Posted: 25 Aug 2019 03:06 AM PDT

    I know this may not be the proper subreddit for this, but thought I'd give this a try since I've been wondering about it for such a long time. I work in the film industry and part of my job is seeing multiple films at film festivals. A schedule is released before each one so, for example with TIFF, there's a list of 200+ films with dates and times in excel format. I usually pour over it for hours/days trying to sort out the best possible schedule so I can see as many films as possible.

    So... that leads me to the question... is there any way I could automate this process? As in, a piece of code or an excel function that would let me select all the films I want to see and, like magic, pump out multiple versions of possible schedules? I got as far as representing all the films/dates/times as numerical values... then my head exploded. The only example I think may be similar is for college students scheduling courses, but I can't seem to turn up something online that does exactly what I'm looking to do. I can go into more detail if anyone gives a crap at all about this request. :)

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

    Best IDE for beginners (Mac)

    Posted: 24 Aug 2019 10:35 PM PDT

    Should have a decent amount of features and support most languages

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

    No comments:

    Post a Comment