• Breaking News

    Wednesday, November 28, 2018

    What are the websites/blogs you check out everyday to learn from other than the MOC websites? Ask Programming

    What are the websites/blogs you check out everyday to learn from other than the MOC websites? Ask Programming


    What are the websites/blogs you check out everyday to learn from other than the MOC websites?

    Posted: 28 Nov 2018 06:51 PM PST

    Need Legal Advice, Programming Opportunity

    Posted: 28 Nov 2018 03:50 PM PST

    So background: I work as an engineer in the metal industry, but on the side I do programming as a hobby. This morning I got a call from a previous co-worker offering me a job to build a database application for his new place of work. Now i have never done business in programming before and have no idea about the legal things with making a program for a company. Anybody know about freelance programming? Contracts? Compensation amounts? Any tips or advice would be helpful, i just don't want to go into this completely blind and vulnerable.

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

    Anyone know how this list is being modified?

    Posted: 28 Nov 2018 08:29 PM PST

    print(solution_list)

    print('***')

    while (time.time() - start) < duration_secs:

    ........new_score, solution = local_searcher(solution_list.copy(), input_name)

    print(solution_list)

    This outputs:

    ['49', '32', '4', '3', '6', '1', '2', '5', '0']

    ***

    ['25', '21', '49', '11', '35', '45', '2', '5', '24']

    How is solution_list being modified, especially if I am passing in a copy to be safe?

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

    How do you contribute to the GitHub repositories of some of the big organizations like Google, Microsoft, Facebook etc?

    Posted: 28 Nov 2018 10:11 AM PST

    Have you ever tried or been doing this? If so, how did you start? How difficult was it?

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

    Basic pathfinding for a robot to navigate around obstacles

    Posted: 28 Nov 2018 10:34 PM PST

    (The Language is a lite version of Java)

    I am attempting to make a program for a robot I am designing for a project. I am in the process of trying to make a virtual map in the code, so that I can make a "goto position" function to make movement easier and more idiot-proof.

    It would be simple enough if there weren't obstacles, just point and move, but there are obstacles of different shapes on the area the robot works with. And I don't have any idea how to make an algorithm for making a robot find it's way around obstacles with proper clearance. Is there any simple way to do this?

    TL;DR, I wish for a relatively compact algorithm for finding a path around obstacles.

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

    Writing Audio Files To The Cloud

    Posted: 28 Nov 2018 08:25 PM PST

    I'm trying to store some mp3 files in the cloud but I want to want write them straight from Python instead of writing them to disk and then uploading them. Then I want to serve them to a website. S3 is the only option I could find to do this, but it seems unlikely that's it's the only service that meets these requirements. What other options do I have?

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

    any script available to edit a large .txt file? please read description

    Posted: 28 Nov 2018 07:38 PM PST

    so I have a WhatsApp conversation saved in .txt in chronological order . I want to remove the date and times on the left hand side. (eg: 07/08/18 07-35pm A: hi 07/08/18 07-40pm B: hi there)

    I want only the texts and edit out the rest. ( hi hi there . . . )

    any available scripts or suggestions?

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

    Query Optimization in MySQL

    Posted: 28 Nov 2018 07:38 PM PST

    I have two tables called Employees_2018 and Employees_2019. The two tables are effectively the same schema, but over the years this is not guaranteed and therefore we chose to create a new table each year. The primary use case is finding data for a given year, not across years.

    Across multiple years I have employee Ids that are consistent. I would like to be able to query consistent fields across the Employee_2018...2019(20,21) into perpetuity.

    There does not seem to be an easy way to optimize multiple queries with this table structure. I started to use Views because I could just use Employee_View_AllYears as a join and then I don't have to mess with updating every query that needs the data from all years, I just UNION ALL the data in the view for each successive year and my problem is solved.

    I seem to be having performance issues, however, and I can't seem to find anything good on the internet on how to optimize views. Is this not a good use-case for views? Any other suggestions?

    View statement is basically:

    select * from Employees_2018 UNION ALL select * from Employees_2019. 

    Example Query might be:

    select employeeId, year, salary from Employee_View_AllYears 
    submitted by /u/rockefeller22
    [link] [comments]

    Java Bootcamp?

    Posted: 28 Nov 2018 06:45 PM PST

    I know a little bit, but I'm still just a beginning coder. What's a bootcamp where I can learn to be a functional Java coder in a few weeks? 3 weeks, 6-15 weeks...

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

    What's the best way to create a web based cloud file server?

    Posted: 28 Nov 2018 06:24 PM PST

    I want to practice making a multi-user file server using PHP and MySQL but I can't find any good guides on ways to implement it. Here are some questions.

    Should I put all the files in one folder and have entries in the database for who owns the files?

    Where is the best place to store files?

    Should I create a separate folder for each user? Any specific folder permissions?

    Should folders have hashed names?

    Do I need a database or is there a better way to implement a file server?

    Those are the main things I can think of. If there's anything you guys can think of that I haven't mentioned let me know.

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

    Is it bad practice to make utility library for unix systems to require sudo to start and work?

    Posted: 28 Nov 2018 01:40 PM PST

    If you create some package that does need to access to sudo services like systemctl or others, and source code is visible for everyone on the github.

    The thing is if no sudo - library will have a huge documentation as how to give access to needed systems for each part of library. Like tutorials how to add rights to your user to systemctl, grant permissions to list of folders, etc

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

    Anyone know how to do this without looking it up

    Posted: 28 Nov 2018 05:17 PM PST

    In this lab, you will be creating a program that merges two arrays of names. Your program will accept each array as input from the keyboard taking all strings and then reformat them in title case. For example, "jOHN" would convert to "John", "megan" would convert to "Megan", and "ADAm" would convert to "Adam".

    You do not know ahead of time how many values will be entered, but you can assume each array will have a maximum length of 10,000 elements. To stop entering values the user will enter the word "End". Note: that any combination of lowercase and uppercase characters that spell "End" should terminate asking for input.

    The elements of the two input arrays should be in alphabetical order. In other words, each array element must have a value that is greater than or equal to the previous element value.

    After the two arrays have been input, your program must check to make sure the elements of each array have been entered in order. If an out of order element is found, print the message "Error: Arrays not in correct order".

    Your task is to merge the two input arrays into a new array, with all elements in alphabetical order. Print out each of the original arrays entered, followed by the merged array.

    Please note that your program must output the arrays with exactly one space between each name.

    Determining alphabetical order: take a look back at the lesson on String functions and specifically the compareTo method.

    Sample Run 1:

    Enter the values for the first array, up to 10000 values, enter 'End' to quit
    Alf
    BOB
    heATher
    john
    ZoE
    eNd

    Enter the values for the second array, up to 10000 values, enter 'End' to quit
    Chloe
    dylan
    michAEL
    END

    First Array
    Alf Bob Heather John Zoe

    Second Array
    Chloe Dylan Michael

    Merged Array
    Alf Bob Chloe Dylan Heather John Michael Zoe

    Sample Run 2:

    Enter the values for the first array, up to 10000 values, enter 'End' to quit
    heATher
    john
    ZoE
    Alf
    BOB
    eNd

    Enter the values for the second array, up to 10000 values, enter 'End' to quit
    Chloe
    dylan
    michAEL
    END

    First Array
    Heather John Zoe Alf Bob

    Second Array
    Chloe Dylan Michael

    Error: Arrays not in correct order

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

    How to use [ ( ' " auto-completion? (possibly a rant)

    Posted: 28 Nov 2018 02:37 AM PST

    this is probably petty, but it infuriates me:

    Whenever I am typing and the editor auto-completes any {(["open-close"])} pair (parentheses, brackets, quotes), how am I supposed to move the cursor to the end of the line or the next one?

    Example:

    1. I start typing "function1(" and it auto completes to "function1()" but the cursor is still inside the parentheses "function(|)".
    2. If I have to add semicolons to the end of the statement, I either have to type ")" and let the auto completion ignore it (which is not consistent across editors) and just move the cursor OR I have to use the arrow keys.
    3. If "function1()" was all I wanted, I can't just press enter and go to the next line. I still have to type ")" or use the arrow keys.

    I don't want to use the arrow keys and not all editors recognize properly that I wrote the closing part of the open-close pair. There must be a better way than just disabling the auto-completion.

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

    Incorporating delta time into multiplicative operation?

    Posted: 28 Nov 2018 03:38 PM PST

    SOLVED, Thanks everyone! (Please see u/HeinousTugboat's second answer)

    We've probably encountered this issue at some point:
    Let's say we want to decay a value by some factor -> a *= 0.8
    (Commonly used for damping velocities)
    We do this each frame or subframe, but without deltatime, this suffers the same problem that other things do when deltatime is ignored.
    My question is, is there an industry standard way of somehow reconciliating deltatime with a *= b?
    I feel like a *= b/deltatime is incorrect?
    Thanks in advance!

    Edit: a decays by 20% every second

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

    When drawing graphics, is it optimal to use the "traditional" coordinate system or use the graphics coordinate system?

    Posted: 28 Nov 2018 02:30 PM PST

    I was playing around with a graphics library and I found out that the point (0, 0) is found on the top left corner of the screen instead of the traditional bottom left corner like we have been taught in mathematics. As I started playing with trigonometric functions I started to get a little bit confused as everything is flipped upside down. My question is: Is it ideal to make functions that flip y values at the time of drawing into the computer (so you think of graphing the "traditional" way) or is it better to become accustomed to this new coordinate system and try to think of everything upside down (in the y axis that is).

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

    Does Intel specify what their codenames mean? Why are they chosen?

    Posted: 28 Nov 2018 12:28 PM PST

    For example, Intel names each of its microarchitectures. Past names have been: - Nehalem - Sandy Bridge - Skylake, etc.

    Wikipedia lists some of the names: https://en.wikipedia.org/wiki/List_of_Intel_codenames, and their source, but I don't know where that information is coming from.

    For anybody who works at intel: do you know how and why the codenames are chosen?

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

    How can i save this change?

    Posted: 28 Nov 2018 12:26 PM PST

    https://imgur.com/a/eaeqQlM Forgot my bios password and saw some guy fix it this way but i cant save edit in ini file?

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

    Operator Overloading (C++)

    Posted: 28 Nov 2018 08:05 AM PST

    I have this following code that I would like to apply operator overloading for "+" and "*" to replace "add" and "multiply" respectively.

    template < class T> class calc { public: T multiply(T x, T y); T add (T x, T y); } ; template < class T> T calc<T>::multiply(T k1, T k2) { return k1 * k2; } template < class T> T calc<T>::add(T k1, T k2) { return k1 + k2; } int main() { calc<int> c; std::cout << c.multiply(1, 5); } I have attempted to implement operator overloading, but I don't fully understand how to go about adapting it. This is my implementation below, but I have an error: Error C2760 syntax error: unexpected token 'identifier', expected 'declaration', on line: calc<int> a(1), calc b(5), result;. #include <iostream> using namespace std; template < class T> class calc { public: T x; T y; }; template < class T> calc<T> operator*(calc<T> const& k1, calc<T> const& k2) { calc ret; ret.x = k1.x * k2.x; return ret; } template < class T> int main() { calc<int> a(1), calc b(5), result; result = a + b; cout << result; } 
    submitted by /u/draconian_sr
    [link] [comments]

    Can someone show me how to implement this github project that uses ruby?

    Posted: 28 Nov 2018 11:15 AM PST

    https://github.com/Earlz/make-wiring I am super new to this. I am not sure how to start this in windows. Do I need to install ruby?

    Specifically under Usage it says to type this "./build.sh build arduino" in the cmd window. This is the building of the libraries for the project but I don't see a .sh file in the repository.

    any help is appreciated

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

    Python|Tkinter| Enter and Plus on the Keypad not working

    Posted: 28 Nov 2018 06:50 AM PST

    So basically, I wrote a relatively simple calculator program in Python. I made the GUI using Tkinter. After everything was working just fine I decided that I wanted to add Keypad support. At first, everything was working fine, until I got to the Enter and Plus keys. I know you're supposed to use '<KP\_Add>' and '<KP\_Enter>' but neither seems to be working for me. The normal Enter key works just fine with '<Return>'. I have tried researching the problem but I've yet to find anything useful. If anyone has suggestions (for my problem or in general, since I'm still relatively new to programming), feel free to post it.

    The Enter Key is in Row 3 and the Plus Key is in Row 4

    from tkinter import * from tkinter import messagebox calculator = Tk() calculator.title("Calculator") calculator.resizable(0, 0) class Application(Frame): def __init__(self, master, *args, **kwargs): Frame.__init__(self, master, *args, **kwargs) self.createWidgets() # ----- Clear Entry, Put "0" in Entry ----- def replaceText(self, text): self.display.delete(0, END) self.display.insert(0, text) # ----- Calculate Expression ----- def calculateExpression(self): self.expression = self.display.get() self.expression = self.expression.replace("%", "/ 100") try: self.result = eval(self.expression) self.replaceText(self.result) except: messagebox.showinfo("Error", "Invalid Input") self.clearText() # ----- Add Stuff to Entry ----- def appendToDisplay(self, text): self.entryText = self.display.get() self.textLength = len(self.entryText) if self.entryText == "0": self.replaceText(text) else: self.display.insert(self.textLength, text) # ----- Clear Text in Entry ----- def clearText(self): self.replaceText("0") # ----- Create Widgets Function ----- def createWidgets(self): self.display = Entry(self, font=("Helvetica", 16), borderwidth=0, relief=SUNKEN, justify=RIGHT) self.display.insert(0, "0") self.display.grid(row=0, columnspan=5) # ----- Row One ----- self.sevenButton = Button(self, font=("Helvetica", 11), text="7", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("7")) self.sevenButton.grid(row=1, column=0, sticky="NWNESWSE") self.master.bind('7', lambda event: self.appendToDisplay("7")) self.eightButton = Button(self, font=("Helvetica", 11), text="8", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("8")) self.eightButton.grid(row=1, column=1, sticky="NWNESWSE") self.master.bind('8', lambda event: self.appendToDisplay("8")) self.nineButton = Button(self, font=("Helvetica", 11), text="9", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("9")) self.nineButton.grid(row=1, column=2, sticky="NWNESWSE") self.master.bind('9', lambda event: self.appendToDisplay("9")) self.timesButton = Button(self, font=("Helvetica", 11), text="*", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("*")) self.timesButton.grid(row=1, column=3, sticky="NWNESWSE") self.master.bind('*', lambda event: self.appendToDisplay("*")) self.clearButton = Button(self, font=("Helvetica", 11), text="C", bg="#ffffff", borderwidth=0, command=lambda: self.clearText()) self.clearButton.grid(row=1, column=4, sticky="NWNESWSE") self.master.bind('c', lambda event: self.clearText()) # ----- Row Two ----- self.fourButton = Button(self, font=("Helvetica", 11), text="4", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("4")) self.fourButton.grid(row=2, column=0, sticky="NWNESWSE") self.master.bind('4', lambda event: self.appendToDisplay("4")) self.fiveButton = Button(self, font=("Helvetica", 11), text="5", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("5")) self.fiveButton.grid(row=2, column=1, sticky="NWNESWSE") self.master.bind('5', lambda event: self.appendToDisplay("5")) self.sixButton = Button(self, font=("Helvetica", 11), text="6", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("6")) self.sixButton.grid(row=2, column=2, sticky="NWNESWSE") self.master.bind('6', lambda event: self.appendToDisplay("6")) self.divideButton = Button(self, font=("Helvetica", 11), text="/", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("/")) self.divideButton.grid(row=2, column=3, sticky="NWNESWSE") self.master.bind('/', lambda event: self.appendToDisplay("/")) self.percentageButton = Button(self, font=("Helvetica", 11), text="%", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("%")) self.percentageButton.grid(row=2, column=4, sticky="NWNESWSE") self.master.bind('%', lambda event: self.appendToDisplay("%")) # ----- Row Three ----- self.oneButton = Button(self, font=("Helvetica", 11), text="1", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("1")) self.oneButton.grid(row=3, column=0, sticky="NWNESWSE") self.master.bind('1', lambda event: self.appendToDisplay("1")) self.twoButton = Button(self, font=("Helvetica", 11), text="2", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("2")) self.twoButton.grid(row=3, column=1, sticky="NWNESWSE") self.master.bind('2', lambda event: self.appendToDisplay("2")) self.threeButton = Button(self, font=("Helvetica", 11), text="3", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("3")) self.threeButton.grid(row=3, column=2, sticky="NWNESWSE") self.master.bind('3', lambda event: self.appendToDisplay("3")) self.minusButton = Button(self, font=("Helvetica", 11), text="-", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("-")) self.minusButton.grid(row=3, column=3, sticky="NWNESWSE") self.master.bind('-', lambda event: self.appendToDisplay("-")) self.equalsButton = Button(self, font=("Helvetica", 11), text="=", bg="#ffffff", borderwidth=0, command=lambda: self.calculateExpression()) self.equalsButton.grid(row=3, column=4, sticky="NWNESWSE", rowspan=2) self.master.bind('<KP_Enter>', lambda event: self.calculateExpression()) # ----- Row Four ----- self.zeroButton = Button(self, font=("Helvetica", 11), text="0", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("0")) self.zeroButton.grid(row=4, column=0, sticky="NWNESWSE", columnspan=2) self.master.bind('0', lambda event: self.appendToDisplay(0)) self.dotButton = Button(self, font=("Helvetica", 11), text=".", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay(".")) self.dotButton.grid(row=4, column=2, sticky="NWNESWSE") self.master.bind(',', lambda event: self.appendToDisplay(".")) self.plusButton = Button(self, font=("Helvetica", 11), text="+", bg="#ffffff", borderwidth=0, command=lambda: self.appendToDisplay("+")) self.plusButton.grid(row=4, column=3, sticky="NWNESWSE") self.master.bind('<KP_Add>', lambda event: self.appendToDisplay("+")) app = Application(calculator).grid() calculator.mainloop() 

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

    How do you practice TDD with unit tests when you don't entirely understand how things should be broken up?

    Posted: 28 Nov 2018 10:21 AM PST

    I'm most familiar with Java and JUnit so I'll be basing any of the practices I've heard or read off of that.

    Let's say I'm developing a web service that takes some XML, parses it to fit the model, then persist the model to a database. A pretty simple, but common example that should suit the needs of this question.

    So I know what the service as a whole needs to do (i.e. acceptance test material), but I don't necessarily know what the exact classes I would need.

    I've heard that each class should have a unit test, but if we're writing the tests first how do I know how everything should be broken up? What should my first unit tests be testing?

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

    How to use a speech to text api, or any api in general

    Posted: 28 Nov 2018 08:34 AM PST

    Hi all, I am very new to api's. I want to create a program that gets a YouTube video and is able to see if there is profanity. The problem is I do not know how to implement an api into my program.

    If anyone could help me that would be great! Thanks.

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

    Self Taught Developer - Did I miss anything at University?

    Posted: 28 Nov 2018 01:17 AM PST

    Hi /r/AskProgramming,

    I've been working full time as a web developer (PHP) since 2014.

    I retraded from my last job by reading some O'Reily books and hacking together a portfolio of work. I'm entirely self-taught, although I did get to study a vocational IT qualification it did not cover coding (more bunging RAM into towers and using MS Office Programs).

    Most of the people I have worked with held some form of IT degree.

    I now work for a company where I AM the sole member of the IT Dept / Development and am a little worried about skill fade.

    For those of you out there from an academic background, what do you see lacking from self-taught developers?

    What's a good way to sharpen up and or not get left behind?

    Thanks for reading this far,

    Mongo0se

    TL/DR: What do self taught devs miss out on?

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

    How to understand 'Algorithms Notes for Professionals'

    Posted: 28 Nov 2018 01:17 AM PST

    Hi, I am not sure how to properly formulate this question and where to start with google / other books. I have recently found out about the Stackoverflow compiled books and found the "Algorithms Notes for Professionals" book really interested me. Now like I expected I hit a wall. Chapter 2 already has some mathemathical usage I find really hard to understand since I have never used this and never had a class in school about it.

    Now my question is what would be a good way to start learning this like this myself? I am not asking for a full guide or plan but a push in the right direction would be really helpfull!

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

    Any good Portfolios Ideas?

    Posted: 28 Nov 2018 06:12 AM PST

    Hi, I´m studding programming for about 3 years, and I want to change my current job to start programming.

    I don´t have a portfolio, I need to create one, do you have any ideas for goods projects that I can create to upload?

    If you know what they take into account when they see the portfolio.

    I have made some stuff, but anything big to be uploaded.

    Thanks

    ​ Edit: I know JAVA, Python and C++

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

    No comments:

    Post a Comment