• Breaking News

    Tuesday, October 23, 2018

    One of the creators of StackOverflow explains what it's for learn programming

    One of the creators of StackOverflow explains what it's for learn programming


    One of the creators of StackOverflow explains what it's for

    Posted: 22 Oct 2018 06:14 AM PDT

    Jeff Atwood, via a roundabout way through this blog post, says this about SO:

    I wish more people understood that the goal of Stack Overflow is not "answer my question" but "let's collaboratively build an artifact that will benefit future coders". Perhaps SO could be doing more to educate people about this.

    We get a substantial amount of posts here with people ranting about how unfair SO is because their questions get ignored, down-voted, derided, whatever. They're outraged at being dismissed as noobs, or not being able to get their simple questions answered by real people they can engage in conversation, or otherwise not made to "feel welcome".

    SO has evolved into a nearly read-only repository of programming knowledge. As time goes on, the barrier to entry for questions and answers gets higher. That means if you want to ask a question, the effort that goes into it must be high enough to clear that bar.

    So if you're a new programmer and want help with a homework problem, or are having trouble finding a good answer to some minor issue, then SO isn't for you.

    SO is a fantastic resource that saves incredible amounts of time and effort if you use it correctly.

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

    Video Series and Tutorials on Software Development

    Posted: 22 Oct 2018 11:39 PM PDT

    Dear community,

    My name is Sebastian and I have been working as a software developer in web projects, mostly in Java, for roughly 9 years now. During this time, I've had some ups and downs, changed employers and am currently also working as a freelancer on the side.

    Besides freelancing I also wanted to start creating video curses on Udemy and bought some equipment in order to have decent sound and video. Since the equipment like camera and microphone is already present I thought that I could also make some youtube videos. I wanted to start out with some 'lessons learned' during my career and then talk about other topics, like the importance of tests, which is something I am passionate about.

    A colleague of mine mentioned this subreddit, so I thought that I could share my first video here, possibly get some feedback from you and also if there is anything in particular you want me to talk about in a future video. (Hopefully constructive) criticism is also welcome.

    I want to help people and share some advice. I had a very good boss during my first job after university and he also was a good mentor. So I know that a good mentor can really help you, especially when you are starting as a software engineer and I want to provide some advice like my former boss did.

    Here's the link to the video:https://www.youtube.com/watch?v=I9yDeWghINA

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

    [C++] Call by reference/ampersand in function name

    Posted: 22 Oct 2018 10:19 PM PDT

    Hi,

    I have two main questions: first, what does an ampersand next to a function declaration/definition mean? I still call it without an ampersand; what is it referencing?

    Second thing, I can do this:

    f(n, m, o) = 5; 

    With

    int &f( int &n, int &m, int &o); 

    I know by doing the = 5, the function is called, executed, then n is set to 5 - is there any way I can set m and o in the same line? Is there a difference/advantage from doing f(n, m, o) = 5; vs.

    f(n, m, o); n = 5; 
    submitted by /u/trashiguitar
    [link] [comments]

    Using Big-O notation to estimate running time

    Posted: 22 Oct 2018 08:28 PM PDT

    I'm working on an assignment for data structures and the title is the instructions. Can somebody explain or link me to a good resource that will explain how to tell? If there's a better subreddit for this, please let me know!

    Examples:

    1) for (i = 1; i <= X; i++) for (j = 1; j <= X; j++) for (k = 1; k <= X; k++) { // 5 assignment instructions } 2) for (i = 1; i <= X; i++) { for ( j = i; j <= X; j++) { // 6 assignment instructions } if ( i % 2 == 1) { // 4 assignment instructions } } 

    The answer choices are:

    A. O(1)

    B. O(logX)

    C. O(X)

    D. O(X logX)

    E. O(X2)

    F. O(X3)

    G. O(X!)

    H. O(XX)

    I. O(X2Y)

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

    web server development, with edu scope, ubuntu, which language?

    Posted: 23 Oct 2018 12:03 AM PDT

    Hi guys,

    I want to install a web server on a ubuntu 18.04 server. This will be used mainly by my son (14 yrs) and his friends, and I want to use this mainly as an education tool, so that they start learning a new programming language.

    In your opinion, what is the best choice? PHP? Python? Others?

    Many thanks

    Andrea

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

    [C] Don't know how to set up workflow

    Posted: 22 Oct 2018 11:29 PM PDT

    For a class that I'm taking I need to use Visual Studio Code to code in C. I'm overwhelmed by both the new language and IDE.
    Is there a resource that could show me how people typically work with VSC to code C?

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

    Becoming a software engineer: Choosing your first programming language

    Posted: 22 Oct 2018 11:27 PM PDT

    This article will give you an overview of a few key factors you should consider when choosing your first programming language

    https://fooo.ooo/programming/2018/10/23/learn-to-program.html

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

    Any good Java courses?

    Posted: 22 Oct 2018 11:22 PM PDT

    I'm pretty good in Python and have a little experience with C# but for some reason Java is killing me.

    Maybe it's just because my AP Compsci class is harder on purpose and sometimes we can't use certain things but the tiny variations indentation, blocking, tiny little errors and stuff that can happen really easy combined with the IDE we are forced to use at school called Dr. Java

    Is their any good Java IDE's (easy to understand) and courses that would help me from a more practical point

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

    What's a great book or video series for learning Android Studio?

    Posted: 22 Oct 2018 04:45 PM PDT

    Just getting into Android Studio with some experience in Java. Looking to get into the app world! Thank you guys!

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

    Current mechanical engineer excited by ML and and AI concepts - What to do next?

    Posted: 22 Oct 2018 08:10 PM PDT

    Hi, I'm currently a mechanical engineer working for a large engineering company (HVAC systems design). I completed CS50 last year while traveling and started to get excited about programming in general. I've been most excited by the machine learning and artificial intelligence aspects, and can really see how they would apply to my industry. We have so much data we never use, both in the design of systems and the building's operation after construction. I've got some ideas on what it could be used for but no idea where to start.

    I've heard this is mostly a grad school type field (masters or PHD) as the self taught route doesn't serve it well. Has anyone had experience coming from a BS in Mech Eng into a Machine learning/AI/Big Data focused masters? I'm guessing there would be a lot of catch up necessary but I guess I'm a bit worried about being overwhelmed. Thanks!

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

    CMake - issue creating .elf file for embedded device

    Posted: 22 Oct 2018 10:19 PM PDT

    Hello

    I am trying to compile a source file for an atmega328p (aka arduino uno). I managed to narrow down the issue, but don't know how to solve it.

    This is the file I am trying to compile:

    #include "../include/libgpio.h" #define TWSR_REGISTER_OFFSET 3 #define TWI_GYRO_ADDRESS 0b1101000 void main (void) { /* Disable interrupts. */ cli(); /* Reset watchdog. */ wdt_reset(); /* Clear WDRF in MCUSR */ MCUSR &= ~(1<<WDRF); /* Write logical one to WDCE and WDE */ /* Keep old prescaler setting to prevent unintentional time-out */ WDTCSR |= (1<<WDCE) | (1<<WDE); /* Turn off WDT */ WDTCSR = 0x00; /* Enable interrupts. */ sei(); while(1); } void twi_init(twi_t *p_this, twi_cfg_t *p_cfg) { //empty } 

    When using those commands I am able to compile everything without issues:

    avr-gcc -g -Os -mmcu=atmega328p -c gpio.c avr-gcc -g -mmcu=atmega328p -o gpio.elf gpio.o avr-objcopy -j .text -j .data -O ihex gpio.elf gpio.hex avr-size --format=avr --mcu=atmega328p gpio.elf sudo avrdude -c arduino -p m328p -P /dev/ttyACM0 -U flash:w:gpio.hex 

    But when trying to replace the first two commands with the following CMake file it doesn't work:

    cmake_minimum_required(VERSION "3.5") project("gpio" LANGUAGES "C") set(CMAKE_C_COMPILER "/home/yalishanda/Downloads/arduino-1.8.5/hardware/tools/avr/bin/avr-gcc-4.9.2") add_executable( "gpio.elf" "src/libgpio.c" ) target_compile_options( "gpio.elf" PRIVATE "-mmcu=atmega328p" PRIVATE "-std=c99" PRIVATE "-Os" ) 

    I am still able to upload it onto the embedded device but I can see my software not being run; instead the device keeps on resetting. It is as if the binary generated by CMake isn't OK.

    Does anybody have any idea's?

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

    Does anyone know of websites who are willing to check your code?

    Posted: 22 Oct 2018 07:38 PM PDT

    Hi, I was wondering if anyone heard of websites where you can pay somebody to check the (completed) code for you? I just wanted to be sure if the code meets the requirements from instructions before I submit it for my school

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

    Coding A Halloween Themed Card Game In Plain JavaScript - Tutorial

    Posted: 23 Oct 2018 12:32 AM PDT

    Hey!

    In this tutorial I teach how to code a Halloween themed card matching game. This tutorial emphasizes the object-oriented design pattern and demonstrates how it is useful. It also explains how to create a basic shuffle algorithm JavaScript based off of the Fisher-Yates Shuffle algorithm. This tutorial assumes that you understand basic JavaScript and are ready for beginner-intermediate level JavaScript application development. I hope this tutorial benefits you and also gets you excited for the upcoming holiday!

    • Port.exe
    submitted by /u/portexe
    [link] [comments]

    I feel like we move too fast in my intro to cs class. Were now in week 9 and I'm still on week 5/6 material

    Posted: 22 Oct 2018 08:50 AM PDT

    I just want to make sure I completely understand everything. We move too quick, for example we spent literally like one or two days on functions and then moved to something else.

    I don't like the way my teacher is teaching us. He gives us most of the code and tries to make us solve the rest, and often I always have to look for the internet for help because the solution is something we weren't taught to do.

    Is this how all intro classes are? Am I the only one who isn't becoming proficient at programming?

    I have to learn all my programming from outside sources like udemy courses (I am in two).

    Should I not focus on perfecting a topic and just move along with the class?

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

    Need a help with the concept of searching a JSON file in C#.

    Posted: 22 Oct 2018 04:08 PM PDT

    Long story short, I am attending Code Louisville, which is a crash course on learning different programming languages. I don't know how it compares to Code Bootcamps, as I have never attending one, however we essentially watch videos on Team Treehouse, and have a project with guidelines that is due at the end of the session. I am in the C# course, and we have to make a console app that reads from an external data source, and presents it in more readable format, and writes to an external file. Essentially my goal is to build a console app that can search the DND 5E Spells JSON found at https://github.com/vorpalhex/srd_spells by typing in a spell name such as fireball, and it displays all the information for that spell. However, when building out the process of how this is going to work in my head, I feel like I am over complicating things. I have been reading the Newtonsoft JSON documentation, which explains pieces of my over all goal, but want to make sure I am not wasting time on building more than I need to.

    I guess my overall question would be, should I be deserializing the JSON file into a list, then start searching that list for spells that contain the query (for instance "acid" or "fireball"), and build the format I want to be displayed, or is there a way to directly search the JSON file and display the information I am wanting to show?

    Tagged as homework because that is the closest I have.

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

    Style questions

    Posted: 22 Oct 2018 10:05 PM PDT

    Hi, I'm moving data from a mainframe database to Access using FOCUS to generate CSV files, then importing using VBA.

    For importing moderately sized data sets (up to 10000 rows), is it better to append new data and check for duplicates, or just re-download the entire dataset?

    submitted by /u/2407s4life
    [link] [comments]

    IT Degree for developers

    Posted: 22 Oct 2018 06:12 PM PDT

    I suppose I'm looking more for some assurance than advice as I don't really plan to change majors.

    I'm an IT major with a concentration on web and app development.

    Will be a hurdle when it comes to landing job?

    This is a career change for me. I can't exactly take an internship because I currently work full time. My plan is to teach myself as much programming as I can while earning my degree. I would like to have some projects as a portfolio by the time I'm done.

    I'm also open to any advice on this topic. Especially if you hire programmers.

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

    Interview question help: "You have a list of customers that worked with you for a range of years, inclusive (e.g. 2000 to 2015). Find the first year where you had the most number of concurrent customers."

    Posted: 22 Oct 2018 03:29 PM PDT

    I got asked this question in an interview. I figured out the less efficient solution, but want to know what the optimal solution is.

    E.g:

    - Customer A worked with you from 2000 to 2015 (inclusive)

    - Customer B worked with you from 1994 to 2001 (inclusive)

    - Customer C worked with you from 2000 to 2005 (inclusive)

    The answer is that in year 2000, I had the most number of concurrent customers, and that number is 3.

    My solution was to iterate through each customer and store a tally of the number of customers that worked at each year. The runtime for this is O(n*k) where n is the number of companies and k is the maximum range of years for any given customer. N and K range from 0 to infinity

    The interviewer mentioned the optimal solution was O(n). I was trying to think of a solution where I would iterate the list of companies once, and logically deduce the maximum year at any given point during the iteration, but was unable to.

    What could the optimal solution be?

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

    Problems with Regular Epression [JS]

    Posted: 22 Oct 2018 08:58 PM PDT

    So i have function that returns number between 1-10000000

    const getRandomNumber = () => { const min = Math.ceil(1); const max = Math.floor(10000000); const randomNumber = Math.floor(Math.random() * (max - min)) + min; return randomNumber } 

    When it returns it i test it with jest and refular expression

     it('getRandomNumber should return number between 1 and 10000000 ',() => { expect(getRandomNumber().toString()).toMatch(/[1-10000000]/) }) 

    But it passes only sometimes and cant figue it out.

    And my second question woult be how do to make regex for number that starts with 2 letters than - then number betwennn 1 and 99 and then number between 1-10000000 "si-992-80037".I coudnt do anything with this one.

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

    Segmentation fault

    Posted: 22 Oct 2018 08:49 PM PDT

    Can someone help me out? im getting a segmentation fault 11

    int maximum(int list[], int n)

    {

    int cache = 0;

    if(n == 0) {

    printf("There are no elements in this array\n");

    }

    if(n == 1) {

    return list[0];

    }

    if(n > 1) {

    if( list[n] > cache)

    {

    cache = list[n];

    }

    return(cache = maximum(list, n));

    }

    else

    {

    return cache;

    }

    }

    int main()

    {

    int i=0, size;

    int arr[i];

    int maximumElement;

    printf("Enter size of the array\n"); //prompting user for size

    scanf("%d", &size);

    for(i=0;i<size;i++) //prompting user to enter elements

    {

    printf("Enter element #%d:\n", i+1);

    scanf("%d", &arr[i]);

    }

    maximumElement = maximum(arr, size);

    printf("The biggest element in the array is:%d\n", maximumElement);

    return 0;

    }

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

    Need advice on approach to single page JS app on Drupal

    Posted: 22 Oct 2018 04:09 PM PDT

    Hi folks.

    I have been developing a JS application that displays D3.js visualizations using one JSON file and one CSV file. The app lives in the "Page JS" section of Drupal. But this section actually requires me to add HTML <script> tags go my JavaScript so I originally worked on this app by copying and pasting the JavaScript/HTML into Drupal's input area and waiting for my organization's staging server to render the changed page. (Not ideal.) This was fine when the app consisted of a couple bar graphs, but now the amount of JS is becoming difficult to deal with copying and pasting constantly. I'd like to develop a better staging environment and workflow that avoids this. So now I am wondering how to approach this. What tools should I be aware of? Should I develop a simple Node server to accomplish this? I'm considering developing this simple server and even refactoring the messy JS I have to split it up better. Is there a way I can have this clean JS in one area of the app server and have a build output also generate the JavaScript/HTML needed for Drupal's Page JS?

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

    Can someone help me understand how this sample app created by jHipster works as its very different to any ReactJs and Redux tutorials I've seen

    Posted: 22 Oct 2018 04:08 PM PDT

    I have the following starting point for a ReactJs application, I have been trying to replace the Home.tsx component with a Material-UI responsive drawer component but this results in rendering errors that I think are a result of mixing reactstrap and material UI. I wanted to get some insight from more experienced reactjs devs on how to properly make use of this sample application or should I just ditch the sample app and try develop the UI from scratch, how will this effect jHipster?

    Here is the whole application:

    https://github.com/jhipster/jhipster-sample-app-react

    Here is the app nav bar, can someone explain how lines 66 to 70 work? how can a add a drawer menu to this bar?(Something similar to a Material UI drawer)

    https://github.com/jhipster/jhipster-sample-app-react/blob/master/src/main/webapp/app/shared/layout/header/header.tsx

    Can someone explain how this login logic works and how it triggers that route to '/' once successfully logged in? how does contentKey=home.title and the other content keys work? is home a prop?

    https://github.com/jhipster/jhipster-sample-app-react/blob/master/src/main/webapp/app/modules/home/home.tsx

    What is all this middle ware doing in the store? Every example Ive followed of reactjs and redux have told me to interact with the store in a very different way to this, could someone explain to me how to update or call variables in the current store state here?

    https://github.com/jhipster/jhipster-sample-app-react/blob/master/src/main/webapp/app/config/store.ts

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

    If I want to create a application/service that creates a “daily brief/schedule” for me what would be the best language?

    Posted: 22 Oct 2018 04:00 PM PDT

    What would be the best language to create a daily brief/schedule that would be sent to me or made available to me on a regular basis? I've been learning python but I'm not sure if that's possible with it

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

    [C++] Need helping understanding AES encryption using Crypto++

    Posted: 22 Oct 2018 07:38 PM PDT

    I am trying to learn how to implement AES encryption in C++. From my research I believe Crypto++ is the easiest solution (although if there is a simpler library out there I don't mind reading about it). I found this tutorial online of creating an AESEncryption class. I followed it and created this code (basically I copy/pasted as I tried looking up what each thing did). This is what I gathered in plain english:

    • We create a class which stores the encrypted data in "encrypt" and the decrypted data in "decrypt"
    • When we encode we first check if there is already encrypted text and create it if there isn't(line 27).
    • We then create an initialization vector by combining the password and the previous initialization vector and hashing the combined string.
    • We then set the key and initialization vector for the encrypted text (line 34)
    • ProcessData returns to "encrypt" the encrypted data

    Decrypt does the same thing but it takes the cipherdata and returns the plain text to "decrypt".

    My questions are this:

    • Why would one want to store both the encrypted and decrypted text in the same object at a time? Wouldn't it make more sense to just keep it plain in memory and only encrypt when that data has to touch disk?
    • What are the unique_ptr's? I'm not understanding his explanation as to why we use those?
    • If I want to compile this on a unix system, do I still need the dll.h? The crypto++ library isn't installed on the system I am compiling with so I need to manually include the header files and I'm trying to figure out which ones I need. I saw which to include looking at this tutorial, but he also includes windows.h which I don't think is necessary for me.
    submitted by /u/thepinkanator95
    [link] [comments]

    No comments:

    Post a Comment