• Breaking News

    Thursday, March 14, 2019

    If you're having trouble understanding the fundamental concepts of Git, check out this brief essay by sociologist Kieran Healy. Seeing Git used in a non-prograaming workflow is a great way to step back and see the big picture. learn programming

    If you're having trouble understanding the fundamental concepts of Git, check out this brief essay by sociologist Kieran Healy. Seeing Git used in a non-prograaming workflow is a great way to step back and see the big picture. learn programming


    If you're having trouble understanding the fundamental concepts of Git, check out this brief essay by sociologist Kieran Healy. Seeing Git used in a non-prograaming workflow is a great way to step back and see the big picture.

    Posted: 13 Mar 2019 04:17 PM PDT

    (http://plain-text.co/keep-a-record.html)

    Healy explains it in a section of a larger tutorial on building a workflow for composing scholarly works. His target audience is tech-competent scholars who are trying to escape from MS Word hell. Really unique perspective from an obviously smart dude. It's one of the most lucid I've read, and speaks to the intuition more quickly than the technical (but necessary) treatments taught to programming students.

    Edit: AH that's a bad typo oh well on mobile

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

    [Progress Update #1] Fish detection, tracking, and classification in real-time.

    Posted: 13 Mar 2019 09:16 AM PDT

    This isn't so much a question topic, but rather a post showing the progress of my thesis as I implement and test it. I've been a long time lurker of this subreddit but I do help people in here from time to time. Also, this is where I began learning to program before I got into computer science.

    The goal for the thesis is to provide real-time detection, tracking, and classification for fish swimming in tanks. These are the results so far. Detection is working quite well, I can post a different video showcasing how it is behaving (background subtraction through AGMMs). Now I have started to implement basic tracking. At the moment overlapping or crossing fish are not treated.

    A video showcasing the tracking can be seen here. Colors of each bounding-box indicate each unique track. Color changes indicate that the tracking thinks it is a different fish. At the moment the tracking is done through simple feature matching (bounding boxes and color histograms). Also, the white flickering around a bounding box indicates that the tracking was done through particle filtering rather than based on detection (in cases where it does not detect a fish, which happens when it is static for a considerable amount of time).

    Note: although it is processing a pre-filmed video (ignore the timestamp, the camera was set up incorrectly), it is being processed as a real-time video stream. Currently, the program is able to run at around 10-15hz, but no optimizations have been done and only a single processor core is being used (no GPU).

    Any questions or comments are welcome, and I'll try to delve into more detail if necessary.

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

    Programmer Burnout

    Posted: 13 Mar 2019 02:37 PM PDT

    I hear a lot about programmers getting burnt out at their jobs and regretting ever becoming a programmer. Is this just how it normally goes? Would really like some honest answers before I go any further into learning code.

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

    Java interview questions

    Posted: 13 Mar 2019 11:52 PM PDT

    Hey all just got back from a java interview, didn't go very well. I took a picture of the question in the hopes of understanding how to solve it but I still cant wrap my head around it, can anyone provide the solutions.

    You are given an array on integers n length n for a driver. The integer at index i symbolizes the time allocated to her or his i'th task in minutes. The optimal time for a break s between two tasks i and i+1, when the sum of all tasks from 0 to i equals the sum i+1 to n .

    Write a method that returns index i where the condition above is met. If there is no such index the driver is not awarded a break and the method returns null.

    Example

    Input [1, 4, 1, 3, 1] -> Output 1

    Input [1, 4, 1, 3] -> Output null

    Bonus:

    Can you find a solution that efficiently handles 3, 4, ..., m breaks ?

    Thanks in advance!

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

    I need a graphical interface, do I need to switch languages?

    Posted: 13 Mar 2019 10:42 PM PDT

    So far I've done all of my programming in python 3. I've gotten comfortable with it and understand the basics of programming and have made some fun little text only programs, i want to step things up and start having a graphical interface. My plan at the moment is to make a Tetris-like game.
    However to do this I'm going to need a way to display the screen, I'm sure there is a way to do this in python, but it doesn't seem like it's the best choice, would it be better to switch to a language that has a display built into it? The first 2 languages I know of that this applies to would be JavaScript and Visual Basic.
    I feel like there's a pretty good chance I simply don't know something and that it's super simple to make visuals in python or that all languages require me to do something special to not make things just appear as regular plain text that I don't know about so I've just assumed languages I don't know happen to have this capability.

    TL;DR: For the first time since I've started learning how to code I'm needing something that doesn't just display text on a screen and so I need a visual output method for my pet project. I'm not sure if python can do this easily or if I should use a different language for it. Since I've never done anything with graphics I'm not entirely sure what this will entail yet

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

    How to change a default app by file type using cmd/batch or python?

    Posted: 13 Mar 2019 10:19 PM PDT

    I would like to quickly change my computer default app by it's file type. For example I would like to change ".pdf" files to open using "revu.exe". I tried the following code in cmd and had no luck. The desktop seems to refresh but then when opening a ".pdf" it still opens with adobe acrobat.

    FTYPE PDFfile = "C:\Program Files\Bluebeam Software\Bluebeam Revu\Revu\Revu.exe" "%1" ASSOC .pdf=PDFfile

    Thank you for your comments/solutions!

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

    First technical interview of my life tomorrow

    Posted: 13 Mar 2019 04:12 PM PDT

    So this post isn't really a question per se, but more of a general update from a fellow learner, and a thank you to this sub.

    So I've been on and off with coding for a few years, always having the interest, but getting defeated by lack of motivation and no general sense of direction. Somewhere around last August I decided to do a dedicated run for this world that I wanted to break in to, but never did, so I started doing some simpler tutorials online after work, and during when we had a slow day.

    After maybe two months I felt like I was getting in somewhat of a groove, albeit not as consistent as I'd hoped for it to be, and then I stumbled upon a podcast called "learn to code with me" (I'm not paid or anything to promote it, I'm just a genuine fan), which was super inspiring to listen to while I was working. (Basically a bunch of interviews with people who had shifted into tech careers and how they did it. I truly recommend listening if you need inspiration and haven't listened to it yet.)

    Fast forward to January and I start trying to network in my fairly small town that doesn't have all too many tech companies. I met with the CEO of one company and chatted about my ambitions for about an hour, where we concluded that their company may not be a great fit due to them outsourcing themselves as experts (having a lot more experience than I do), but lucky for me, her husband was also in tech and she told me that she'd let him know about me and see what he could do.

    I got an email address and I was so stoked that I was making any kind of headway instead of just getting a door slammed in my face (figuratively, of course).

    So I sent out an email and a few days later got a call where they asked me to come in for an interview a week later to see what my plans and ideas are.

    Had a roughly 1 hour long interview where I basically just tried to let them know what I know, and where I want to be at, and that I will work hard to get there (initially I was just hoping to get some form of internship just to get my foot in the door), and I suggest that maybe I could do some form of programming test? They seemed happily surprised by this, and later sent me an email which would give me 24 hours to complete a three part programming quiz when I opened the link.

    That first test was really, really hard. And mostly directed toward CS/Engineering majors (aka a lot of complicated maths just in order to even understand the questions). The first of three questions was relatively easy, especially compared to the other ones, so I finished 1/3rd of the test and sent it in..

    Took probably a week before I heard back, and this time with a proposition that I could do a new test (because the last one was so math heavy and not directly related to their business), and that I had 24 hours to finish a full stack service to handle business cards.

    I was stoked on getting another shot instead of the figurative door slam that I always anticipated somewhere. So I did my best at learning Vue and Firebase to complete the project - which was far from perfect, but a confidence boost nonetheless that I could at least make a working prototype of something real that someone ordered me to do.

    I'm going in tomorrow (it's bedtime where I live) for the technical interview where I will sit down with one of the staffing bosses and two developers to review my code and answer questions regarding it.

    I'm fairly calm right now, because whatever happens happens, and I've already sent in the project so all I can do now is try to be as coherent and easy going as possible and hope that whatever I lack in technical skills I make up for in curiosity and adaptability!

    Honesty this post became waaaaay longer than I anticipated. I just started typing and got in the zone..

    If you wanna wish me luck, please do so. If you want to give me pointers to my first code review/technical interview, please do so.

    If you wanna say something salty in any way shape or form, I mean.. you do you, but I'd recommend for both your and my sake that you don't!

    Whichever way it goes, I'm stoked that I've gotten this far, and not just letting the motivation fade out once more, and a lot of that is thanks to the amazing people on this subreddit!

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

    What is the source of "Made with Love"?

    Posted: 14 Mar 2019 12:37 AM PDT

    In many websites and software, I see this "Made with Love" thing. What does it mean?

    https://i.postimg.cc/gjDyvQM6/madewithlove.jpg

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

    is a good practice convert py packages into exe?

    Posted: 14 Mar 2019 12:32 AM PDT

    Since python is a scripting language, is a good practice to package my python files into an exe? What can be the peoblems of doing that? What are the best methods to do that?

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

    Discrete maths help

    Posted: 14 Mar 2019 12:28 AM PDT

    Hi everyone,

    I'm in my second semester of a Bachelor of IT and I'm struggling with my discrete maths subject. I'm going back to do the maths revision via Kahn academy as it has been 12 years since I did maths B. I was wondering if there were any other online resources that I could use to assist me.

    Thanks in advance!

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

    Advice on displaying images with a description

    Posted: 14 Mar 2019 12:25 AM PDT

    Hi, I am making a static website for a small enterprise that sell jewelleries. Basically, I want a user to click on a image and it getting bigger with a small description below. Don't want a new page to be opened and don't want to get into backends and generating templates. Thanks.

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

    [homework] RSA decryption

    Posted: 13 Mar 2019 08:38 PM PDT

    I have an assignment from school that involves getting a flag from a given question.

    The topic includes RSA decryption given the following values:

    N, E and C

    The hints given are to find the p and q for the encryption, and that the N value is broken and can be found from a database online through a simple search.

    The problem I have is that I am finding it extremely difficult to find the database for the N value. I'm not sure if I'm looking in the wrong place or if I'm going about this wrong entirely. Does anyone have any idea where I may be able to find this database? I can send you the values for N, E and C but I really want to be able to solve this on my own first, or at least attempt to move on from the first step.

    I tried using RsaCtfTool but the modulus was too large for SIQS attack module, so I'm guessing I really have to find the database to find the values.

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

    C++ Development on a MAC. Is there a way to redirect input?

    Posted: 13 Mar 2019 02:37 PM PDT

    Hi there!

    I'm currently doing some C++ programming assignments, and usually on the terminal, I compile the code, and redirect an input file:

    ./program < input.txt 

    However, Vim doesn't have a lot of the good features (ie: auto code complete) that Xcode does. So right now, I'm literally just copying and pasting the input, into the Xcode input box every time I test...which is obviously super slow.

    Is there a way I could redirect the input using Xcode? Or is there another IDE that's better?

    Thanks!

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

    I need help translating this to python

    Posted: 13 Mar 2019 08:34 PM PDT

    Where can I translate this java to python? I know some python but don't have time to learn enough to translate it all. If there isn't anywhere to convert it, would someone who is skilled please be kind enough to help? this is the code: https://pastebin.com/rryRRnPY

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

    Need help setting up python 3.6.3 on Windows 7.

    Posted: 13 Mar 2019 11:43 PM PDT

    It says "cannot install, need sp1". However, I have sp1 installed! I fixed the issue before, but I had to re-do my computer and can't remember the steps I took....something like installing the visual c++ runtime redistributables as well as the .net frameworks....I tried installing them and they said something like "not compatible with this computer". Halp? See log file in comments

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

    How to detect mouse cursor movement in WPF C# application?

    Posted: 13 Mar 2019 11:43 PM PDT

    I want to call a function whenever the user moves their mouse even if it's by one pixel. This detection has to occur even when the mouse is outside of the application window. I tried the following but it's not working.

    private void OnCaptureMouseRequest(object sender, RoutedEventArgs e) { MessageBox.Show("You moved the mouse!"); } 

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

    Wasting system resources?

    Posted: 13 Mar 2019 11:42 PM PDT

    Hello, there. I`m kinda new to programming and there is tonns of stuff i dont know yet. For example:
    I`m making an app for linux, that will works with serial devices. I`m using Qt5 C++. So.. in Qt there is class QSerialPort and it has function "read" which is (obviously) read data from serial device and returns how much bytes was read. The return value type is "qint64".. i mean.. 64 bits? really? Do i get it right? As i understand, inside that function there is a declared variable 8 bytes long for storing number of recieved bytes? Max value is 9 223 372 036 854 775 807.. its 9 exabytes! Isnt it justa waste of system resources? Or i just dont know something?

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

    Creating a jUnit test for this program?

    Posted: 13 Mar 2019 10:55 PM PDT

    import java.util.*; public class CreditHistory { private Queue<Integer> ratings = new LinkedList<Integer>(); public void addRating(int rating){ if (rating > -6 && rating < 6) { ratings.add(rating); } } public ArrayList<Integer> getRatings() { ArrayList<Integer> asList = new ArrayList<Integer>(); asList.addAll(ratings); return asList; } public void trimRatings() { while (ratings.size() > 10) { ratings.poll(); } } public int numOfRatings() { return ratings.size(); } } 

    How would I approach creating a junit test for this?

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

    I need some help with symbiotic differentiation using recursion for c++.

    Posted: 13 Mar 2019 10:52 PM PDT

    It's very rare on Reddit that I go for school help but here goes(This is my first post here). I don't know where to start? I haven't been able to find a helpful example or help for this program assignment let alone My comp sci 3 class. It has also been days and I have made little to no progress. Here are the prerequisites. I'm not sure how to start this program. Any help even pseudo code will be helpful.

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

    Dealing with Tomcat's Catalina.policy

    Posted: 13 Mar 2019 02:05 PM PDT

    Hello I've been writing a web application in Java on Apache. Recently I've been learning how to set up HTTPS/SSL and I did it using Tomcat's built in authentication.

    However that now has created a bunch of problems. It seems that using Security Constraints in the web.xml file also turns on a bunch of other Tomcat features. Therefore the MySQL JDBC connector I use no longer works due to some sort of security problem. Now when I try to connect I get a

    java.lang.NoClassDefFoundError: Could not initialize class com.mysql.cj.jdbc.Driver

    And then

    java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "setContextClassLoader")

    As far as I can tell it may be something to do with Catalina.policy so I have been trying to set up permissions there.

    I think the particular line that needs to be changed is this one. But I have had no luck with it.

    The permission granted to your JDBC driver // grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" { // permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; // }; 
    submitted by /u/mosshadow
    [link] [comments]

    Could someone help explain what this function does in this Huffman coding link?

    Posted: 13 Mar 2019 10:36 PM PDT

    https://www.geeksforgeeks.org/huffman-coding-greedy-algo-3/

    It is the minHeapify function and the extractMin function. I understand the general gist of what this entire code does. I understand what Huffman coding is. I know that extractMin tries to find the node with the smallest frequency, but I am confused as to how the extractMin function they wrote in that link is finding the smallest with minHeapify. I don't understand minHeapify at all. Could someone please help?

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

    [C++] How can I make it so my function is not adding the same songs over and over in a list?

    Posted: 13 Mar 2019 10:17 PM PDT

    Sorry if this post seems a bit long. I have been tasked to store songs into a list (8 slots long) using structs and strings. Each song is given the parameters title, artist and size. My problem comes from the add song function. For some reason, my code is adding the same song into the list 8 times instead of adding different songs each time the function is called. I am also supposed to output a message that states that the song cannot be added once the memory limit is exceeded. The memory size is initialized to 25. My questions are:

    1. How can i get the add song function to work properly as I intend to instead of the same song being put in place multiple times?
    2. How can I properly output the error? I know it's probably simple but I cant seem to understand it.

    I know all of this stuff might be simple for all i know, but I'm just a college student in a basics course. Im trying to do the best I can.

    I hope my problem is clear, I appreciate the help. This sub has really been helpful to me in the past.

    const int NUM_SONGS = 8; //we will have the maximum 8 slots with some slots being empty const int MEMORY_SIZE = 25; //total memory size of tsuPod in MB struct TsuPod { std::string title; std::string artist; int size; }; TsuPod my_pod[NUM_SONGS]; void initTsuPod (const int NUM_SONGS, const int MEMORY_SIZE){ for (int i=0; i<NUM_SONGS; i++) { my_pod[i].title=""; my_pod[i].artist=""; my_pod[i].size=MEMORY_SIZE; } } int addSong (string newtitle, string newartist, int size) { int count =0; while(count<NUM_SONGS) { if (my_pod[count].size > 0) { count++; my_pod[count].title=newtitle; my_pod[count].artist=newartist; } else my_pod[count].title=newtitle; my_pod[count].artist=newartist; } return 0; } void showSongList (const int NUM_SONGS){ for (int i=0; i<NUM_SONGS; i++) { cout<<my_pod[i].title<<" "<<my_pod[i].artist<<endl; } } int retCode = addSong("Runaway1", "Bon Jovi1", 1); //testing successful song addition retCode = addSong( "Runaway2", "Bon Jovi2", 2); showSongList(NUM_SONGS); // to show that I have added one song // I'm adding next six songs successfully retCode = addSong("Runaway3", "Bon Jovi3", 3); retCode = addSong("Runaway4", "Bon Jovi4", 1); retCode = addSong("Runaway5", "Bon Jovi5", 5); retCode = addSong("Runaway6", "Bon Jovi6", 6); retCode = addSong("Runaway7", "Bon Jovi7", 1); retCode = addSong("Runaway8", "Bon Jovi8", 1); retCode = addSong("Runaway8", "Bon Jovi8", 1); retCode = addSong("Runaway8", "Bon Jovi8", 1); showSongList(NUM_SONGS); //showing that I have added successfully 6 songs //testing unsuccessful song addition retCode = addSong("Runaway8", "Bon Jovi8", 1); cout<<retCode << "It was not possible to add songs because memory limit was exceeded" <<endl; showSongList(NUM_SONGS); 

    output:

    Runaway2 Bon Jovi2 Runaway2 Bon Jovi2 Runaway2 Bon Jovi2 Runaway2 Bon Jovi2 Runaway2 Bon Jovi2 Runaway2 Bon Jovi2 Runaway2 Bon Jovi2 Runaway8 Bon Jovi8 Runaway8 Bon Jovi8 Runaway8 Bon Jovi8 Runaway8 Bon Jovi8 Runaway8 Bon Jovi8 Runaway8 Bon Jovi8 Runaway8 Bon Jovi8 0It was not possible to add songs because memory limit was exceeded 
    submitted by /u/Crazedllama5
    [link] [comments]

    [Python] How do I print an absolute value with an if statement?

    Posted: 13 Mar 2019 04:13 PM PDT

    I have to enter integer and then print the absolute value of that integer if its a negative number.

    This is what I have so far:

    number = int(input('Please enter a number: ')) if (number>0): print("Absolute value is ", abs(number)) 

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

    [C#] How do I "log in to" an object in a list so the information stored in the object can be accessed?

    Posted: 13 Mar 2019 01:26 PM PDT

    I need to create a method for logging in to one of the objects.

    This is my code:

    class Program { static List<Account> accounts = new List<Account>(); static void Main(string[] args) { Intro(); Actions(); } public static void Intro() { Console.WriteLine("Please choose one of the following options:\n"); Console.WriteLine("Press '1' to create a new account."); Console.WriteLine("Press '2' to log in to an existing account.\n"); int accessSystem; int.TryParse(Console.ReadLine(), out accessSystem); if (accessSystem == 1) { CreateAccount(); } else if (accessSystem == 2) { LogIn(); } else { Console.Clear(); Intro(); } Console.Clear(); } public static void Actions() { Console.WriteLine("Please choose one of the following options:\n"); string[] options = new string[12] { "Press '1' to switch between accounts.", "Press '2' to check your balance.", "Press '3' to check your debt.", "Press '4' to check your loans.", "Press '5' to check your account's status (activated/deactivated).", "Press '6' to check your account's information.", "Press '7' to check your debit card information.", "Press '8' to check your account's settings.", "Press '9' to withdraw money.", "Press '10' to transfer money.", "Press '11' to check your transfer history.", "Press '12' to check your retirement savings." }; for (int i = 0; i < options.Length; i++) { Console.WriteLine(options[i]); } Console.WriteLine(); int responseIndex; int.TryParse(Console.ReadLine(), out responseIndex); switch (responseIndex) { case 1: //ChangeAccount(); break; case 2: //CheckAccountBalance(); break; case 3: //CheckAccountDebt(); break; case 4: //CheckAccountLoan(); break; case 5: //CheckAccountStatus(); break; case 6: //CheckAccountInformation(); break; case 7: //CheckDebitCardInformation(); break; case 8: //CheckAccountSettings(); break; case 9: //WithdrawMoney(); break; case 10: //TransferMoney(); break; case 11: //CheckTransferHistory(); break; case 12: //CheckRetirementSavings(); break; default: Console.Clear(); Actions(); return; break; } } public static void CreateAccount() { Console.Clear(); Console.WriteLine("Choose how many accounts you want to create."); int antal; int.TryParse(Console.ReadLine(), out antal); while (accounts.Count < antal) { Console.Clear(); Console.WriteLine("Please enter your first name."); string firstName = Console.ReadLine(); Console.WriteLine("\nPlease enter your last name."); string lastName = Console.ReadLine(); Console.WriteLine("\nPlease enter your age."); string age = Console.ReadLine(); Console.WriteLine("\nPlease enter your starting balance."); double accountBalance; double.TryParse(Console.ReadLine(), out accountBalance); Account account1 = new Account(firstName, lastName, age, accountBalance); accounts.Add(account1); } Console.Clear(); Intro(); } public static void LogIn() { } } 

    I really have no idea how to do this.

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

    No comments:

    Post a Comment