• Breaking News

    Wednesday, January 31, 2018

    Constructing my first serious project repo on Github and have a couple questions concerning project architecture. Ask Programming

    Constructing my first serious project repo on Github and have a couple questions concerning project architecture. Ask Programming


    Constructing my first serious project repo on Github and have a couple questions concerning project architecture.

    Posted: 31 Jan 2018 03:26 PM PST

    I've spent ~4 years of my coding life through university doing research based coding and nothing large scale for external use. I haven't had luck googling the following questions:

    1) Why and what does it mean to build/make a full project? Why can't you just download it and use it?

    2) What's the general rule on what to keep in the src folder?

    3) We are using caffe2 and have it installed. Should we include it in the project files or should we expect users to install it themselves? Sort of references question 1.

    Thanks for reading.

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

    How does one write a procedure for a programming project?

    Posted: 31 Jan 2018 05:29 PM PST

    I used Python and programmed a neural network for some basic classification. Now, I need to write a procedure to go into a lab report and have no clue how. I'm assuming I don't just paste my code, but I can't find any good examples of procedures.

    Any help is much appreciated!

    submitted by /u/Google_-_Ultron
    [link] [comments]

    Nested IF statements python, not working for me.

    Posted: 31 Jan 2018 09:01 PM PST

    Hello, I recently started learning python I was learning Nested IF statements but I couldn't get this to work. Let's say I made total = to 20. It would then display "Value is 20". But if I change it to anything else it jumps straight to the "Could not find true expression" idk why this is happening. Im using pycharms.

    total = 30 if total == 20: print("Value is 20") if total < 20: print("Value is less than 20") elif total > 20: print("value is higher than 20") elif total == 30: print("Value is 30") else: print ("Could not find true expression") 
    submitted by /u/givemeachickennugget
    [link] [comments]

    Intel vs AMD for programming & co

    Posted: 31 Jan 2018 05:12 PM PST

    Hi all!

    I am figuring out a new build for me. My current options are:

    • R5 1600 + MSI B350M Mortar (250€)
    • i5 8400 + MSI Z370M Mortar (300€)

    What would be a better choice for me?

    Ryzen has many more threads and can be overclocked with an additional cooler (extra 40€), while Intel has per default higher clock. So, if I buy an aftermarket cooler, Ryzen has no price advantage anymore. Intel also does not have memory and stability issues Ryzen has (I was told both MSI and ASrock boards are kinda buggy). I am not sure how these two processors compare in my situation, because everyone does only gaming and rendering benchmarks...

    I do not game, I do not render. I need a PC for programming and the usual stuff. I have a GTX970 which will be used with a 4k monitor.

    Also the memory for the Ryzen CPU might be a bit more expensive than for the Intel CPU, as it needs to be compatible, Samsung b die, or whatever...

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

    Supervisord - Sudo vs user

    Posted: 31 Jan 2018 05:12 PM PST

    I've been trying to get supervisord to run on boot all day now and still can't get it to work. When I run supervisord as user the program that supervisord is running on startup breaks because the environment variables aren't being passed to it.

    I can get everything to run just fine when I run it as root: sudo su /usr/local/bin/supervisord -c /etc/supervisord.conf

    But it won't work if I run it as user. Even if I add sudo, such as sudo /usr/local/bin/supervisord -c /etc/supervisord.conf

    Does anyone have any idea why it would be doing this? I though sudo su and using sudo prior to a command were the same.

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

    How do I legally repurpose a GitHub repo for my own purposes(possibly commercial)(Apache 2.0)

    Posted: 31 Jan 2018 05:05 PM PST

    https://github.com/googlecodelabs/tensorflow-for-poets-2

    This is the repo in question. It has the Apache 2.0 license

    I'm making a project using image classification, and since our group members only know the very basics of using Android Studio, we just copied the tflite app and have currently added TextToSpeech and changed the name and icon to show in our project.( There a few more components of the project but they aren't relevant to my question.)

    Now, I want to host the edited app on GitHub so that my team can work efficiently on it. We have just been using Google drive or sending each other zips of the .java files

    How do I declare on readme for my new repo, that we have taken majority of the code from tflite?

    How do I declare that I'm not stealing their code? ( I have no issues with giving them credits, I just want to make sure my GitHub account doesn't get taken down for DMCA or something)

    Is there a guide to refer to about what I can do in cases like these when using open source software in my projects?

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

    Where can I go to effectively learn good UI design with CSS and Javascript

    Posted: 31 Jan 2018 06:00 AM PST

    I've been using Rails for about 2 years and I mastered backend stuff with database migrations and controllers but I still have no clue how to make a website look good.

    Exhibit A of a failed app probably due to front end design

    This may be a problem with most developers but I want to be able to master both front end stuff and backend stuff.

    Is there a place where I can effectively learn good UI design with CSS and Javascript?

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

    How to hook user javascript in pages using React or Angular?

    Posted: 31 Jan 2018 04:18 PM PST

    Hi guys, especially frontend devs!

    I'm a big fan when it comes to custom per user javascript to add missing functionalities (like, I'd love to add some commands to discord, a "copy thread" function to Facebook, some checklists here and there, etc). I installed Custom Javascript for Websites 2 and had a good time using it on some really basic websites. But now I'm having trouble catching the paint events / VDOM rendering / whatever to do stuff on more advanced websites.

    Of course I still poll the pages many times per second and look for the elements of interest, but that's ugly, inefficient, and may even be bug prone.

    Please help me :)

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

    Windows 7 non intrusive pop up notification

    Posted: 31 Jan 2018 03:39 PM PST

    is there a way in windows 7 to trigger a pop up/notification that would show up on the screen then fade away like the popups from the os but not "tab out" as in change the focused window so for example in a game take control from the game.

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

    I'm looking for some guidance on Webpack

    Posted: 31 Jan 2018 09:58 AM PST

    TLDR: Is Webpack for me and if so how would I go about implementing it correctly?

    I have an application with a structure that looks like this:

    Root:

    allapps.css 

    App 1

    index.html app1.js 

    App 2

    index.html app2.js 

    App 3

    index.html app3.js 

    My big issues are that I have 8 script and link tags in each of the index.html files, all external currently, and a lot of the JS is redundant between the separate apps so I'd like to take advantage of something like Webpack in order to begin creating modules as needed.

    I've watched and read a lot about Webpack but am lost on whether or not using it for something this size would be overkill or worth it, and if it is worth it I think I need an "explain like I'm 5" on including external scripts/styles.

    I've tried this a few times, following a few different tutorials, but I am still so lost.

    Any insight on this would be greatly appreciated.

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

    Questions about building a program using python vs C++

    Posted: 31 Jan 2018 05:12 AM PST

    I work for a computer company and have to look at logs collected off of various machines. The logs are made up of various text files that are compressed into .tgz format. Depending on what I am looking for I may need to get specific information out of multiple log files, which is annoying since some of the files are large.

    I would like to make a program which will extract the .tgz to a designated folder and then have the option to search various logs for information based on what I am trying to do, and dump the information into a text file.

    My question is this: would it be easier or more efficient to only us python? Would it be better to build a python program with c++ extensions? Would it be better or easier to build a C++ program?(I am still relatively new to programming but I find that even though I like python more and find it easier, there are some things I prefer about C++ over python).

    What would your approach be, and why?

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

    Non programmer - what do I need to do in order to achieve a certain action

    Posted: 31 Jan 2018 08:49 AM PST

    Good morning ,

    I have an idea for something I want to set up a website to do however I have no programming experience so I am having trouble looking up the correct terms to start learning what I need to do.

    I want to make a website that compiles certain information from companies and can update the information when the source updates. I want users to be able to search by company or by locations or in a radius of their location .

    My source of this data is a governmental database / search that already does exactly what I want to do however in order to find it you have to know where to look and know what the industry terms are to understand it.

    So my service would be providing a website that uses the data but can explain for people wanting this information on what is going on around them but aren't industry professionals .

    Do you guys know what kind of tool I need to learn to build to do this ? Would I make a web crawler that uses the other website ?

    Thanks for your help

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

    How does gnome terminal track the current working directory of users, even when connecting to a remote computer?

    Posted: 31 Jan 2018 10:25 AM PST

    [Help] Convert two dimensional array to list and then work with that list

    Posted: 31 Jan 2018 09:12 AM PST

    I posted this in another subreddit and I am posting it here too.

    So I am very bad at C and I got this course work that I must do the following: 1. I need to Init a two dimensional array with 'int' elements 2. The elements of the two dimensional array must be transferred to list This kind of list: struct list { int value; list *next; list *front; list *end; };

    1. The elements in the list after transfer must be Sorted like that : "-5, -3, 2, 5, 10"

    2. The sorted list must be saved to file

    3. The saved file should be displayed(read) on the screen.

    I don't have any progress so any help would be appreciated.

    //If you think that my post is not appropriate feel free to delete it.

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

    Question about how to create Spotify Playlists automatically based on data on a webpage?

    Posted: 31 Jan 2018 09:12 AM PST

    Hi,

    I'm new to programming and was wondering what languages I would need to learn to be able to pull specific data(bands) from a webpage (the information in h1 ahref links) and be able to take that data to make custom playlists in Spotify.

    For example, if you search " https://www.johnnybrendas.com/calendar/ " I was wondering how you would be able to take the bands that are listed and then create a playlist in spotify for all listed above.

    What languages do I need to learn to be able to do this. My Longterm goals is to be able to do this for a range of website and venues.

    Any help will be greatly apprecaited.

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

    How Android APP can check if service was paid from Woocommerce Subscription Plugin in Wordpress ?

    Posted: 31 Jan 2018 08:45 AM PST

    There is an APP that has a login, the login show pass if a service is paid. The service is registered in the Woocommerce Subscription Plugin in a Wordpress installation. The login user and password is the same a user registered in Wordpress.

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

    In a dilemma

    Posted: 31 Jan 2018 01:06 AM PST

    I graduated one year ago with a Computer Science degree. I joined a startup company as a FullStack JavaScript developer 3 months ago. I did some in-depth courses on Nodejs, ReactJs after college. I am into JavaScript since one year and pretty much enjoy working with Js. In these 3 months I worked on a real time communication project with Nodejs, Socket.io, MongoDb, WebRTC that kind of stuff. But since now that the project is completed, my boss wants me to work on CakePHP. He gave me 2 days time to learn CakePHP. Now I have nothing against php and its frameworks but I cannot learn a whole new framework of a whole new language in 2 days when I am just starting to get comfortable with JavaScript. I joined the company as a Full Stack JavaScript developer. If I wanted to work on Php then I would have taken courses on php and not js and its major frameworks. I am really confused and don't know what to do now. How do I handle this situation?

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

    Is there any kind of cryptographical structure with properties allowing the following features without giving away metadata?

    Posted: 31 Jan 2018 07:51 AM PST

    So there's a CryptoBlackBox in a position of memory, it can the following abilities

    • CBB.GetData(index, key)

    Returns a piece of data associated with a given index, and a given key,

    • CBB.SetData(index, key)

    Encrypts a piece of data so it can only be decrypted with KEY, and then places it in the Memory so that it can be recalled and decrypted by the index and key, respectively

    CBB.getNextIndex(Returns the next index that is available or NULL if there is no space left to create another index of data within the block)

    It needs to be so that looking at the datablock, it seems entirely random

    It needs to be that getting decrypted data from the block returns garbage if the index and key do not match

    It requires the inability to change the block's cryptodata unless it is called with a proper index and key.

    There can be no list of index of keys anywhere, it needs to be built into the block. Calling and index/key on the block will either return valid or invalid

    Getting a new index from the block will return an index to make sure that any data added using that index will not collide with other encrypted data.

    The length of the data objects stored in the block can have the same length if that makes it easier.

    Basically a block that let you save and record stuff to it, without giving out any information.

    Not even the creator should be able to find anything out from the block, given said creator may have to throw out some magic numbers used in the creation of its structure.

    Hope I'm clear enough. Think of it like a map with methods of data=getData(Index.Key), setData(Index,Key,Data), and getNewIndex(), such that setData won't allow mesing things up if doesn't auth, and you can't get any other information even if you get server access.

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

    Can I write a web app that sniffs + logs in-range wifi networks?

    Posted: 31 Jan 2018 07:37 AM PST

    I have asked this question once before, here and in /r/iOSProgramming but it was geared towards iPhone, as that was the phone I had at the time. (First thread, second thread).

    I have since upgraded to an android phone (Samsung Galaxy A5, 2017), and was wondering whether it would be any eaiser to accomplish what I want to do, by building my own solution, or downloading an app that already exists.

    I would want to be able to log the following:

    • Time and date at which scan occurred

    • SSID

    • Signal Strength

    • GPS Coordinates (Bonus points...)

    Thanks!

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

    Minimum number of train station stops

    Posted: 30 Jan 2018 10:31 PM PST

    I received this interview question and got stuck on it:

    There are an infinite number of train stops starting from station number 0.

    There are an infinite number of trains. The nth train stops at all of the k * 2n - 1 stops where k is between 0 and infinity.

    When n = 1, the first train stops at stops 0, 1, 2, 3, 4, 5, 6, etc.

    When n = 2, the second train stops at stops 0, 2, 4, 6, 8, etc.

    When n = 3, the third train stops at stops 0, 4, 8, 12, etc.

    Given a start station number and end station number, return the minimum number of stops between them. You can use any of the trains to get from one stop to another stop.

    For example, the minimum number of stops between start = 1 and end = 4 is 3 because we can get from 1 to 2 to 4.

    I'm thinking about a dynamic programming solution that would store in dp[start][end] the minimum number of steps between start and end. We'd build up the array using start...mid1, mid1...mid2, mid2...mid3, ..., midn...end. But I wasn't able to get it to work. How do you solve this?

    Clarification: Trains can only move forward from a lower number stop to a higher number stop. We can switch trains at an intermediate stop.

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

    What is the best way to validate the values in a xml file?

    Posted: 31 Jan 2018 03:45 AM PST

    I have an application that reads files in the docbook format. These docbooks contain hundreds of tables .The tables and the table entries are serialized into xml files. I want to know which is the most effective way in which I can check that the contents of the xml file are the same as the contents in docbooks i.e have the values in the docbook tables been serialized correctly into the xml?

    EDIT: I am running my application on .NET (C#)

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

    Would a program take any longer to compile if there were a billion spaces between each variable and a billion empty lines between each line?

    Posted: 31 Jan 2018 12:23 AM PST

    [C] Replacing characters on standard out

    Posted: 31 Jan 2018 12:21 AM PST

    So I am writing a program in C that takes in a few command-line arguments and also reads a file and prints it to standard out. This is my code thus far (I have indicated at the very bottom of the code in a comment where my problem is):

    #include <stdio.h> #include <stdlib.h> #include <string.h> int main( int argc, char* argv[] ) { char* file_path; float a; float b; char filedata[200]; if (argc != 4) { printf("Error: 4 arguments are required.\n"); return -1; } file_path = argv[1]; a = atof(argv[2]); b = atof(argv[3]); if( a == 0.0 ) { printf("Error: bad float arg\n"); return -1; } if( b == 0.0 ) { printf("Error: bad float arg\n"); return -1; } FILE* fp = fopen( file_path, "r"); if( fp == NULL ){ printf( "Error: bad file; %s\n", file_path); return -1; } while( fgets( filedata, 200, fp ) ){ if ( strstr(filedata, "#A#") == NULL ){ printf("Error: bad file\n"); return -1; } if ( strstr(filedata, "#B#") == NULL ){ printf("Error: bad file\n"); return -1; } // Not sure what to do here....... } printf("%s", filedata); } fclose(fp); } 

    What I'm trying to do now is modify the script that is printed on standard out. Specifically, wherever there is a "#A#" or "#B#" character in the file, I want to replace it with the float values of a and b respectively that I have implemented at the beginning of the program. These float values should be up to 6 decimal places long but I don't really believe that is my problem. I am more concerned about how exactly I would replace the above characters with the float values.

    Are there any functions in C that can do this? I have googled for functions that can replace characters but to no avail thus far.

    Any help would be highly appreciated!

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

    No comments:

    Post a Comment