• Breaking News

    Tuesday, July 17, 2018

    For People who have trouble learning to use git,a few months back I was one of you. Here's how I changed it. learn programming

    For People who have trouble learning to use git,a few months back I was one of you. Here's how I changed it. learn programming


    For People who have trouble learning to use git,a few months back I was one of you. Here's how I changed it.

    Posted: 16 Jul 2018 10:10 AM PDT

    An xkcd , this sums up my experience with git before reading the progit book. Yes you would have heard about The progit book, The book is amazing, I like learning via books because it seems like one step at a time and all the information is right there. Before finding this book i've tried many tutorials I was lost at half way through the jargon of remotes,local branches,remote branches, local branches that track a remote branch. It was overwhelming. This book literally takes one step at a time, first they talk about basic stuff staging area, diff's,logs, gitignore, tagging etc. Then they get into branching the killer feature. They talk about all the strategies merging,rebasing, tracking remote branches. They give you an intuition about whats going on unlike most of the tutorials that give you a bunch of commands to type in the shell. Once you have read till branching. Digest stuff, you are more than capable to use git on a daily basis, test all the interesting features you have learned so far. Then you can go to the advanced chapters. The book does not assume anything about your knowledge of git, it starts with setting up your environment. Trust me and try this.

    Sorry If mentioned before. You don't become an expert after reading the book right way, I still have the 'Aha moments' from time to time. You look at git like a kind friend that's helping you rather than a flat-track bully messing with your life. All the best!

    Link: Here you go

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

    Automate the Boring Stuff with Python and other Linux ebooks for $1 in the latest Humble Bundle!

    Posted: 16 Jul 2018 12:39 PM PDT

    Several ebooks available for pay-what-you-want, all benefiting the Electronic Frontier Foundation!

    • Automate the Boring Stuff with Python
    • The Artist's Guide to Gimp
    • The Art of Debugging
    • Perl One-Liners
    • The Book of GNS3
    • The Book of Inkscape
    • The Book of GIMP
    • The Book of PF
    • The GNU Make Book
    • Blender Master Class
    • Doing Math with Python
    • How Linux WOrks
    • Wicked Cool Shell Scripts
    • Absolute OpenBSD
    • Arduino Project Handbook
    • Think Like a Programmer
    • The Linux Programming Interface

    https://www.humblebundle.com/books/linux-geek-books

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

    How do you open a program to the public once you've finished it?

    Posted: 16 Jul 2018 07:13 PM PDT

    As the title states, I'm wondering how people put up their programs on the internet for others to download it. I have looked this up on google with many other phrases of the same question and couldn't find anything.

    As a follow-up question: When you put something up to download, how do you control what the user can and cannot modify? What if you don't want the user to see and copy the source code? Thanks!

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

    Searching For Sub-String in C

    Posted: 16 Jul 2018 10:25 PM PDT

    I recently decided to try and write a program to search for a substring within a larger string in C. Though I am aware of the strstr method, I chose to try and write my own as a learning experience. Thusfar, I have come up with this:

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    int* searchText(char fullText[], char subStr[]){
    int instancePositions[(strlen(fullText))%(strlen(subStr))];
    int counter, counter2; //Counters for iteration
    int arrEditCount=0; //Tracks number of times value has been pushed to array
    for(counter=0; counter<(strlen(fullText)-strlen(subStr)); counter+strlen(subStr)){ //Iterates through each subStr length sub-string in the full text
    for(counter2=0; counter2<strlen(subStr); counter2++){ //Iterates through each character within every subStr length sub-string in the full text
    if(fullText[counter+counter2]!=subStr[counter2]){
    counter+=strlen(subStr);
    counter2=0;
    break;
    }
    instancePositions[arrEditCount]=(counter+counter2);
    arrEditCount+=1;
    }
    }
    int *returnVal=(int *) instancePositions;
    return returnVal;
    }
    int main(){
    searchText("The square of the hypotenuse is equivalent to the sum of the square of the sides.", "the");

    return 0;
    }

    The program consistently returns "-1", and I cannot find the error. What am I doing incorrectly?

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

    Been inspired to teach myself to make a little game. Wondering if I should try unity?

    Posted: 16 Jul 2018 10:12 PM PDT

    I've heard many people use / talk about unity. This project is mainly for myself. I want to make a little top down, 2D spaceship combat game. I have dabbled in programming before, I used a java tool called greenfoot and I made a game in that and a few prototypes (even one like my current concept) but my experience is still quite limited (I would say). I'm keen to try something different with a bit less training wheels.

    Basically I just want to know am I being too ambitious if I want to jump into unity?

    Edit: PS, I'm also a junior Maya animator. If that has any relevance

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

    Why does every tutorial / guide about Responsive Web Design say one should add media queries based on content not screen size, but every css framework / library bases it on screen size?

    Posted: 16 Jul 2018 10:02 PM PDT

    As the title says.

    All css frameworks / libraries breakpoints are based on similar values, 768px, 1024px, 1408px and so on. Bulma, bootstrap, material-ui, semantic-ui.

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

    How can I learn if I like coding?

    Posted: 16 Jul 2018 09:29 AM PDT

    I recently tried switching careers and failed miserably.

    I'm now in my early 30's with a (expensive but ultimately worthless) graduate degree waiting tables.

    I'm looking into career paths that will get me outta the hood, and (obviously) programming offers a path that is profitable and high growth.

    The problem is that I have zero experience with coding, or anything math related. What's the best way to get my feet wet without investing significant time and money?

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

    Help with passing functions to template classes.

    Posted: 16 Jul 2018 08:46 PM PDT

    I have created a template Binary Search Tree that stores nodes that are also templated. I would like to be able to pass functions to the BST.

    In my first version of the BST, I made it so that it only took in a single type (ie. int), and I was able to pass functions to the tree in this version, however now that the tree is storing nodes, I am unable to get it to work.

    Here is the Node:

    template <class Key, class Value> struct Node { public: Key key; vector<Value> value; Node* leftNode; Node* rightNode; Node(Key k, Value v) { key = k; value.push_back(v); leftNode = nullptr; rightNode = nullptr; } }; 

    Here is a portion of the BST:

    template <class T> using vfp = void (*)(T&); template <class Key, class Value> void BST<Key, Value>::InOrder(vfp<Node<Key, Value>> func) { InOrder(root, func); } template <class Key, class Value> void BST<Key, Value>::InOrder(Node<Key, Value> *&node, vfp<Node<Key, Value>> func) { if (node == nullptr) { return; } InOrder(node->leftNode, func); func(node); InOrder(node->rightNode, func); } 

    The error that I am getting is:

    E0304 - No instance of overloaded function "BST<Key, Value>::InOrder [with Key = float, Value = Time]" matches the argument list.

    Any help in pointing me the right way would be greatly appreciated.

    Thanks.

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

    Microsoft Visual C# for Grasshopper and Revit Components

    Posted: 16 Jul 2018 11:46 PM PDT

    Hey fellas,

    I need to install Visual C# to make grasshopper and Revit components but which components at least I should install to minimize the required hard disk space. I don't have much space in my SSD and need this program only to make GH and Revit components. Any thoughts? And is Visual C# Community edition is enough to work with these two.

    For Revit it says :

    Product: Autodesk Revit*
    Programming Language: C# (and VB.NET - does not include written explanations for VB.NET code samples)
    Application Programming Interface (API): Revit .NET API

    Thanks ,

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

    Java arrays, writing a more efficient solution?

    Posted: 16 Jul 2018 11:43 PM PDT

    Hello guys, I stumbled on a few problems in an exam for employment, and they have few problems for an array, so I want to know if there is any more efficient solution than mine.Unfortunately I didn't finished these questions on time, I just got hooked with it after I got home after the exam.

    NOTE:You cannot use any sort of array static methods or anything from the collection framework(List,ArrayList,LinkedList).

    Problem 1: All the elements that are in 'givenArray1' that can be found in 'givenArray2' should be remove, returning a new size of 'givenArray1' and a 'givenArray1' with a new set of elements. the new givenArray1 should contain the elements that are not removed. Implement the given objective in the provided 'removeSet()' method.

    My Solution:

     public static void main(String[] args) { int[] myArray = {1,2,3,4,5}; int[] myArray2 = {7,8,1,9,5}; int[] newArray; newArray = removeSet(myArray,myArray2); for(int number : newArray){ System.out.print(number + " "); } //Output 2,3,4 } public static int[] removeSet(int[] givenArray1,int[] givenArray2){ int storedElems = 0; //Counting stored elems for the 'newArray' size for(int index = 0; index < givenArray1.length; index++){ boolean isDuplicate = false; for(int index2 = 0; index2 < givenArray2.length; index2++){ if(givenArray1[index] == givenArray2[index2]){ isDuplicate = true; } } if(!isDuplicate){ storedElems++; } } int[] newArray = new int[storedElems]; //storing elems inside the new array int newArrayIndex = 0; for(int index = 0; index < givenArray1.length; index++){ boolean isDuplicate = false; for(int index2 = 0; index2 < givenArray2.length; index2++){ if(givenArray1[index] == givenArray2[index2]){ isDuplicate = true; } } if(!isDuplicate){ newArray[newArrayIndex++] = givenArray1[index]; } } return newArray; } 

    Problem 2: Combine the elements in the 2 arrays(array1,array2) and return a new array without duplicates(Suppose the combined array has duplicates).The returned array can be sorted(ascending,descending) or not.

    My solution:

    public static void main(String[] args) { int[] myArray = {1,2,3,4,5}; int[] myArray2 = {7,8,1,9,5}; int[] newArray; newArray = combine(myArray,myArray2); for(int number : newArray){ System.out.print(number + " "); } //Combine array elements //1 2 3 4 5 7 8 1 9 5 //Sorted elements //1 1 2 3 4 5 5 7 8 9 //Final Output //1 2 3 4 5 7 8 9 } public static int[] combine(int[] array1, int[] array2){ int[] newArray = new int[array1.length + array2.length]; //Combining the array 1 and array 2 for(int index=0;index<array1.length;index++){ newArray[index] = array1[index]; } for(int index=0;index<array2.length;index++){ newArray[index + array2.length] = array2[index]; } //Sorting the array in ascending for(int index=0;index < newArray.length; index++){ for(int index2=0;index2 < newArray.length; index2++){ if(newArray[index] < newArray[index2]){ int tempNum = newArray[index]; newArray[index] = newArray[index2]; newArray[index2] = tempNum; } } } int[] tempArray = new int[newArray.length]; int tempArrayCounter = 0; int counter = 0; //temp array that will be filled with no duplicate elements for(int index = 0; index < newArray.length -1; index++){ if(newArray[index] != newArray[index+1]){ tempArray[tempArrayCounter++] = newArray[index]; counter++; } } //Modify last index in tempArray tempArray[counter++] = newArray[newArray.length - 1]; int[] newTempArray = new int[counter]; return newTempArray; } 

    I want to also note that the exam grading rubrics includes the efficiency of your code. So I want to know guys if there is an unnecessary piece of code that needs to be omitted in my solution because I always think that my solution is inefficient in some way.

    A help is always appreciated :)

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

    What is the best setup for C++ on Linux Mint?

    Posted: 16 Jul 2018 11:17 PM PDT

    I am about to start learning C++, and I'm wondering if anyone has a setup they like for Linux Mint. Right now I'm planning to use emacs, but if there is something better I'm open to it.

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

    Why is B correct here? This is a codefights challenge

    Posted: 16 Jul 2018 11:05 PM PDT

    https://imgur.com/a/KQ76Mim

    Why is B correct here? This is a codefights challenge

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

    How do I get the padding-top to not stretch to the nav-bar?

    Posted: 16 Jul 2018 10:32 PM PDT

    I'm trying to make a nice centered jumbotron that has some center text. But for some reason, I can't get the padding to get not stretch from the top(if that makes sense). Any help on getting that jumbotron by itself in the middle of the background image. I'm using bootstrap btw(forgot to mention earlier). The whole thing is a col-lg-12. Here's my code:

    HTML:

    <!DOCTYPE html> <html> <head> <title>Project</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="project.css"> </head> <body> <div class="row"> <div class="col-lg-12 "> <div class="col-lg-2"></div> <div class="col-lg-8 jumbotron"><h1>Lorem Ipsum.</h1></div> <div class="col-lg-2"></div> </div> </div> </div> </body> </html> 

    CSS :

    .col-lg-12{ background-image: url("https://www141.lunapic.com/do-not-link-here-use-hosting-instead/153180452580915102?1107391"); height:1000px; background-size: cover; font-family: 'Source Sans Pro', sans-serif; } .jumbotron{ background-clip: border-box; padding-top: 300px; } 

    Thanks!

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

    Web developers, how do you make money off your website?

    Posted: 16 Jul 2018 10:19 PM PDT

    Sorry in advance if this question is off topic but for those that made and run their own website how do you make money from it?

    I'm not asking about selling stuff online.

    Im asking from the ads on your site.

    Every time I go on a small site to look at some documentation there's an ad for Slack and other small ads.

    How much do those ad pay and how do you gets ads on your site.

    Thanks in advance for the help

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

    JS, CSS, HTML and Facebook Video Calls

    Posted: 16 Jul 2018 06:25 PM PDT

    Is it possible to use JS, CSS, and HTML to create an app to make video calls via facebook, using voice recognition triggers ( like google assistant) on a desktop environment?

    My coding experience is next to nothing except for some Python and Fortran that I picked up back when I was in collage. Just need a little push towards the right direction =).

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

    Need some help making a nested array from an object in javascript.

    Posted: 16 Jul 2018 06:07 PM PDT

    Let's say I have an array of objects like this:

    [ { "title": "object 1", "index": "1" }, { "title": "object 2", "index": "1.1" }, { "title": "object 3", "index": "1.1.1" }, { "title": "object 4", "index": "2" }, { "title": "object 5", "index": "2.1" }, ] 

    And the desired output is an array where the items are nested based on the index, with the nested arrays under a key of "sub-sections". With this example, the output should be:

     [ { "title": "object 1", "index": "1", "sub-sections": [ { "title": "object 2", "index": "1.1" "sub-sections": [ { "title": "object 3", "index": "1.1.1" } ] } ] }, { "title": "object 4", "index": "2", "sub-sections": [ { "title": "object 5", "index": "2.1" } ] } ] 

    I've tried thinking of some solutions but they all involve a bunch of nested for loops and if conditions and it's generally turning into a mess and I know there must be a better way to do it.

    Thanks.

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

    image recognition barcode/QR code replacement?

    Posted: 16 Jul 2018 09:09 PM PDT

    Does anyone know a decent open source way for me to scan an image of an object (not a QR code) by photo, then have it recognize the object in the image and use it like you would a QR code to link to specific content link in the browser? I've seen these before with big companies but unaware of what is the best open source method of this?

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

    Trouble adding Restart Game Feature

    Posted: 16 Jul 2018 09:07 PM PDT

    I am looking to simply adding a "Press 'R' to Restart" to the Unity Survival Shooter Tutorial aka "The Nightmare".

    The issue I am having is that the tutorial sets you up with a restart timer (although I believe I have removed this). I added the code that I know to do add a restart (learned from the Unity's Space Shooter tutorial) and although it all seems to work the game still automatically restarts itself.

    I do not know what I am doing wrong.

    Here is the code I have so far:

    using UnityEngine; using UnityEngine.SceneManagement; public class GameOverManager : MonoBehaviour { public PlayerHealth playerHealth; Animator anim; private bool gameOver; private bool restart; private void Start() { gameOver = false; restart = false; } void Awake() { anim = GetComponent<Animator>(); } void Update() { if (playerHealth.currentHealth <= 0) { anim.SetTrigger("GameOver"); gameOver = true; if (gameOver) { if (Input.GetKeyDown(KeyCode.R)) { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); restart = true; } } } } } 
    submitted by /u/skjoldinbrothr
    [link] [comments]

    What Program would be appropriate for a Financial Plan book?

    Posted: 16 Jul 2018 08:43 PM PDT

    Good evening, I have read the FAQ and am unsure what program would be best for my application. I would like to automate a finance tracker. I have been tracking my finances in excel for a couple years and each month I go in and enter all the values in. I would like to be able to write a code that will collect all of the information and upload it to a spreadsheet. I want to start with the basics of just stocks, as I think developing a code to log into my bank account will be a little challenging. I am assuming I will have the same problems logging into my broker account but I was thinking I could enter in the stock's ticker and it can go to google and return the current value. I would eventually like to link it to my bank/broker account, but that is not the first step. I would also eventually like to have a graph of how my investments are doing and it would also be nice = to link a search engine into the program to spit out market cap, week high/low, p/e, etc...

    I was originally thinking of doing this in VBA as I have a decent understanding on Excel but not the Macro aspect of it, but after reading the FAQs, I think that Python or Ruby would be the way to go for the automation aspect of it. But I would also like to have it in a windows program. Have any of you written a similar code to this? Any advice/challenges you foresee would be appreciated!

    Thanks!

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

    Getting a new computer

    Posted: 16 Jul 2018 08:05 PM PDT

    Hey guys, I recently purchased a 15 inch 2017 MacBook Pro but was wondering if I should return it and upgrade to the 2018 model. I am going into first year university next year and would like this laptop to last me for as long as possible, at least till the end of my four years hopefully. I am going into a dual degree with computer science and commerce so I will be coding and working on side projects on this laptop, so overall power of the computer is what I am keeping most in mind. The 2018 model is about $200 more, I was just wondering if the power upgrade from 2017 to 2018 will be noticeable and worth it for me to get.

    My 2017 model specs:

    - 2.8 GHz i7 Quad Core processor

    - 16 GB RAM

    2018 model:

    - 2.2 GHz i7 Six-Core processor

    - 16 GB RAM

    Any and all help is appreciated, thanks in advance!

    submitted by /u/al-monds
    [link] [comments]

    Which is the best programming language to start learning with?

    Posted: 16 Jul 2018 11:35 PM PDT

    Can anyone help me with this.

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

    Autocomplete form by W3Schools

    Posted: 16 Jul 2018 01:42 PM PDT

    So I found this Autocomplete form thing, https://www.w3schools.com/howto/howto_js_autocomplete.asp, which is awesome as I was looking for something like this.

    I'm just wondering, how do I make it work for multiple fields in my form instead of just one? I have been reading the example and trying stuff, but no success yet.

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

    Is Java for enterprises development the same as java for android development?

    Posted: 16 Jul 2018 07:37 PM PDT

    What's are some of the differences between the two?

    I want to learn java for enterprise development and don't want to spend time learning anything that is solely for android development.

    Thanks in advance to all

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

    New to programming any help/advice would be appreciated.

    Posted: 16 Jul 2018 07:12 PM PDT

    Hello, first let me provide some context. Currently, I am junior in college studying Computer Information Systems and recently just finished up my first and only C++ course. I have no prior experience in programming and while the course was very informative, I feel disappointed because we mostly wrote very small programs with limited functionality like calculators, a hangman game and trivial Kattis challenge programs. It is my end goal to eventually work in cyber security and I had hoped to learn some more in depth things like how to write maybe a monitoring program or how to write code that manipulates files or the OS etc.

    My question is, do you the programmers of Reddit have any advice in how to start programming that type of software? Or, if any of you work in cyber security, how did you get there?

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

    No comments:

    Post a Comment