• Breaking News

    Friday, September 11, 2020

    Something to lighten your learning process (Programmers, disagree or agree?) learn programming

    Something to lighten your learning process (Programmers, disagree or agree?) learn programming


    Something to lighten your learning process (Programmers, disagree or agree?)

    Posted: 11 Sep 2020 07:33 AM PDT

    hey guys, I've been thinking a lot about programming and the learning process.

    It can be brutal.

    Probably the most difficult thing is not having anyone around to tell you if you're doing things right or heading in the right direction (thank goodness for this subreddit though).

    I wanted to provide a few pieces of encouragement for anyone struggling with the learning process:

    • Those feelings of a lack of progress, wandering, and discouragement are normal. Some of these feelings are part of the larger experience of impostor syndrome. It's ok to feel these things, just don't give in to them.
    • The best way to overcome and not give into impostor syndrome? Fixate on growth like hell. You don't have to have huge growth, just enough to keep moving forward. Was there a function you understood better? An interview question you memorized? Maybe you read a few more pages in a programming fundamentals book. All small, but fantastic ways to grow and overcome impostor syndrome.
    • You're heading in the right direction. That programming language you're learning is probably fine. You're asking for feedback here and genuinely asking for help. Keep staying open to feedback and make small adjustments from there.
    • You'll always be "becoming" a programmer and there's not a point of arrival. Remember, programming is a long game and you'll always be learning new things. If you ever get discouraged with forgetting a function or piece of syntax, expert coders still use StackOverflow to solve their problems so don't feel bad :)

    Feel free to ask any questions, I'm here to help.

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

    Coding Your Own Website

    Posted: 11 Sep 2020 05:56 PM PDT

    Hi Everyone, Hope you all are staying safe!

    I am CS student who is interested in building her own website. I have been trying to do some research but didn't have much luck yet finding something that can give me a proper guide on coding your own website. I have some experience with HTML & CSS ( I am currently learning more on these). I would like to hear if any of you have any advice on how to get started on this? What tools to use? Also, if any articles or tutorials you have used that helped you!

    I haven't really used GitHub before. When I start this project, I would like to push my code into the GitHub. As most employers look at your GitHub profiles to see what you have done so far (mine looks so dry at this point :( ) Any advice on that would be appreciated as well!

    Thank you in advance:)

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

    C programming integer division

    Posted: 11 Sep 2020 07:14 PM PDT

    When programming in C, how do I make the program to round correctly when only using integers for mathematic operation?

    Example:

    int x = 6;

    int y = 8;

    int division = x/y;

    int myAnswer = 5 + division;

    The accurate answer should be 5.75 so it should round up to 6. However, when you run this code, you'll get 5. How can you modify this code without using math.h or ceiling or floor function to round to the nearest value instead of 0?

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

    Want to code GUI, but everyone is telling me not to

    Posted: 11 Sep 2020 06:18 PM PDT

    So, I've been learning c++, going through the console stuff, but it's boring me to tears. I'm coming from a PowerShell background that I use extensively as an Admin resource, I've even done WPF PowerShell GUIs with dynamic AD data in a single form. I started with c++ as I wanted to learn a powerful, efficient, small exe size, all in one with no dependencies, language. But seems GUIs are an afterthought and only once you have done extensive console work. So, given my frustration level I'm considering changing to either Microsoft Visual c++ or c#, can anyone please give me some direction and reasons to pursue either? Thanks!

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

    Question about this C program here

    Posted: 11 Sep 2020 10:32 PM PDT

    I wanted to start learning C and followed an example by a book. It worked perfectly but I modified it to my liking to do what I want. But after the modification... it does not do what I want.

    Here is the code:

    #include <stdio.h> int main() { int fahr, celsius; int lower, upper, step; lower = 0; upper = 300; step = 20; celsius = lower; while (celsius <= upper) { fahr = (5/9)*celsius+32; printf("%d\t%d\n", celsius, fahr); celsius += step; } } 

    It's a table that shows a fahrenheit equivalent to a celsius.

    So, 0 Celsius 32 Fahrenheit,

    20 Celsius 68 Fahrenheit. And so forth up to 300 Celsius with a stepping value of 20.

    It adds up the celsius' to 300 perfectly but it wont change the Fahrenheit's value. It always stays 32 from 0 up to 300. I don't understand why. I have sat here for about 1 hour to figure out what I fcked up but I can't.

    Could someone help?

    Thanks in advance.

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

    Free Code Camp just released a full tutorial on Blazor (C# 8 hours )

    Posted: 11 Sep 2020 06:55 AM PDT

    I'd love to know everyone's opinion on Blazor but for those who are are interesting trying out new technology here you go!
    https://www.youtube.com/watch?v=4G_BzLxa9Nw

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

    Visual Studio First App!!!

    Posted: 11 Sep 2020 08:10 PM PDT

    Hi everyone, i am trying to build my first app on Microsoft Visual Studio using c++ and I do not now where to begin. Can anyone provide me with any resources or helpful links to get me started. Every place i've gone to has said that I need to code in xaml or i need to get a Android Emulator. The Emulator i got said it wouldn't work on my computer (windows 10), it only worked on Windows 10 pro. Any help is welcome, thanks.

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

    Request for Assignments/Homework

    Posted: 11 Sep 2020 08:07 PM PDT

    Basically the title. I would really like some good structured assignments to help me get more comfortable with Object Oriented concepts. My first language was Python and I didn't really use Inheritance, Abstract Classes, Interfaces, etc. that much and I am struggling to wrap my head around using these in actual applications. I like to think I understand the concepts themselves but am having trouble finding ways to implement them in code (which probably means I don't understand them that well). I would appreciate any pointers to resources that have well structured assignments that I can do to really sink my teeth into OOP. I'm currently learning C# if that matters and am hoping that along with doing these OOP assignments I can also familiarize myself with C# syntax. The assignments don't really need to be language specific. They just have to have a detailed spec that I can flesh out in code. Sorry for any grammatical as English isn't my primary language. Thanks in advance!

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

    Contributing to open source - trouble

    Posted: 11 Sep 2020 02:09 PM PDT

    I want to contribute to open source, but I have problems trying to understand the codebases. How can I solve this issue? Can you suggest me some projects to contribute to? (I can program in Java, Python, C, C++ in this order of preference)

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

    New website to learn coding

    Posted: 11 Sep 2020 11:49 PM PDT

    Please help to decode this

    Posted: 11 Sep 2020 11:47 PM PDT

    01001110 01100101 01110110 01100101 01110010 00100000 01100111 01101111 01101110 01101110 01100001 00100000 01100111 01101001 01110110 01100101 00100000 01111001 01101111 01110101 00100000 01110101 01110000 00100000

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

    Text extracted from presentation files was not in correct order when using python-pptx

    Posted: 11 Sep 2020 05:48 PM PDT

    I'm trying to extract text from powerpoint text boxes with the following code:

    from pptx import Presentation from pptx.enum.shapes import MSO_SHAPE_TYPE def iter_textable_shapes(shapes): for shape in shapes: if shape.has_text_frame: yield shape def iter_textframed_shapes(shapes): """Generate shape objects in *shapes* that can contain text. Shape objects are generated in document order (z-order), bottom to top. """ for shape in shapes: # ---recurse on group shapes--- if shape.shape_type == MSO_SHAPE_TYPE.GROUP: group_shape = shape for shape in iter_textable_shapes(group_shape.shapes): yield shape continue # ---otherwise, treat shape as a "leaf" shape--- if shape.has_text_frame: yield shape prs = Presentation(path_to_my_prs) for slide in prs.slides: textable_shapes = list(iter_textframed_shapes(slide.shapes)) ordered_textable_shapes = sorted( textable_shapes, key=lambda shape: (shape.top, shape.left) ) for shape in ordered_textable_shapes: print(shape.text) 

    But sometimes the textbox at the end of the ppt is extracted first and sometimes the ones in the middle and so on. How do I fix my code to get the text in correct order (left-to-right, top-to-bottom) ?

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

    How should products exist inside a database?

    Posted: 11 Sep 2020 11:21 PM PDT

    Say I have Products, Customers, and Companies. Customers can buy products, companies can issue products and get money when they are sold.

    Right now my idea is to have a Products table and Customers table. Whenever someone makes a purchase of say Shovel, I add a row inside a Orders table with FKs to Customers and Products. Then I remove -1 from the amount column under Products row entry of Shovel.

    Is this the right approach? Say I have 50 shovels in my shop. Should I have 50 rows of shovels for each shovel, or just one shovel with an amount row of 50? That way I save space, but then everyone basically owns the same shovel.

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

    Making a calculator as a first project

    Posted: 11 Sep 2020 11:12 PM PDT

    I haven't written any code for it yet I'm just wondering how you'd set up the calculations, granted I can easily go on YouTube and look up how to do it. Do you have to write in all the calculations yourself or I assume you could maybe copy and paste something? Also would anything past the 4 basic ones require just a lot of algebreic notations? Oh this is going to be c# btw.

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

    The Satoshi Mindset by parserite

    Posted: 11 Sep 2020 10:58 PM PDT

    Satoshi Nakamoto is a symbol of hope. Not because the pseudonymous creator of Bitcoin birthed a brand new currency, a payment system, or even that he solved an ages old computer science problem, no it's much deeper than that. On January 03 2009, block 0 of a new distributed system was mined. Contained within, was a message, "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks", revealing some of the thinking behind its genesis. Taking into account that this was in the midst of the financial crisis, and combining that with later writings, we can infer that Satoshi wasn't happy with the economic system he found himself in. What's interesting though, is that instead of moaning, begging, lobbying politicians, voting, protesting, occupying wall street, or any of that — ALL which I might add, never achieved any of their desired outcomes — he dared to create an alternative, and asked permission from no-one. Even though we still live in this imperfect world, with many of the same corrupt forces, you could argue that Bitcoin has already succeeded in that it: - Created a censorship-resistant system used by millions of people - Created the most powerful computer hashing network in existence - Created a market valued at multiple billions, all from nothing - Has been used as a safe haven by citizens in failed states around the world - Spawned a whole raft of other important software innovations As Peter Thiel would say, that is a 0 to 1 development. Satoshi started all of this when he sat down and figured out how to solve a seemingly unsolvable problem. He's quoted as once saying "I'm better with code than with words", and this is the core of the mindset: creating new technological alternatives, instead of just complaining. Echoing this sentiment back in 1993 with the Cypherpunk Manifesto, Eric Hughes famously declared, "Cypherpunks write code." This amalgam of recognizing problems, having technical skills to potentially fix them, and then taking personal ownership for trying to do so is probably one of, if not the most important qualities our species has. Human history is littered with these feats — monumental forces of will which flip the script, change reality, and reveal new pathways for being. Another example is Linux. Do you think the operating system would be used on the majority of phones, tablets, and servers today if not for Linus Torvalds deciding one day to create and release his own kernel, even when it seemed like a insane undertaking? It's not about idolizing Satoshi or others. The point is that in order to solve big problems, we must first look inwards and take responsibility. Think: "What can I create to solve this?", and "What can I build that will be so good that others will voluntarily abandon their old ways for this new thing?" Our civilization's heavy reliance on electronic technology means that now more than ever, you have a chance to come up with real technological solutions and nudge our species in a better direction. So in closing, I just want to get across that it is down to YOU, and no one else. Stop shaking your fist at the sky, and shift your mindset. Satoshi took on the responsibility of an impossible task, and succeeded. You can too. Pick a difficult problem, and go after it. If you need help, find like-minded people, and if you have gaps in your knowledge, learn. This is how we improve things — everything else is a distraction.

    https://medium.com/@hashelse/the-satoshi-mindset-81cbb75ba684

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

    Pushing myself to work without the mouse

    Posted: 11 Sep 2020 12:16 PM PDT

    I was working on a project just earlier and it really started to annoy me how much I was pointing and clicking with the mouse. I wasn't as concerned about my workflow or speed because I was more concentrated on learning something new, but it really blew my mind how slow I was moving through things.

    I remember someone on here told a story about a linux (iirc) class he had in university. He said that the professor would take your mouse away during lecture if he heard you clicking around too much. I kinda did the same with myself, had to set the mouse aside and really think about what I was doing.

    I have a decent bit of experience with command line and I have some nice keyboard shortcuts for a lot of things, but it's easy to neglect using them when you're tired/distracted. (Alfred/Wox are nice to use btw)

    Using the keyboard takes a bit of thought and your actions have to be deliberate, but when you get into a flow with it it's a hell of a lot faster. I always knew that in theory but my experience today with it really made it quite clear.

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

    How to create a healthy study schedule that will actually benefit your progress

    Posted: 11 Sep 2020 11:59 AM PDT

    I LOVE to read/watch stories of those self-taught developers who became hired jr. devs in just 3 months. It's always super inspiring and pumps me up. But being an actual learner, you cannot come into this field with that mindset of "this'll be 3 months and I'm good" without honest and serious considerations into the sacrifices you need to make to achieve that.

    In general, Having the mindset that you are going to speedrun this is actually detrimental to your progress. If you don't reach your goal time or start stressing out cuz u don't think that you are making fast enough progress, guess what, those are all feelings that lead to burnout and abandonment by 90% of the prospective programmer community.

    pivotal programming concepts, problem-solving skills, and languages are honestly like learning a real language. You have to learn fluency and this will take time. You are going to be in a MUCH healthier place and MUCH MUCH MUCH more likely to stick it out through all the hardships, if you come in with the expectation that this will take time and learn to be flexible. You will go MUCH further into this career if you can learn to be persistent, over being some gifted genius.

    Listen, if you are telling yourself "I need to code at least 8 hours a day", you're already on the wrong foot. first off those are the type of hours that are usually met by people without long work or familial responsibilities. If you are used to studying like that already, go for it, but if you aren't, start at smaller manageable intervals. Master 1-4 hours a day. Do 1 hour chunks of studying with an hour break in-between. Make it manageable. Find a study plan that fits YOU. Once you're used to it work yourself up. Shorten your breaks, lengthen your hours. If it takes you 2 years to get your first dev job, THAT IS STILL AMAZING. You did 2 years of self-studying and now you're in an industry that will set you on a strong financial foundation for the rest of your life.

    **TLDR Software programming is not a get-rich-quick scheme. CREATE A STUDY PLAN THAT PRIORITIZES SUSTAINABILITY OVER SPEED

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

    package Service Javadoc not found. Either Javadoc documentation for this item does not exist or there is no attached Javadoc to the JAR file containing this item:C:\Users\Hrishi\Documents\NetBeansProjects\prac1\target\classes Attach Javadoc...

    Posted: 11 Sep 2020 10:29 PM PDT

    Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-cli) on project prac1: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]

    To see the full stack trace of the errors, re-run Maven with the -e switch.

    Re-run Maven using the -X switch to enable full debug logging.

    For more information about the errors and possible solutions, please read the following articles:

    [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

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

    How do I evenly split a list on ingtegers into a longer list of integers?

    Posted: 11 Sep 2020 06:37 PM PDT

    I'm looking to acheive this in Python 3.0, but I'm stuck on the math behind how to do it, rather than the code.

    This question solves a little of the issue of (un)evenly splitting the value into a list in integers but does not address the other parts of the issue: How do I split an integer up into near-equal amounts in different variables?

    I have an input such as: {'apples':2, 'banannas':12, 'cats':5, 'dogs':7}

    User chooses value for N

    N = 8

    It is a dict with a variable amount of keys (Won't be more than 20 keys 99% of the time) and integer values. The values will always be positive integers. I wish to evenly split the values into a list of length N (up to 17), such that every key input will be represented at least once in the output and every value will be as low integer as possible whilst still summing up to the input value.

    If the output length N is less than the number of keys I will simply return an error.

    The order of the output does not matter.

    An example output for the given example with N = 4:

    ({'position': 1, 'type': 'apples', 'level': 2}, {'position': 2, 'type': 'banannas', 'level': 12}, {'position': 3, 'type': 'cats', 'level': 5}, {'position': 4, 'type': 'dogs', 'level': 7})

    An example output for the given input with N = 7:

    ({'position': 1, 'type': 'apples', 'level': 2}, {'position': 2, 'type': 'banannas', 'level': 4}, {'position': 3, 'type': 'cats', 'level': 5}, {'position': 4, 'type': 'dogs', 'level': 4}, {'position': 5, 'type': 'banannas', 'level': 4}, {'position': 6, 'type': 'dogs', 'level': 3}, {'position': 7, 'type': 'banannas', 'level': 4})

    At first I felt that the best idea would to make the initial list of dicts with N = len(input), then loop and add a new dict for whichever level is the highest, dividing the hoghest value by 2 to split it evenly but in the second example output, I would have ended up with the type B's, I would have ended up with the levels 3,6,3 (Split the 12 into 6 & 6, then split 1 of the 6's into 3 & 3). Instead, if type b is to occupy 3 postions, each level should be the initial input divided by the positions it occupys (3).

    In the case that an integer cannot be evenly split into however many integers, the difference between the max and min of the levels for that type should be equal to 1.

    In each loop it should always be the highest output level type that is split.

    Happy to clarify anything and answer questions

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

    Make an py executable to convert audio into text ? Speech recognition libraries ?

    Posted: 11 Sep 2020 04:22 PM PDT

    Hi, I want to make an executable to convert a audio file (mp3, wav, aac) and turn it into text

    A kind of window that you drag and drop a file and then you get back a text file . And ask you to location to save it .

    Been digging into speech_recognition library and tkinter but not quite understand how making it work . Not sure if it's the right path. I want to make it work with spanish recognition ,

    Any advice or experience on similar stuff? Thanks

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

    Python

    Posted: 11 Sep 2020 10:07 PM PDT

    How to generate 1000 random numbers in python. The numbers should be 'Poison' distributed with 0.6 mean and 0.2 standard deviation.(Library functions not used for generation).Plot the generated signal and its distribution (histogram).

    I have tried with Library functions

    I am unable to do without Library functions

    Code:

    import numpy as np

    import matplotlib.pyplot as plt

    def Generate_Numbers(): a = np.random.poisson(lam=0.6,size=1000) print("Random Numbers:") for i in a: print(i,end=" ") plt.hist(a) plt.show()

    if name == "main": Generate_Numbers()

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

    [C] How to printf a number with leading 0s and a negative?

    Posted: 11 Sep 2020 09:57 PM PDT

    I'm very new to programming to C so my knowledge is almost nonexistent.

    I just need a printf function that outputs -00123

    Only thing that works is: printf("%d\n", -123);

    How do I implement those leading 0s?

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

    Bubble sort algorithm.

    Posted: 11 Sep 2020 09:56 PM PDT

    Hello everyone, first of all thanks in advance for any advice or/and help you could give me, and sorry if I have grammar mistakes, English is not my first language.

    I'm taking Harvard's CS50 course on edX, I am in the part of algorithms, they explain the algorithms but they don't give you the source code, which is good because I'm trying to do them by myself. Anyway, so I was implementing bubble sort in C and came with this program:

    #include <stdio.h> void print_array(int array[]); void bubble_sort(int array[]); int main(void) { int numbers[10] = {52, 9, 21, 75, 3, 30, 85, 51, 67, 90}; printf("Unsorted array:"); print_array(numbers); printf("Sorted array:"); bubble_sort(numbers); print_array(numbers); return 0; } void print_array(int array[]) { for (int i = 0; i < 10; i++) { printf(" %i", array[i]); if (i < 9) { printf(","); } else { printf(".\n"); } } } void bubble_sort(int array[]) { int swap = 1; while (swap != 0) { swap = 0; for (int i = 1; i < 10; i++) { if (array[i] < array[i - 1]) { swap = array[i]; array[i] = array[i - 1]; array[i - 1] = swap; } } } } 

    my program works and it sorts the array the correct way, but then I saw in the Bubble Sort short, that the guy says that since the largest numbers are placed in order at the end of the array every time you start the for loop again you don't need to compare the numbers that were placed correctly at the end, which is bad because my program does exactly that.

    I realized that if I add an inner for loop inside my main for loop with the condition
    j < n - i - 1

    assuming n is the size of the array (in my case 10) my program will skip the already sorted numbers at the end. But in the lecture, and here is where my doubt lies, David Malagan says that nesting for loops is bad in algorithm's complexity terms. I did my initial program with that in mind and that's why I start comparing numbers from the second to the one before, notice my for variable i starts at 1 and the boolean expression in my if compares with the element before so I don't go beyond the array's index.

    I don't know if I am explaining myself, I just want to know what is the correct form of doing bubble sort in C or if both ways are correct. As I said before, thanks for your help.

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

    Zoom Image on Scroll

    Posted: 11 Sep 2020 09:30 PM PDT

    -------- Simple tutorial to Zoom your image on scroll -------

    Languages used : html , css , jquery .

    AsonWebs

    We bring simple and easy tutorials for you to understand the basics as well as advance and in-depth structure of the website and how to use its features .

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

    No comments:

    Post a Comment