• Breaking News

    Monday, May 7, 2018

    Is it common to have wildly variable productivity? Ask Programming

    Is it common to have wildly variable productivity? Ask Programming


    Is it common to have wildly variable productivity?

    Posted: 07 May 2018 02:57 PM PDT

    Sometimes I burn through code like a hawaii lava flow. Other times my brain just can't get in the zone sometimes for hours on end and it's incredibly frustrating. I figure as long as I deliver it's fine, but I worry that I will be caught goofing off during the time when my brain does not want to cooperate. That said, I am good at my job and I don't have doubts about my overall performance. Does anyone have wisdom when when it comes to unpredictable output?

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

    Passing PHP variable to C?

    Posted: 07 May 2018 04:34 PM PDT

    Hi everyone, apologies if this question is stupid but here goes...

    Working on a project for school, required to use a Raspberry Pi and a breadboard to control some LED lights with the command line and with a webpage.

    I'm currently stuck on one particular part, where I am using a text box to input a value that will be used to tell the LED light how many times to blink. (If I enter 5, i want the light to blink 5 times). I am currently trying to use PHP to execute the blink program, while taking the user input value from the website to pass into the blink program as a parameter.

    The program works as intended if I execute it directly from the command line. I am able to enter a value, and the light will blink accordingly. If anyone has suggestions or perhaps a different way to go about this I would greatly appreciate it!

    Thanks in advance!

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

    c++ code loops X times, depending on how many characters were entered. I just need it once.

    Posted: 07 May 2018 10:04 PM PDT

    This is just one part of my code that I can't get working right. If I enter "asd" for example. It will print "Invalid Entry" and "How many would you like to purchase", 3 times. This is because I have entered 3 characters. If I enter 7 characters, it will do that 7 times.

    I just need it go through once and disregard a non-int entirely.

    Is there any way I can fix that here? The rest of my program is like 300 lines and it's kind of a mess, that's why I didn't post the whole thing. I need the user to enter an integer here, that's why I have it loop if they enter anything other than an int.

    Thanks, any help or tips would be greatly appreciated.

    #include <iostream>

    #include <vector>

    #include <iomanip>

    using namespace std;

    int main()

    {

    int purchase_amount;

    bool n=true;

    while(n)

    {

    cout << "How many would you like to purchase? " << endl;

    cin >> purchase_amount;

    while(cin.fail())

    {

    //Makes sure that user enters an integer.

    cout << "Invalid entry" << endl;

    cout << "How many would you like to purchase?" << endl;

    cin.clear();

    cin.ignore();

    cin >> purchase_amount;

    }

    }

    return 0;

    }

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

    Are there ways to encrypt code?

    Posted: 07 May 2018 12:58 PM PDT

    If not, how do software developers protect their ideas? Is it all patents?

    If there is a way to encrypt code, is there an easy way to do it with my python code?

    EDIT: For people in the future who find this thread, the concept I had in mind is apparently called "obfuscation".

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

    Why does installing python install c headers?

    Posted: 07 May 2018 05:36 PM PDT

    What would you use them for? A thorough example or tutorial online somewhere of them in use would be amazing.

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

    How to prepare to apply to software related internships?

    Posted: 07 May 2018 01:27 PM PDT

    Hey guys, I just finished my two years of general education and computer science related classes (intro C++, OOP C++/ Java, Data Structures C++, Intro to Unix, Assembly Language, Intro to Python). I got accepted to a CSU and will finish my degree there possibly in 2 years maybe 3 (Slow and steady and trying to do it right). Anyways my father is a EE and has told me to start applying to some internships. My question is what things should I write down in a bullet points in which to cover my bases before applying to any internship. I want to well prepared for anything such as having side projects, knowing technical questions for interviews, connections...etc. Any type of resources, tips, stories, websites will be greatly appreciated. Last question, I'm a quiet and very to myself person. How would I go about trying to get connections and knowing people in the industry, starting from nothing how would I start ? Finally I don't care about pay, I just want some related experience when I graduate and not a list of all the warehouses i been working at lol. Thanks for reading this mess!

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

    [GOOGLE MAPS API] Function to close an infowindow on marker click

    Posted: 07 May 2018 03:34 PM PDT

    I have a task to close the infowindow of the marker i click by clicking on the same marker again. I tried creating a new 'click' listener that closes the window but it doesn't work. Does anyone have an idea?

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

    Looking to make a Bank Account "Emulation"

    Posted: 07 May 2018 06:54 PM PDT

    I had the idea recently of making a piece of software that lets me create fake accounts to store money in and access that money like it's in multiple accounts rather than having to open multiple accounts. Is there any existing software that does anything like this or interfaces you all have had to work with for dealing with banks/money before that I should know of?

    submitted by /u/6XAM
    [link] [comments]

    Blocking DLL injection?

    Posted: 07 May 2018 06:36 PM PDT

    I read something about how Google is going to block third-party DLLs from being loaded into chrome starting with chrome 72, and I was curious on how they intend to do it, and if there are any other methods of blocking DLL injection or making DLL injection more difficult so that you could, for example, make it more difficult for malware to inject itself into your program.

     

    After looking around a bit I found this link that indicates that chrome's current DLL blacklist functions by hooking NtMapViewOfSection and examining the DLL to be loaded against the blacklist. Is that likely how their DLL whitelist would work, but in reverse (i.e. it would intercept all calls to NtMapViewOfSection to the chrome.exe process and block any that weren't signed instead of allowing anything that isn't in the blacklist)?

     

    If that is how it works, wouldn't this method be vulnerable to a third party simply tampering with the chrome executable or any of the default DLLs to insert whatever functionality Google wants to block into the program directly? Is there any better, more foolproof way to block all non-whitelisted DLLs?

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

    Is my current language good for future?

    Posted: 07 May 2018 11:03 AM PDT

    Hey guys.

    I've studied C#, but I want to know if that is enough for my future or should I switch to another language?

    I'm a guy who likes to learn new things and try new things. I'm always changing my "habits", to try another stuff who looks good to me. :)

    What you guys recommend?

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

    Find the Hottest average of 7 days?

    Posted: 07 May 2018 06:03 PM PDT

    I have some arrays of days and temperature. They're large arrays, 176795 is the length.

    How might I properly loop over the arrays in Java to find the hottest stretch of 7 days over the several years of data?

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

    Remote Control with XBox controller

    Posted: 07 May 2018 01:48 PM PDT

    I have a friend trying to control two motors with an xbox controller and she's stuck right now. Basically the code only reads the initial input but won't continue reading it being held down. She's writing in python if that helps at all. Is there any way for the code to continue on a loop and read until buttons are released?

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

    What is the simplest way to schedule a Python script to run even if my computer is off?

    Posted: 07 May 2018 08:48 AM PDT

    I have written a Python script that aggregates data from a few API's , does some analysis, and then prints out to a Slack channel. I've scheduled it to run every few hours using Cron but now I would like to enable the script to run even if my computer is off.

    I've researched setting up a virtual private server (VPS) or hosting the script on AWS/Digital Ocean but I am curious if there is a more light weight solution.

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

    [VB] How to make an admin login form on Visual Basic 2017 that links with access

    Posted: 07 May 2018 07:24 AM PDT

    Ive been working on a project that allows me to store, edit, view and delete data in an access file without opening the access file. I have pretty much completed the project except for getting an admin system working. I have a log in screen but I want to make it automatically detect if the login details are of an admin and give me a boolean function for if the user is an admin e.g. admin = true .The access database has a field called admin and it is a check box but I dont know how to read it. This is the tutorial I used for the log in screen. If anyone has any resources that can help me then please share them, thanks.

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

    What's Wrong With My Code - Python

    Posted: 07 May 2018 09:53 AM PDT

    age = raw_input("What is your age?")

    if age > 120:

    print "Do you think I REALLY believe that you are THAT old?" 

    elif age <= 4:

    print "I don't think you are really " + age + ". Please tell the truth next time!" 

    else:

    print "Cool, so you are " + age + " years old."

    The output is always "Cool, so you are (age) years old" no matter what number (or characters) I enter.

    Also, what free online python interpreters do you recommend? I've been using this one:

    http://mathcs.holycross.edu/~kwalsh/python/ and this:

    https://trinket.io/python

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

    [VB] How to put validation on a date picker to make sure the date entered isnt in the past

    Posted: 07 May 2018 02:58 PM PDT

    I have a program that is linked to an access database. I have made a date time picker so that the user can enter a new date into the access record along with other information. I want to know if I can validate this date by putting a range check on it to make sure that the date isnt in the past. If thats too difficult I will pick todays date and make sure that it isnt in behind that date. Anyone have any resources to help me do this?

    I am using VB because its for a college project and its the only language I know. The whole class has to use one language so we went with what our last teacher taught us which was VB. It was most peoples first intro to coding and so its the only language we know

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

    Designing a searchable database

    Posted: 07 May 2018 08:51 AM PDT

    I am a current medical student with little to no prior experience in programming or coding who is trying to design a personal searchable database to help me with rotations next year. So, I've got a couple of questions.

    Basically, I want a database that will list diseases and symptoms by frequency. For example, if I wanted to know the top causes of polymigratory arthritis, I want to be able to type that term in my database and get a list of diseases that cause it in order of frequency. I also want a column showing what percent of that symptom is caused by those diseases. Likewise, I want to be able to search up a disease and get a list of the top symptoms associated with it by order of frequency, with the accompanying percentage column.

    I also need the database to be dynamic (pretty sure that's not the technical term), since those same diseases may be associated with other symptoms as well and vice versa (and consequently would have different columns listing the percent frequencies).

    So I guess my questions are: 1) Is there a simple, user friendly database (preferably free) software out there that is best suited to my needs? 2) Given how I want my database to function, how do I go about developing it?

    Thanks.

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

    How do I write a Stylish rule to apply to a locally stored file?

    Posted: 07 May 2018 06:07 AM PDT

    In Firefox/Stylish, how do I write a rule to apply to a locally stored file?

    @-moz-document url-prefix("file:///home/user/path/filename.html") ... ?
    @-moz-document url-prefix("file://home/user/path/filename.html") ... ?
    @-moz-document url("file:///home/user/path/filename.html") ... ?
    @-moz-document url("//home/user/path/filename.html") ... ?
    @-moz-document url("/home/user/path/filename.html") ... ?

    Etc.?

    I have no idea what I'm doing, or where to read more, or even how to properly google more info.

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

    How long would it take you to complete an iOS version of an app, such an Tinder, after completing the android version?

    Posted: 07 May 2018 08:11 AM PDT

    Need help with arrays in javascript

    Posted: 07 May 2018 05:24 AM PDT

    I want to make a site/program that starts with 100 houses in a city where one person lives in each house. One day comes a zombie and greets in a randomly selected house. After the visit, the owner of the house is infected and we have two zombies going next round. Run as many rounds as required until all homeowners have become zombies.

    https://pastebin.com/Adw6Csk2

    this is what i got so far, the problem i have now is that even if a zombie selects an already infected house it pushes a new zombie to the array, so the array is always going to expand exponentially...

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

    Reddit fam. Please help me! Related: Thymeleaf Springboot based API.

    Posted: 07 May 2018 05:21 AM PDT

    I just got a new job somewhat related to coding but i have been trying to get into the development team.

    So today my boss called and gave me a project. If i complete it in two days then i am in. So i need your help.

    The project:

    The instructions were not really clear. I have to basically create an API which will be used to post on twitter. This should be behind a login page. The tools that i have to use are java, AngularJS, thymeleaf and springboot. I was also advised to use postgres for DB. I don't need anyone to do it for me. I just want someone to point me in the right way and sort of guide me.

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

    Nodejs tutorials

    Posted: 07 May 2018 09:05 AM PDT

    I'm needing to learn nodejs and express for an internship starting in just over a month's time. Does anyone have any recommendations for good online resources i can make the most of and/or books.

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

    Knuth's Art fo Computer Programming: AKS algorithm

    Posted: 07 May 2018 05:00 AM PDT

    Hello! I've got to write a lengthy paper on that algorithm and also implement it, and I've been told that I should look in Knuth's book. I can't seem to find it there. I've got volume 2, 3rd edition, it should be there, but I think it's not?

    Unless you can find it for me, which would prove that I'm blind, can anyone recommend me other books on that algorithm?

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

    Conway's Game Of Life - Reduce time complexity

    Posted: 07 May 2018 07:56 AM PDT

    Hey everyone! As everyone knows the easiest (and probably most intuitive) way to simulate Conway's Game Of Life is to iterate through a 2d array (or array of an array) with two nested for loops. Today I got the assignment to implement the same thing with a complexity equal to or better than O(n log n) were n is the amount of living cells. I also shouldn't use an array and the whole thing should be done in Java. So far I haven't really found a way to implement this. Has anyone got a hint or maybe an alternative data structure which may be suited for this? Thanks in advance!

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

    No comments:

    Post a Comment