• Breaking News

    Wednesday, December 27, 2017

    Learning programming: self taught vs. structured education. What am I missing. Ask Programming

    Learning programming: self taught vs. structured education. What am I missing. Ask Programming


    Learning programming: self taught vs. structured education. What am I missing.

    Posted: 27 Dec 2017 03:16 PM PST

    I am currently in school for a very different field than programming/computer science. I am a senior, graduating in May with a degree in Financial Planning. I've slowly been learning bits of programming through various tutorials for a while now. I feel like I'm missing a lot though. If there is a feature or application I would like to make, I follow tutorials to make that. I hardly am branching out on my own. What am I missing from a structured education that I a missing from teaching myself through various, unrelated tutorials.

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

    I have a problem and need a solution, is it possible?

    Posted: 27 Dec 2017 06:58 PM PST

    Long story short, I have a database with around 100,000 unique numerical entries. I'd like to paste each number into a search field of a 3rd party application and search. Pause for a few seconds. Then check an area on the screen for a visual indicator of a returned result (like 2 different pixel colors indicating text vs 1 color indicating no text. All I need is a true/false result, and log and repeat. Paste, Enter, Pause, Check, Log, Advance, Copy, Select All ... Looped.

    Is this doable? Is it a massive undertaking, or something a pure beginner could piece together? Where would one start?

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

    Creating a Script to Perform Actions in a Database

    Posted: 27 Dec 2017 05:20 PM PST

    I need to enter numbers from an Excel spreadsheet into the search bar of a database to search for a clients information. If a client has a certain category of account, I need to check a box in that section of the database. Is there a script I could run that searches the numbers in the database, then checks the box if it fits the criteria? Not sure if I'm making perfect sense but it seems like it would be fairly simple for an intermediate level programmer. Any help is appreciated.

    submitted by /u/Trundle-theGr8
    [link] [comments]

    Parsing Mysql datatypes to javascript datatypes

    Posted: 27 Dec 2017 09:03 PM PST

    Hey guys so I am making a nodeJS program to create random entries into a mysql database. This requires taking whatever random table is selected and getting every value type expected for every column. This returns values such as char(10) or int(20) etc. Currently what I am doing is splitting the data_type at the parenthesis and then taking the result[0] and putting it into an if statement that will then generate a a random string/int/date/whatever value. There is a problem with this however:

    If a datatype that I don't have an if statement for is returned (example I didn't have one set up for enums then I can not generate a value for it.

    I feel like their has to be a more elegant solution. Are there any libraries out there that can help me? Iv been looking but I can't find anything. Any help or just a point in the right direction is appreciated!

    Example

    var data_type = int(20) var dataArr = data_type.split("(") if(dataArr[0] = "int") { Math.floor(Math.random() * dataArr[1].substring(0, dataArr[1].indexOf(')')) } 
    submitted by /u/Ld436b
    [link] [comments]

    Is it best practice to poll remote servers from a central server, or have remote servers regularly contact the central server? (Apologies for the wall of text!)

    Posted: 27 Dec 2017 08:36 PM PST

    So I have a situation where I have a bunch of dedicated video stream ingestion servers acting as targets for remote clients to stream video to. I also have a "master" server which I will be using to monitor the status and health of the ingestion network. Currently I have each ingestion server sending a heartbeat to the "master" server via UDP which contains the state of the streaming applications for that server (whether it's live, bandwidth stats etc); the "master" server has a Node app running to listen for these health updates and once it receives one, it updates the front end clients / health monitoring systems etc.

    I've done some work with GPS telematics devices in the past and they use a similar model where the server only reacts upon the receipt of a UDP update from a remote device. The main reason I've done it this way is because I wanted the "master" server to only need to do something when it receives a health update from an ingestion server, rather than regularly having to connect to each ingestion server, particularly once we scale.

    However, I've been thinking about it a bit more and I feel like maybe I've done things the wrong way around, since the fact that we need to ensure that our ingestion network is responding is critical. At this point, I can do this one of two ways:

    1. Stick to the current method and react to a lack of updates after a set threshold (say 2 minutes of non-activity) - less load on the "master" server, but less timely catches of down ingestion servers.

    2. Reverse the current model and react to non-responding ingestion servers on every poll - more load on the "master" server, but almost real time notification of down ingestion servers.

    I'd appreciate any thoughts on this, each solution is relatively easy to spin up, but I want to settle on a model before we begin rolling into production and scaling. I'd also like to load balance the whole network eventually, so I'm not sure if that will make a difference when deciding on an appropriate solution here.

    Thanks in advance!

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

    Tinnitus from Coding?

    Posted: 27 Dec 2017 07:27 PM PST

    So I just got into programming this month (taking online courses) and I've noticed at night when I'm work on a project when I'm done and settle in for sleep, my ears are ringing super loud.

    Anyone else get this? Is it too much focus/strain/stress/frustration causing it? Any tips for those who know what I'm talking about and handle it well?

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

    So, I'm going to have a programming exam & the teacher gave us one of the questions we're going to get, What language is used in Windows 7? He said it's either Object-Oriented, Machine Language, Assembly or Basic (Procedural languages) I looked it up & the answers seem mixed. Which one's correct?

    Posted: 27 Dec 2017 02:23 AM PST

    Only one is correct, According to him.

    Also while we're at it, a * b * c is considered processing, Right?

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

    Resource/ book recommendations for refreshing c++ knowledge.

    Posted: 27 Dec 2017 04:40 PM PST

    I learned c++ like almost 2 years ago and have only used it once since. I just got a job that is all in c++. Do you have and good recommendations for someone that does not necessarily need to relearn it but will give me a solid review and ect... Thanks edit: I have been teaching beginner c for the past year and a half.

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

    [Psuedo] Removing duplicates from a list

    Posted: 27 Dec 2017 04:13 PM PST

    Hi everyone, not sure if this is the right place, but here's the question I'm thinking on.

    I have a table of numbers, and each number has 8 possible flags that can be set as either 1 or 0.

    I want to be able to add up all numbers that have any particular set of flags. Lets say 1 1 1 1 0 0 0 0 for this example.

    Because some numbers will have multiple flags, the sum has some duplicates. Right now I'm manually removing duplicates using multiple queried results, but this seems like a poor solution due to the unknown nature of which flags I will want to have set, and the increasing amount of queries needed to find the duplicates as more flags are set.

    Is there a better approach I should try to accomplish this?

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

    Anyone know if someone has made a improved version of MarI/O?

    Posted: 27 Dec 2017 10:23 AM PST

    I want to use it as a idle game just to watch it improve over time.

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

    What does .= do in c++?

    Posted: 27 Dec 2017 12:13 PM PST

    Was asked this at an interview, can't find the answer in a search.

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

    What's the best package for python Hidden Markov Models?

    Posted: 27 Dec 2017 10:27 AM PST

    Hi

    What's the best package for python Hidden Markov Models?

    I want it to be flexible enough so I can specify two models. One module is an HMM and it outputs to the second HMM module. (This would be equivalent to a single larger HMM with 0.0 transitions between the two "modules").

    I want to train these modules to classify examples. I need to be able to create two sets of HMMs with the package. I also want a built-in algorithm/function for training on examples (EM?).

    Thanks

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

    YDKJS problem 1 question.

    Posted: 27 Dec 2017 09:47 AM PST

    I'm doing the first problem given calculating purchases.

    Why does the correct amount to pay not get calculated correctly when I use a function? See my code below with variables and constants set to same amounts in the book. I should be paying $334.76. I only get this amount when I replace calculateFinalPurchaseAmount with amountToPay=amountToPay+(amountToPay * tax);

    Here's my code:

    var moneyInBank=303.91; const spendingThreshold=200; const costOfPhone=99.99; const costofAccessory=9.99; var amountToPay=0; const tax=0.08;

    function calculateFinalPurchaseAmount(amt) { //calculate amount with the tax amt = amt+(amt*tax); return(amt); }

    function formatAmount() { return "$" + amountToPay.toFixed(2); }

    while (amountToPay<moneyInBank) {

    amountToPay=amountToPay + costOfPhone; if (amountToPay<spendingThreshold) { amountToPay=amountToPay+costofAccessory; } 

    } calculateFinalPurchaseAmount(amountToPay); console.log("You pay" + formatAmount(amountToPay));

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

    Help restricting character input in C language

    Posted: 27 Dec 2017 09:14 AM PST

    Hey guys, I'm only on my first semester learning C language and one of my assignements requires me to restrict the user to only input letters and return a message saying something along the lines of "Invalid" when the user inputs a number.

    I've looked everywhere but Im not sure whaat condition to use on "while" or if there is another wway of soing it

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

    SSL broken by mixed content

    Posted: 27 Dec 2017 08:58 AM PST

    I'm a content writer for a start-up who demonstrated a little ability... which mean now I've been tasked with running the entire web operation, including content, design, SEO, programming, IT, analytics, and social media.

    I was able to remove google fonts, some outdated scripts, and all other http content being fed to our website... however, I'm still dealing with ONE image generated by a script/form using an http resource, and it shows on EVERY page.

    I've done the best I can do with what little to no knowledge I have, however, this one has me completely stuck, and it's breaking our SLL handshake, rendering twitter cards and open graph mostly fubar. I've also tried SSL Insecure Content Fixer and Really Simple SSL, but to no avail.

    I'm 99% sure once this http image issue is resolved, we'll have the green SSL lock beside our URL, and the benefits of open graph for social media posts again.

    Website: www.aircharteradvisors.com

    Issue: Mixed content ("Get A Quote Now!" image --- get a quote button.png -- in quick quote frame is http)

    Question: How deep into javascript will I find myself drowning before realizing I have no chance at correcting this, and what would be the best way to approach a fix?

    Thank you in advance, Jack of All Trades, Master of None. Especially this one.

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

    What best programming language?

    Posted: 27 Dec 2017 02:03 PM PST

    Web search engine - ?

    Website building - ?

    Social network - ?

    Video hosting - ?

    AI (3d gaming, OS, utility softwares) - C++

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

    Cannot figure out why navbar isn't working

    Posted: 27 Dec 2017 06:00 AM PST

    I am trying to learn programming and I am following the course @ upskillcourses.com

    I have spent the last two hours trying to troubleshoot a problem without any luck. In the video, we are adding //= require bootstrap-sprockets to our application.js file in order to make the dropdown menu work for when the site is being viewed on a small screen. I did everything he did in the video but my menu will not work.

    Here is my code:

    https://gist.github.com/anonymous/1f8e1446209fd190217f81af3e4f78ba

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

    [java][OOP] Feedback on ORM problem solution

    Posted: 27 Dec 2017 02:44 AM PST

    I am trying to make some changes to the ORM structure at my current organization. Please provide any reviews/feedback, greatly appreciated.

    Problem: I want to encapuslate database access logic out of User.java. User object has properties like address1, address2, city which should be combined into an Address.java object encapsulating its behaviour and move that logic out of User.java. The mapping of Address object to database columns in sql statement should be easy to handle.

    Our current ORM is something like this: UserDBMapper.java: This file has instance varaibles mapping to database . This file is used to generate BaseUser.java. public class UserDBMapper { public static Map<String, String> getTableName() { return "user"; }

     public Map<String, String> getColumnMap() { Map<String, String> columns = new HashMap<String, String>(); columns.put("id", "id"); columns.put("emailAddress", "email_address"); columns.put("address1", "address1"); columns.put("address2", "address2"); columns.put("city", "city"); } public long id; public String emailAddress; public String address1; public String addres2; public String city; } 

    BaseUser.java: This file is auto generated and has methods to create object from ResultSet, bind object to PreparedStatement, select Sql, getter/setter for all instance variables in UserDBMapper, etc.: public class BaseUser extends UserDBMapper { public void setId(long id) {this.id = id;} public long getId() {return this.id;} //getter setter for all the properties in UserDBMapper

     public static User buildObject(ResultSet rs ) throws Exception { User obj = new User(); obj.setId(rs.getLong("id")); obj.setEmailAddress(rs.getString("email_address")); //similarly set all properties return obj; } public void prepareStatement(PreparedStatement ps, BaseUser baseUser) throws SQLException { ps.setLong(1, baseuser.getId()); ps.setString(2, data.getEmailAddress()); //Similarly set all properties in preparedStatement } public void update(Connection conn) throws Exception { PreparedStatement stmt = null; Object rs = null; try { stmt = conn.prepareStatement(getUpdateSQL() + " where id = ?"); this.bind(stmt); stmt.executeUpdate(); } catch (SQLException var9) {} finally {} //I have removed the code for handling errors etc. to keep it simple } //Not providing method implementations to keep it short/simple public static String getUpdateSQL() public static String getSelectSQL() public static String getTableName() public static String getSelectSQL() } 

    User.java: All the business logic goes here as well as any custom sql queries other than simple update, select by id etc. public class User extends BaseUser { //business logic public boolean isPaidUser() public Date getLicenseExpiryDate() }

    Solution I am thinking of:

    UserDBProperties: //This class has getter for properties mapping to database columns. It also enforces constructor signature to be used in User.java, If a new column is added or deleted, there should not be properties mismatch. public class UserDBProperties { protected long getId(); protected String getEmailAddress(); protected String getAddress1(); protected String getAddress2(); protected String getCity();

     public UserDBProperties(long id, String email, String addr1, String addr2, String city) { //do nothing } } 

    UserDBMapper: This file will be autogenerated. This has methods to create object from ResultSet and set object properties in preparedStatement.

    public class UserDBMapper implements DBMapper { @Override public String getTableName() { return "user"; } @Override public String getUpdateSQL() { return "UPDATE user set id=? , email_address=?, address1= ? where "; } @Override public String getSelectSQL(String prefix, boolean distinct){ /*implementation not added*/} private String getFromSQL(String alias) { return " FROM " + getTableName() + " " + (alias == null ? "" : alias) + " "; } @Override public String getInsertSQL(){ /*implementation not added*/} @Override public void prepareStatement(UserDBProperties table, PreparedStatement ps) throws SQLException { ps.setLong(1, table.getId()); ps.setString(2, table.getEmailAddress()); ps.setString(3, table.getAddress1()); ps.setString(4, table.getAddress2()); ps.setString(5, table.city()); } @Override public User buildObject(ResultSet rs) throws SQLException { return new User(rs.getLong("id"), rs.getString("email_address"), rs.getString("address1"), rs.getLong("address2"), rs.getLong("city")); } } 

    User.java: This class extends UserProperties.java and implements all the getters as well as matching constructor. public class User extends UserProperties { private long id; private String emailAddress; private Address address;

     @Override public long getId() { return this.id; } @Override public String getEmailAddress() { return this.emailAddress; } @Override public String getAddress1() { return this.address.getLine1(); } @Override public String getAddress2() { return this.address.getLine2(); } public User(long id, String email, String adr1, String adr2, String city) { this.id = id; this.emailAddress = email; this.address = new Address(adr1, adr2, city); } } 

    UserRepository.java: This class will have all the standard and custom insert/update/delete sql queries.

    public class UserRepository implements Repository { public abstract class Repository<O extends Table, M extends RowMapper> { protected UserMapper getMapperInstance() { return new UserMapper(); } protected void save(User user) { if (user.getId() > 0) { update(user); } else { insert(user); } } protected void update(O entity) { final UserMapper rowMapper = getMapperInstance(); PreparedUpdateCommand command = new PreparedUpdateCommand() { public void bind(PreparedStatement ps) throws Exception { rowMapper.prepareStatement(entity, ps); } }; command.execute(rowMapper.getUpdateSQL() + " id = " + entity.getId()); } } 
    submitted by /u/anishredd
    [link] [comments]

    Program to track time that a specific program has been opened?

    Posted: 27 Dec 2017 12:35 AM PST

    I posted about this earlier but deleted it because I thought I found a solution however I haven't. So let's go.

    Basically I'm looking for a program that will track the time a specific program has been opened, not me actively using it, just the time it has been opened. So it'll also need to be able to track the amount of time the program has been opened by using a list of selectable programs, so long as the current program is open. Which is how OBS does it. I have found no other programs which do this so I'm asking here. Can anyone program a program like this?

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

    Mainframe question

    Posted: 26 Dec 2017 10:57 PM PST

    So not sure how many people would know the answer to this and whether or not the question can be understood without showing pictures but basically I have some include modules that will be called upon in the lib, which will create a pdf of the report. Currently I have it setup as shown, but not sure how "set" works along with variables in mainframe. For example I'm also confused with how SETRPT and XPAFRP are needed. Is it per report or is it based off the include module you use?

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

    No comments:

    Post a Comment