• Breaking News

    Wednesday, June 13, 2018

    Critical Conditions in Code Ask Programming

    Critical Conditions in Code Ask Programming


    Critical Conditions in Code

    Posted: 13 Jun 2018 01:18 PM PDT

    What algorithms and math theory do you think should be taught more (or at all) to college students?

    Posted: 13 Jun 2018 11:12 AM PDT

    More specifically, are there algorithms like djakstra's shortest path algorithm, red black trees (self-balancing trees), sorting algorithms, etc? What has been the most useful in your work, and personal projects?

    If I am using the wrong terminology please feel free to correct me. I am asking this because I want to learn, so any improvement is welcome.

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

    [Eclipse Java] Best way to determine the fingerprint of a Java Object?

    Posted: 13 Jun 2018 12:28 PM PDT

    Let's say I have data model class called "Person.java", with has many fields, some fields are other classes / objects.

    What is the best way to get the fingerprint?

    Can I convert the "Person" to a json string using Jackson, and hashing the Json String (SHA256)?

    Or use Eclipse / Lombok to generate int hashCode() function for Record, and all of it's sub objects?

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

    [Programming Beginner] Need help creating a discord bot.

    Posted: 13 Jun 2018 05:02 PM PDT

    Okay, so I am EXTREMELY new to coding—programing alike. I figured creating a simple discord bot would be cool and it is, but it seems as though I have come to a halt. I am still not entirely sure on what certain terminology is and I'm just overall confused.

    If you guys can help me I would GREATLY appreciate that.

    Okay first, I was attempting to create a script by following ( https://medium.com/davao-js/tutorial-creating-a-simple-discord-bot-9465a2764dc0 ) guide and I did exactly as he did, but my problem is doing the node bot.js every time I try I seemingly get an error. I've changed the gateway to v6 and it's still giving me errors. Also, on Mac I can't seem to open this GIT file and I'm not sure what to do to open it.

    Along with that I had a few questions:

    •What exactly is a redirect URI?

    •Also, what would be the easiest way or simplest to create a simple discord bot that posts timed messages, and that I can link to a social media website and have it post my recent post.

    •Which language is the easiest to learn for beginners?

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

    Need help with my project: determining heart rate in BPM using pulse sensor.

    Posted: 13 Jun 2018 12:12 PM PDT

    I have been trying to determine the heart rate BPM, but I have not been able to get the accurate reading. The rate seems to be going up and down. I am hoping someone could explain to me what is going on with my code. I have gotten this code from online source and trying to use it.

    Code:

    int UpperThreshold = 720; int LowerThreshold = 600; int reading = 0; float BPM = 0.0; bool IgnoreReading = false; bool FirstPulseDetected = false; unsigned long FirstPulseTime = 0; unsigned long SecondPulseTime = 0; unsigned long PulseInterval = 0; const unsigned long delayTime = 20; const unsigned long delayTime2 = 20; const unsigned long baudRate = 9600; unsigned long previousMillis = 0; unsigned long previousMillis2 = 0; unsigned char HIpin = 13; //red led // this is to later set an alarm system when the BPM go above the resting heart rate. unsigned char LOpin = 12; // greed led // this is to later indicate that device is working. void setup(){ Serial.begin(baudRate); pinMode(HIpin, OUTPUT); pinMode(LOpin, OUTPUT); digitalWrite(HIpin, LOW);// leds off digitalWrite(LOpin, LOW); } void loop(){ // Get current time unsigned long currentMillis = millis(); // First event if(myTimer1(delayTime, currentMillis) == 1){ reading = analogRead(0); // Heart beat leading edge detected. if(reading > UpperThreshold && IgnoreReading == false){ if(FirstPulseDetected == false){ FirstPulseTime = millis(); FirstPulseDetected = true; } else{ SecondPulseTime = millis(); PulseInterval = SecondPulseTime - FirstPulseTime; FirstPulseTime = SecondPulseTime; } IgnoreReading = true; digitalWrite(LED_BUILTIN, HIGH); } // Heart beat trailing edge detected. if(reading < LowerThreshold && IgnoreReading == true){ IgnoreReading = false; digitalWrite(LED_BUILTIN, LOW); } // Calculate Beats Per Minute. BPM = (1.0/PulseInterval) * 60.0 * 1000; } // Second event if(myTimer2(delayTime2, currentMillis) == 1){ Serial.print(reading); Serial.print("\t"); Serial.print(PulseInterval); Serial.print("\t"); Serial.print(BPM); Serial.println(" BPM"); Serial.flush(); } } // First event timer int myTimer1(long delayTime, long currentMillis){ if(currentMillis - previousMillis >= delayTime){previousMillis = currentMillis;return 1;} else{return 0;} } // Second event timer int myTimer2(long delayTime2, long currentMillis){ if(currentMillis - previousMillis2 >= delayTime2){previousMillis2 = currentMillis;return 1;} else{return 0;} } 
    submitted by /u/ohcuriouspanda
    [link] [comments]

    what commonly accepted best practices in development security and supporting tools do you use to prevent and detect potential security flaws?

    Posted: 13 Jun 2018 09:55 AM PDT

    Intellectual Property on Code

    Posted: 13 Jun 2018 02:17 PM PDT

    Heya, I'm just starting my career out and I'm doing some small projects for a few different companies. Something has come up and I'm not sure about the implications legally (and what is generally done in the community. I'm based in the EU if that matters.

    One of the companies I am working for is interfacing with an a 3rd party solution as part of their product. This API is public as is all the documentation. Through this company, I'm learning about this API and I'll be working on their implementation with a couple of their developers.

    However, another company I am already working with also wants to implement the same API. For the new company I'll write all the code ( and the implementation and objectives are slightly different). Am I breaking intellectual property having seen another companies implementation and how to interface with this API?

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

    Building a web app (React/Redux/.NETcore) and can't decide between nosql or postgres for the data store

    Posted: 13 Jun 2018 02:17 PM PDT

    Hey all, the data I have is somewhat relational, but minimal and won't need to scale. It basically will manage schedules and teams of some local sport teams. It will need to store player names, team names, leagues, scores and some statistics.

    I had originally decided to use MERN stack, but I prefer .NET over nodejs. With MERN, the obvious choice for data store is MongoDB, but having done some research it appears that most programmers do not recommend mongo/nosql at all. (Is AWS's dynamo db any better?) Should I avoid NoSQL and use Postgres instead?

    If Mongo is hated so much, why are MERN/MEAN stacks so popular?

    Thanks!

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

    Different on Mobile and Desktop

    Posted: 13 Jun 2018 01:49 PM PDT

    I recently made this simple site: www.zerofirst.co And the "schedule a 20 min call" button looks different on my computer and on my phone. I'm using Chrome on both devices. What am I doing wrong?

    Phone: https://imgur.com/a/PMoQ9by Computer: https://imgur.com/a/kvrNkp0

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

    What is the name of this kind of configuration markup?

    Posted: 13 Jun 2018 04:56 AM PDT

    I sometimes see this kind of markup used for configuration files. They never have the same file extension so it is difficult to find the proper name.

    [Ted] Age=23 Salary=30000 Car=Mercedes

    submitted by /u/dougie-io
    [link] [comments]

    [C#] - Console app with two linked Arrays?

    Posted: 13 Jun 2018 06:01 AM PDT

    Hello. I need some help with a little console application I'm trying to make.
    The requirements are as follows:

    **Two arrays: Array1 called Students, Array2 called Friends.

    Array Students contains elements of type Student (id, name, gender).

    Array Friends contains elements of type links (Student 1, Student 2).

    The task is to write an algorithm which finds the following relations for the students:

    1. All friends
    2. All friends of my friends
    3. All friends of my friends, that are not my friends**

    I tried few things but I'm just getting more and more confused. For now, the only thing I think I got kinda right is my student class with Students array.

    class Student { private static int studentId; private static String studentName; private static String studentGender; Object[] Students = new Object[] { studentId, studentName, studentGender }; public int StudentId { get; set; } public String StudentName { get; set; } public String StudentGender { get; set; } public Student() { } public Student(int studentId, String studentName, String studentGender) : this() { StudentId = studentId; StudentName = studentName; StudentGender = studentGender; } public override string ToString() { string text = null; text += "\t Student ID: " + StudentId; text += "\t Student Name: " + StudentName; text += "\t Student Gender: " + StudentGender; return text; } } 

    For now, I'm directly accessing it in the main like so:

    static void Main(string[] args) { Student student1 = new Student(1, "Name 1", "Male"); Student student2 = new Student(2, "Name 2", "Female"); Student student3 = new Student(3, "Name 3", "Male"); Console.WriteLine(student1.ToString()); Console.WriteLine(student2.ToString()); Console.WriteLine(student3.ToString()); } 

    I've also made another class Friends where I've been trying in a similar fashion to the Student class to call the students and work with them but honestly, I have no idea what I'm doing even though I'm last year CompSci student.

    So, if you guys can at least point me in the right direction on what to use, how to structure things and so forth in preferably ELI5 fashion I would really appreciate it.

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

    What makes a great programmer?

    Posted: 13 Jun 2018 01:25 PM PDT

    What would a great programmer be like?

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

    eclipse is showing this error =>Syntax error on token "celsi", delete this token can anyone tell me whats wrong with this code ?

    Posted: 13 Jun 2018 09:01 AM PDT

    public class Cel {

    public static void main(String[] args) { System.out.println("-----------CELSIUS TO FAHRENHEIT TABLE ----------------\n\n"); double celsi,fah; for(celsi=0;celsi<=300;celsi+=5) { fah = (celsi*(9.0/5.0))+32.0; System.out.printf("%f\t%f\n"celsi,fah); } } 
    submitted by /u/detamax
    [link] [comments]

    Need help with a news aggregator and interpreter program.

    Posted: 13 Jun 2018 11:49 AM PDT

    Background: Engineering student with basic knowledge of Java, C++, & MatLab, trying to combine interests in engineering and finance.

    I want to create a program that scours the web for articles about a company, then reads the articles and predicts which direction the company's stock is headed (ie up or down). I realize that full comprehension of articles is tricky, so I'll probably rely on key words or phrases to determine if the article is positive or negative and how significant the news is.

    This is my first experience with both aggregation and interpretation, so any suggestions on languages or packages and links to relevant guides would be great. Thanks!

    submitted by /u/prison-wine
    [link] [comments]

    What are the best core languages to learn for Software Developing?

    Posted: 13 Jun 2018 11:27 AM PDT

    Hey all I am kinda new to programming and I just want advice.

    I have been using this App and various others called 'Sololearn' and It's great. But when I didn't use It I tried to watch a video about one programming language and when I got stuck I moved onto another so I wasted a year basically.

    Now I know the foundations of what I want I would like to study and train self taught way for being a Software Developer.

    The only probably Is what are some of the most Important Languages you should know?

    I used to fancy Web Development seemed easier than Software but I fancy a challenge. Basically for web dev you just have to know a few markup and programming languages and that's It you can edit templates whereas I'm sire Software Is more made up for scratch.

    Anyways In my job searches I see more Software Developer Jobs or apprenticeships then Web Developers.

    So I might pickup Web Developer later.

    But anyways when I was wanting to learn Web Dev they were like core languages or very Important languages for that role.

    1.) HTML5 2.) CSS/CSS3 3. ) JavaScript 4.) Java 5.) PHP

    (Not In any order)

    Ect. They would be a good foundation for any wannabe Web Dev today.

    But what would be the most Important languages to learn for Software or the core languages?

    Taking a guess It would be like. In no order just randomly listed.

    1. C 2.C++
    2. C#
    3. Java
    4. Python
    5. Perl
    6. Haskell
    7. Delphi
    8. Visual Basic
    9. MATLAB
    10. Ruby On Rails (Maybe).

    I know the first five I mentioned are very core or Important to Software Dev.

    So my question Is what should be the first couple of languages I should learn obviously I'll learn them one by one. But what are the core ones every Software should know at least moderately about?

    What would be your first couple to choose from?

    Genuine question just need reassurance I'm sire some of the ones I mentioned are very core to Software Development.

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

    Determining the size of a database?

    Posted: 13 Jun 2018 05:57 AM PDT

    If you are trying to measure the size of a database than measure the size of a new one you are making that has more of a relational model to it, how would you do that? I am trying to quantify my database model changes to see if its more effective/efficient? Using SQL server. I am trying to figure out the space on a server my new design takes up vs. the old design as data is entered into the tables.

    Thanks

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

    Languages made for multithreading or GPGPU.

    Posted: 13 Jun 2018 03:18 AM PDT

    I recently found out the existence of Quantum Programming Languages, Q# in particular. Which made me wonder, about the need for them. Why wasn't it able to be made into a library that can be imported for use. I guess the answer was more why not, rather than why.

    So then the thought hit me, why aren't there Multithreaded language or GPGPU languages with those features baked in. Like I know there's OpenCL and several shader languages, but they are written solely for those purposes, you have to call them from an outside language.

    Why isn't there language where you can write CPU and GPU code together. Or a language with threading treated as their main focus.

    Or am I very out of date and these things do exist?

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

    [Java] Program running both IF and ELSE condition

    Posted: 13 Jun 2018 08:26 AM PDT

    EDIT: I am a fucking idiot. Resolved.

    I am absolutely stumped here... I have been using IF and ELSE for a while now and I believe I know how it works; but good God I can't figure out why my program is running both IF and ELSE conditions here:

     else if (b.weight>a.weight){ if(b.left==a){ System.out.println("Hello"); return b; } else{ findParent(a, b.left); } } 

    I expect it to return b and get out of the method, but nope.. it enters IF, prints Hello, looks at return b, enters ELSE then recurses as well. This method is called findParent.

    I checked the debugger and that's exactly what I am seeing.

    So fucking done.

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

    How to relocate UTF-8 strings to English?

    Posted: 13 Jun 2018 03:32 AM PDT

    I'm a pretty newbie user who has been working on a translation for STGBuilder (download here: http://blog.livedoor.jp/stgbuilder/archives/9101591.html) , which is a japanese program that allows creation of Shooter games. For almost a month i've been working on this translation, and so far i've only managed to do some RCData thanks to using a Resource Hacking tool. However, i've discovered that this program is made in Delphi and the only thing that remains is that i need a (easy) way to change the strings from UTF-8 japanese to English. I do have a list of strings to change on an excel file, so that doesn't need much time to translate the strings first before changing them.

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

    What Language or Paradigms do I need to create a web application with movable graphic elements like a flowchart creator?

    Posted: 13 Jun 2018 07:14 AM PDT

    I say flowchart creator, but it could be anything similar. Basically have movable graphic elements that can be connected etc.

    An example webpage I have is this: https://www.circuitlab.com/editor/#?id=7pq5wm

    In the linked page you have your side panels with graphic elements but you can then drag them into the main frame and arrange them, connect them, even run reports.

    Is this an app laid into a webpage frame? Would Java achieve this? Or is it something else? I am just looking for information so I can get started and learn how something like this can be developed as I'm not very familiar with this type of application. I see them popping up with '.io' games that appear similar, I would assume what I'm looking for is a similar paradigm to those too. Thanks.

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

    Software UML model GUI

    Posted: 13 Jun 2018 06:59 AM PDT

    Hello,

    I have to model a sofware with UML, part of the software includes large form. How do I represent that form and how it should look like?

    Thx,

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

    Help out a beginner website builder !

    Posted: 13 Jun 2018 08:34 AM PDT

    Can anyone please explain to me which programming languages to learn in order to make a website? I want to make a website for my business. I know python,cpp,java and C. I know html and css can be used and maybe sql for database. Thats pretty much all i know.Educate me reddit!

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

    I'm looking to make a mobile app that turns a computer on/off remotely

    Posted: 13 Jun 2018 01:59 AM PDT

    Hello /r/AskProgramming, I'm trying to make an app for my android phone that can remotely turn my pc off/on/sleep. My idea is to make it also use google assistant for voice commands. I just want to know what should I use (programming language wise) also how could I do it (in terms of networking).

    I understand I also need to make a desktop app running in the background waiting for a command. But is it possible to turn on when its completely off?

    I'm just kinda looking for a project to do. So I was also wondering if this is even possible to do.

    thanks

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

    No comments:

    Post a Comment