• Breaking News

    Friday, April 6, 2018

    Awesome Python Cheat Sheet learn programming

    Awesome Python Cheat Sheet learn programming


    Awesome Python Cheat Sheet

    Posted: 06 Apr 2018 05:07 AM PDT

    Here is a great cheat sheet for Python by Laurent Pointal (whoever you are). Thanks a ton! :)

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

    Free review copies of "Cracking Codes with Python" are available. (Physical print copies, not ebook!)

    Posted: 06 Apr 2018 12:24 PM PDT

    Cracking Codes with Python teaches complete beginners how to program in the Python programming language. The book features the source code to several ciphers and hacking programs for these ciphers.

    If you'd like to receive a free print copy of Cracking Codes with Python, please email the author at al@inventwithpython.com. You'll receive a free ebook to read, and upon posting a review to Amazon, you will receive a complementary print review copy of the book.

    Please post an honest review. You will receive a print book no matter what your rating is. The only requirements are that the review be a minimum of 100 words, you must live within the United States (due to shipping costs), and that you email me first before writing the review.

    Because the book is under a Creative Commons license you can also, as always, read the HTML book online for free at https://inventwithpython.com/cracking/

    EDIT: Wow! I'm getting a huge response. I'll be sending out emails this weekend. Thanks everyone!

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

    Need project ideas when it comes to preparing for SysAdmin job or Maintaining Devices

    Posted: 06 Apr 2018 09:49 PM PDT

    Hello,

    I graduated with BS of Electrical Engineering, for the last 3 years, I am not able to find a job for that (living in Silicon Valley). I lack experience in this field other than doing couple of lab projects in power electronics and embedded systems. I do have experience in Test Engineer, but only for 1 year contract job. Right now I'm currently looking for a job, but this time instead of going for electrical engineering backup, my goal is to aim in system administration(maybe devops, unless people have other suggestion). The reason is that I have personal experience on doing maintenance in computers,routers,smartphones,etc. I'm just a guy that likes to follow the setup step-by-step. I'm not a guy that likes to come up with project ideas.

    I have experience in C/C++ but now I haven't used them for a while.

    Right now, I am doing Python and doing some projects from Jose Portilla Bootcamp to build up my resume.

    My question is what projects/languages should I am for when it comes to preparing for system administration? I did look up this link https://www.reddit.com/r/learnprogramming/comments/2a9ygh/1000_beginner_programming_projects_xpost/ , but I'm still lost on what to aim for.

    It is not that I'm afraid to start on them, it just that I'm don't know if its necessary to do it. Otherwise, I'd be wasting time.

    Any help would be appreciate it.

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

    Essential Concepts to Familiarize Self With

    Posted: 06 Apr 2018 11:07 PM PDT

    At this point, I'm still relatively inexperienced. I know necessary syntax, and, as of now, my only major project has been the construction of a website. I am aware of basic concepts like File I/O, multi-threading, and basic networking, but I'm not entirely sure where to go from here. What concepts do professional programmers work with on a daily basis that I should learn? What are some concepts that I can learn to help stand out from the crowd? List as many as you can think of. Thanks for the help.

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

    Help, Site takes forever if it even loads at all!

    Posted: 06 Apr 2018 09:14 PM PDT

    Sorry if this isnt the right /r/. The company I work for has a site for us to access all our tax information with and it is TERRIBLE. Site RARELY loads beyond some small elements the the left (believe its supposed to be navigation) and one at the top. Id like any insight as to what is hanging (i think its related to a flower animation portion) or what can be done to circumvent the cause of it. Going to dump the code below. Sorry if this isnt the right place!

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

    [Operating Systems] Unix and Pipes

    Posted: 06 Apr 2018 06:14 PM PDT

    slide: https://i.imgur.com/rkYAXFr.png

    Can someone explain why C1 closes the read end of the pipe, closes its stdout, "dups" the write end onto stdout, and execs? and why in this order?

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

    Best resource to learn SQL

    Posted: 06 Apr 2018 08:02 PM PDT

    Hi Everyone,

    Long story short - I landed my dream job through networking while driving Uber. I have about a week before I start that job and it would be hugely beneficial for me to learn SQL before then. Are there any online courses or resources you would recommend?

    tldr: I want to learn SQL in a week.

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

    Beginner here: How do I spot a correct tool (function, method etc) in python to solve a problem?

    Posted: 06 Apr 2018 11:45 PM PDT

    I have been learning python on my own from various online resources and books mainly as a hobby; I learned the basics and decided to test myself by solving the problems in codewars.com.

    Initially, everything went smoothly and I enjoyed the process. As the difficult level starts increasing, I have been getting a lot of error that says something like: 'the server timed out and you need to improve the efficiency of your algorithm.' Then I see the solutions that other people have come up with and some of them are so clever and use inbuilt tools that I have not been aware of. These functions and methods are not in any beginner level python book. I tried some advanced python texts and they all seem to focus towards a particular topic like data science, web development etc

    So my questions are:

    1. How do these people come up with clever algorithms to solve a problem in python; Can this be learnt? Or is this something that comes with experience?

    2. Is there a way to learn about more inbuilt tools and functions available in python? (preferably from a book; I find it hard to read the official python documentation)

    P.S: Posted this in r/learnpython and r/python as well.

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

    How to move the contents of a hash map into a tree map in Java

    Posted: 06 Apr 2018 07:45 PM PDT

    I am currently working on building a word counter program in Java, I took in the file,

    made a hashmap HashMap<String, Word> colic = new HashMap<String, Word>();

    removed the words that were not required, and now I need to move the contents of this hashmap over to a treemap.

    The word object stores 2 items, a string and an int of the number of times the word is seen.

    how can I do this move? I have gone over the API but that left me more confused than when i started.

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

    [SQLite] I would like to create a database of workouts/exercises for an app I'm making, but am having trouble with the inner relationships of the model

    Posted: 06 Apr 2018 11:30 PM PDT

    I am shipping an *.sqlite db with my app which contains a list of workouts and exercises. I'm not sure how to handle the relationships between workouts and exercises, as there are a few different layers, namely:

    • Workouts consist of multiple WorkoutDays
    • WorkoutDays consist of multiple ExerciseRoutines
    • An ExerciseRoutine consist of an Exercise and some other info like reps, sets, rest time, and weight
    • An Exercise has just a Name and a Description

    How can I create this in SQLite? How do I make WorkoutDay contain a variable-sized list of ExerciseRoutines? How can Workout reference multiple WorkoutDays?

    Am I over complicating this?

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

    If Else breaking my simple C# program

    Posted: 06 Apr 2018 10:55 PM PDT

    I cannot for the life of me figure out what I am doing wrong here.

    I have written a very simple program to sort a text file into two text files. One with errors and one without.

    I have tested each line individually, and everything seems to work fine. But when I add them together in a looping program, everything works with the following exception:

    File.AppendAllLines(@"error.txt, currentLine) 

    The program runs, and everything operates perfectly except this one line. I have tried creating a file called error.txt, I have checked other directories for the file, I have tried renaming it. At this point, I feel like it is something obvious I am missing...

    Also, it will run for around 50 lines or so, then randomly break with a message saying "System.IO.IOException: 'The requested operation cannot be performed on a file with a user-mapped section open." But there is no File.close or lines.close (why?)

     var lines = File.ReadAllLines(@"file.xml"); string[] currentLine = new string[] { lines.First() }; if (currentLine.Contains("Error")) { File.AppendAllLines(@"Error.txt", currentLine); File.WriteAllLines(@"file.xml", lines.Skip(1)); } else { File.AppendAllLines(@"NoError.txt", currentLine); File.WriteAllLines(@"file.xml", lines.Skip(1)); } 

    So what I am left with after the program finishes are two files. An empty "file.xml" and a full "NoError.txt" containing all lines with no errors, and a missing "Error.txt"

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

    I want to know the problem in my code please (c++)

    Posted: 06 Apr 2018 06:39 PM PDT

    include <iostream>

    include <cmath>

    include <iomanip>

    include <limits>

    using namespace std; int main() {

    char choice; char q; const double pie = 3.14; const double k = 6.6742E-11; double gforce; double r = 0; double distance; double x1, x2, y1, y2; double length, width; double M1, M2, d; do { cout << "_____" << endl; cout << "MENU" << endl; cout << "_____" << endl; cout << " (A or a) Area of a Circle " << endl; cout << " (D or d) Distance between two points, (x1,y1)and (x2,y2) " << endl; cout << " (P or p) Perimeter of a rectangle " << endl; cout << " (F or f) Newton's Law of Force " << endl; cout << " (Q or q) to terminate the program enter q " << endl; cout << " Please enter your choice: "; cin >> choice; if (choice != 'A' || choice != 'a') { // calculates the area of circle cout << " You have entered A. Area of a circle will be calculated" << endl; cin.clear(); cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); cout << " Please Enter the Radius(R): "; cin >> r; cout << " -------------------------------------------------" << endl; cout << " Area of a circle is: " << pie * pow(r, 2) << endl; } else if (choice != 'D' || choice != 'd') { //calculates the distance between two points cout << " You have entered D. The distance between two points will be calculated." << endl; cin.clear(); cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); cout << " Please Enter the x2, x1 ,y2, y1: "; cin >> x2 >> x1 >> y2 >> y1; distance = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2)); cout << " -------------------------------------------------" << endl; cout << " The distance between two points are: " << distance << endl; } else if (choice != 'P' || choice != 'p') { //calculates the perimeter of rectangle cout << " You have entered P. Perimeter of rectangle will be calculated" << endl; cin.clear(); cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); cout << " Enter the lenght and width of rectangle: "; cin >> length >> width; cout << " -------------------------------------------------" << endl; cout << " The perimeter of rectangle is: "<< 2*(length+width) << endl; } else if (choice != 'F' || choice != 'f') { // calculates the newton's law of force cout << " You have enter F. – The force between the bodies calculation." << endl; cout << " Please Enter M1 M2 d:"; cin >> M1 >> M2 >> d; gforce = k*((M1*M2) / d); cout << " Mass of the 1st object is: " << M1 << endl; cout << " Mass of the 2nd object is: " << M2 << endl; cout << " The distance is " << d << "meters" << endl; cout << " The Gravitational Constant is 6.6742E-11 Nm^2/kg^2" << endl; cout << " -------------------------------------------------" << endl; cout << " Gravitational Force is: " << gforce << endl; } else { cout << " You have Enter Invalid Number"; } } while (choice != 'Q'); system("pause"); return 0; 

    }

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

    Need ideas for senior capstone projects that involve programming

    Posted: 06 Apr 2018 02:52 PM PDT

    I'm a senior in high school, and I've been studying web development for about a year now and would like to use the skills that I've learned on my senior capstone project. Most of my classmates are doing fundraisers/events to help an organization/cause. One of my ideas was to help non-profit organizations with their websites through Github, but I have had a hard time finding projects to contribute to. If anyone has any ideas for a senior capstone project that involves programming, please share!

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

    Is it natural to forget algorithms?

    Posted: 06 Apr 2018 10:08 PM PDT

    Do programmers use references before writing code? I tend to forget the code for some specific algorithms after some time. I studied the merge sort algorithm for example about 6 months ago, I at least remembered the concept but had difficulties translating it to code.

    What advise would you give to a self taught developer without a degree who is interested in building a desktop application?

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

    Any resources for college-level C++ help?

    Posted: 06 Apr 2018 09:58 PM PDT

    I don't want to spam this sub with essentially homework questions but I'm feeling lost and need some sort of resource. Any suggestions?

    EDIT: Java, not C++

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

    My Naughtiness Skills Are Failing Me

    Posted: 06 Apr 2018 09:55 PM PDT

    I am the sort of person who uses chrome likes to press "inspect" on the generic right click menu. (f12 also works.) One website I like to do this on is https://onlinesequencer.net . So much so, in fact, that it nearly single-handedly taught me how to JavaScript, and the creator of the website even once added one of the hacks I made into the website. However, this post is not going to be about me and my amazing ego, but instaid about a problem I am stuck on. You see, I was trying to come up with some code to count to 10 in chat. An easy area to test this in is https://onlinesequencer.net/chat/ . My current best shot looks like this:
    function sleep(m){var s=new Date().getTime();
    for(var i=0;i<1e7;i++){if((new Date().getTime()-s)>m)
    {break;}}} //code I stole from googling
    var wat=document.getElementById("message"); //for some reason you have to open the message box in the elements viewer for this to work, generally same with JQuery. I would like that explained as well.
    for(j=1;j<11;j++)
    {wat.value=String(j);sendChat();sleep(1000);disabled=false}
    The output I get is a "1" being sent into chat, and then the JS console returning "false". Don't worry, I am not planning on spamming chat using this. (I could if I wanted to using vbscript.) However, I was wondering if anyone knew what I am doing wrong. Thank you.

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

    How is this "SELECT FROM( SELECT ...) giving me results in opposite order??

    Posted: 06 Apr 2018 09:42 PM PDT

    SELECT @rownum := @rownum + 1 AS rank, clientID, odtime FROM( SELECT c.id as clientID, r.time as odtime FROM request r INNER JOIN client c ON r.client = c.id INNER JOIN pickup p ON r.id = p.request INNER JOIN driver d ON d.id = p.driver WHERE r.date = '2018-04-18' AND d.id = 2 ORDER BY odtime ) tab 

    The inner SELECT statment works perfectly, however, when I add the overall select statment, I get the results in the opposite order. Essentially the inner table is grabing some data in a specified order (by the time) which works like I said. I think run a SELECT over that with a rownum counter, however, the output of it all is the rownum (rank) counter being right, but the table is now in OPPOSITE order.

    EX. the inner select gives me the ClientIDs in order of {5, 9, 3} Which is right. But then the whole thing together gives me the clientIDs in order of {3, 9, 5} which is backwards

    EDIT: I can't set the outermost select to be another ORDER BY odtime, because that ruins the order of (rank) counter I set to begin with [the point of this is to keep the order of the inner select and run a counter for a new column]

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

    Coders, what language do you suggest to learn first and why?

    Posted: 06 Apr 2018 05:43 PM PDT

    Im looking into bootcamps and future career paths in the IT world. Im very new to this and i believe that the question i'm asking here is to get a brief insight into what you believe is the best language to start with, and why.

    A brief background (very brief): owned and ran a restaraunt in Paris that failed and now looking into different fields in tech industry.

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

    Personal Side Project Help - Video Game Collection Web App

    Posted: 06 Apr 2018 01:53 PM PDT

    I'm kind of new here, and I'm looking to work on a side project to help build my portfolio as I search for a job in software development.

    My current idea is to build a simple web application to keep track of my video game collection. I'm primarily doing this to get some experience with SQL by utilizing it to store information about the games I own.

    I want to start small, so for now I'm planning to only have this for personal use.

    My current choices for programming languages are HTML, CSS, JavaScript, PHP (for server-side stuff), and SQL. I plan on using Atom as my text editor and MAMP Pro to run the project locally on my machine.

    I am curious as to whether or not I'm missing any other technologies or tools before I get started on actually designing and developing the project.

    (And if I'm not asking in the right place, I would greatly appreciate being pointed in the right direction. I'm already considering asking over at r/webdev.)

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

    having some trouble with my python homework.

    Posted: 06 Apr 2018 08:59 PM PDT

    the program is supposed to ask the user to enter a zip code. Then the program will tell the user what city and state the zip they entered is in. I posted this on here the other day and got some good help. Just trying to get it done for a better grade in class.

    this is what I have so far https://pastebin.com/EvgAc0Xe I feel that Im really close but I can't put the last pieces of the puzzle together. Any help is appreciated, thanks.

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

    Help with LUA modules

    Posted: 06 Apr 2018 08:10 PM PDT

    I have two files Main.lua Function.lua

    when I run Main.lua it tells me "module 'Function' not found."

    This is Main.lua

    local f = require("Function") f.me() 

    This is Function.lua

    M= {} M.me = function() print("me") end M.you = function() print("you") end return M 
    submitted by /u/Polskihammer
    [link] [comments]

    Does anyone know of a good programming skills 'checklist'?

    Posted: 06 Apr 2018 04:58 AM PDT

    Not so long ago I was trying to advance my skills in excel and came across a handy website (link below). The person who runs the site had created skills checklists for Microsoft Office.

    http://danarmishaw.com/ms-office-skills-checklists/

    There are mostly 3 lists each, including for excel. The beginner checklist has skills as basic as 'enter a cell value' whilst the advanced one had skills such as vlookup and pivot table.

    Does anyone know of a similar checklist or bulletpoint list for programming?

    I appreciate due to the vastness of programming such a list could never contain everything (neither does the excel checklist, I imagine), especially in the advanced topics, but perhaps at least most beginner and intermediate, or just an overview of the most commonly used beginner, intermediate and advanced.

    In terms of a specific language I was looking for something for Python

    Thanks for reading.

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

    Need help!! Pseudocode Arrays

    Posted: 06 Apr 2018 07:44 PM PDT

    Need help on arrays. How do I compare numbers in a single array and see if a number is duplicated? (In pseudocode)

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

    No comments:

    Post a Comment