• Breaking News

    Thursday, December 7, 2017

    What do you guys program as a hobby? Ask Programming

    What do you guys program as a hobby? Ask Programming


    What do you guys program as a hobby?

    Posted: 07 Dec 2017 08:16 PM PST

    Seriously. I know a few languages (C, C++, Python, MATLAB if it counts) but I can never think of anything to program in my spare time. For now I want to make programming a hobby, but I don't know what to code.

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

    VERY confused on LINUX POSIX apis.

    Posted: 07 Dec 2017 08:05 PM PST

    APIs "shm_open", "ftruntcate", "mmap", "munmap", "close", and "shm_unlink"

    I know I can easily google them and there are hundreds of websites that gives me what to input, but I'm struggling with understanding what to input, and the context as to why I need to put these things in.

    int shm_open(const char *name, int oflag, mode_t mode);

    int ftruncate(int fd, off_t length);

    etc.

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

    Microsoft small basic newbie, help please

    Posted: 07 Dec 2017 08:00 PM PST

    Hello all, I am taking some CIS courses and learning about Microsoft small basic. We have a book that goes through all of what we have learned so far except Basic so my class did not really get too much material to learn from aside from the notes taken in class. Thus far, I am familiar with adding, subtracting, multiplying two numbers but for this project it seems I would need to use an accumulator and haven't learned too much about that. If I could get any help on this, I would deeply appreciate it. Thank you all.

    1. Erase the result screen.
    2. Prompt the user to enter the numbers of sales amounts to be typed.
    3. Accumulate the sales amounts.
    4. Display (with appropriate wording) the total of the sales amounts.
    5. Prompt the user if this calculation needs to be performed again. If so, repeat beginning at Step 1.

    This is how I started it so far.

    TextWindow.Clear() TextWindow.WriteLine("Enter sales amount") TextWindow.ReadNumber()

    TextWindow.WriteLine("Total sales amount")

    I think I can use TextWindow.ReadNumber() for however many sales there are but since it doesn't specify how many there are I'm thinking it's the wrong way to do it since it seems as though you put in a number and keep adding onto that til the program is ended.

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

    MsAccess ODBC connection with java program

    Posted: 07 Dec 2017 08:56 PM PST

    I'm using windows 10.. i want to connect my MS-ACCESS database with my java program using Odbc-jdbc bridge!! If i try to connect ut right now its giving me an error at runtime as: ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver

    Please tell me the way to connect my database!! I use windows10 os and notepad for writing program and jdk 1.7 for java! Please tell me a solution..

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

    How to change the color of text after it has been displayed in C++?

    Posted: 07 Dec 2017 07:51 PM PST

    I would like to display a line (which is 5 randomly generated numbers) and after roughly 3 seconds, change the text color to the same color as the background, so you can't see the text anymore. I have tried thinking of a bunch of different ways, I just can;t figure it out. Also, if you can think of a better way to make one line in the command prompt disappear, I'd love to hear it! Sorry if this is the wrong subreddit in advance.

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

    What is the most mainstream, elegant, minimalistic language while still remaining efficient and practical?

    Posted: 07 Dec 2017 01:51 PM PST

    Hello,

    As part of my recent search for a new programming language, I've been looking for an elegant, minimalistic and efficient (runtime speeds and runtime libraries) language. Could someone recommend a elegant, mainstream language that is efficient and practical?

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

    How do you come up with standards/practices for your team collaboratively when your team doesn't stay abreast with topics in their own field?

    Posted: 07 Dec 2017 11:19 AM PST

    As a manager, I read a lot of the posts and discussions on /r/programming and there is a lot of valuable stuff that I get there, as well as stuff that is linked to and discussed on YouTube, Stackoverflow, and a variety of other places.

    Not everything has merit (in my opinion), but some often do and I find the discussions healthy.

    But I have members in my team who don't do any reading whatsoever.

    Frontend developers who know bootstrap and the basics of SCSS, but can't talk to you about webpack or its varietals, a utility approach to writing CSS, etc.

    Same goes for backend developers, whether it's a trendy topic like microservices, docker, etc. I sat down with a couple of developers yesterday who were working on a web service, and they had issues with their docker compose file, where their project couldn't talk to another local project (due to their container not being able to resolve the local hostname), even though their docker compose also had a DNS container. Instead of trying to understand the problem, they kept guessing at different ports in the compose file and jacked everything up instead of debugging/walking through "what's actually happening in this process that doesnt seem to be working for them."

    So stuff like this is very frustrating for me. How do I deal with this? How do your managers/or you as a manager, set expectations about people learning? Is it my responsibility to teach them everything or do they also have some responsibility to try to figure this stuff out and learn vs. having the answers given to them?

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

    What's the best/quickest way for an already experienced developer to learn Javascript?

    Posted: 07 Dec 2017 04:04 PM PST

    I've been a software engineer for 4 years out of school now. I recently moved into a fullstack role where I'll be doing a lot of javascript, both front end and back end (node js).

    I have 0 experience with javascript, in my previous roles I was doing SQL and Java development. I had a more traditional CS education and never really learned much javascript in school.

    I've poked around with web stuff before and definitely understand the basics and higher level stuff, but javascript syntax is totally foreign to me.

    In my new role I'll be working a lot with frameworks like express js, react, redux, and node. I'm looking for any recommendations on how to get up to speed quickly with javascript fundamentals, whether it's a paid course or free.

    Thanks!

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

    How to setup raspberry pi 0 w for webhosting a website to dirtect URL through RPI for secure web browsing?

    Posted: 07 Dec 2017 03:29 PM PST

    I recently bought a raspberry pi 0 w and am wondering how to use it to search websites from a different location on a different network securely. I heard I can use apache and pcp to do so. I am just a beginner and don't know how.

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

    Need help using Google Directions API with PHP

    Posted: 07 Dec 2017 03:28 PM PST

    I'm trying to get a page where you just type in two destinations and it gives you a list of towns you will go through to get there. The problem I'm having right now is even getting it to show a map. I used a very simple example here I found online but when I hit submit it just takes me to a page with all the code. Not really sure what I'm doing wrong.

    I also have little to no experience with programming so detailed explanations would work best. Examples of something similar would be best since that's how I personally learn new things.

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

    Need ideas to help me improve.

    Posted: 07 Dec 2017 03:04 PM PST

    I finished my first year in computer engineering and I'm having a slight problem. So we learned algorithms, pascal and C (until pointers). The problem is I lose motivation in coding so easy. Usually when I struggle on something. Therefore I decided maybe a long term project that I could upgrade as I learn would be nice but I need ideas. Also I'd start that project on java as that's what we will concentrate in university. Also it would be nice if you could share helpful books, pdfs, websites.

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

    How do you decide what language to learn next?

    Posted: 07 Dec 2017 08:44 AM PST

    I've been a C# developer for my entire career (6+ years) and am tired of it and looking for a change. I've looked at Elixir and like it but got tired of it too and now I'm looking at Kotlin (or maybe Scala). How do you go about picking which language you want to learn next? Do you go by domain? TIOBE listing?

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

    I'm a new Java developer.I want to know why my program compares the numbers when boolean is false.

    Posted: 07 Dec 2017 01:03 PM PST

    import java.util.Scanner;//Ignore the comments.

    public class Numbers{ int x,y,z;//Deklarojm tri variabla boolean r; Scanner scan = new Scanner(System.in);

    public void setNumbers(){//Deklarojm metoden qe iu jep vler variablave System.out.print("Please input first number: "); if(scan.hasNextInt()){//Kushti nese inputi eshte int x = scan.nextInt();//Ruaj inputin ne variablen x r=true; } else{ System.out.println("Error: please enter a number"); r=false; return;//ndalon programin } System.out.print("Please input second number: "); if(scan.hasNextInt()){ y = scan.nextInt(); r=true; } else{ System.out.println("Error: please enter a number"); r=false; return;//ruaj ne y } System.out.print("Please input third number: "); if(scan.hasNextInt()){ z = scan.nextInt(); r=true; } else{ System.out.println("Error: please enter a number"); r=false; return;//ruaj ne z } } public void bool(){ if(r=true){ if(x>=y && y>=z){//nese x>=y>=z shfaq x System.out.println("The biggest number entered is: "+x); } else if(y>=z){//nese y>=z shfaq y System.out.println("The biggest number entered is: "+y); } else if(z>=x && z>=y){ System.out.println("The biggest number entered is: "+z); } else if (r=false){ System.out.println(); } } } } 
    submitted by /u/N0-t3j
    [link] [comments]

    6 hour interval

    Posted: 07 Dec 2017 07:00 AM PST

    how can i make a function that return A or B depending the time.

    example with minutes:

    between 0 and 360 -> A

    between 360 and 720 -> B

    between 720 and 1080-> A

    between 1080 and 1440-> B

    and this for ever.

    so 30=A, 60=A, 400=B, 800=A, 801=A...

    any idea? should be simple but i just cant figure it out. thanks.

    solution:

    $minutes = 720; if (($minutes /360) % 2 == 0) { echo 'A'; } else { echo 'B'; } 
    submitted by /u/frangoman
    [link] [comments]

    Need help Graphing

    Posted: 07 Dec 2017 11:32 AM PST

    Hey everyone, working on my first coding project and I'm having some trouble grapjhing. I was hoping one of yall could assist me. I'm writing in Python 3.6.3 using numpy and matplot. I've figured out how to put info in but am having trouble editing the axes.

    The code as is:

    import numpy as np

    import matplotlib.pyplot as plt

    file_data = np.genfromtxt("C:\Users\tomon\OneDrive\Documents\Class\Extragalactic Astronomy\model_spectra\fnu_m62_0.001Gyr.py", usecols=(0,1), skip_header=0, dtype=str)

    passband_u = np.genfromtxt("C:\Users\tomon\OneDrive\Documents\Class\Extragalactic Astronomy\sdss_response\sys.u.py", usecols=(0,1), skip_header=0, dtype=str)

    passband_g = np.genfromtxt("C:\Users\tomon\OneDrive\Documents\Class\Extragalactic Astronomy\sdss_response\sys.g.py", usecols=(0,1), skip_header=0, dtype=str)

    passband_r = np.genfromtxt("C:\Users\tomon\OneDrive\Documents\Class\Extragalactic Astronomy\sdss_response\sys.r.py", usecols=(0,1), skip_header=0, dtype=str)

    passband_i = np.genfromtxt("C:\Users\tomon\OneDrive\Documents\Class\Extragalactic Astronomy\sdss_response\sys.i.py", usecols=(0,1), skip_header=0, dtype=str)

    passband_z = np.genfromtxt("C:\Users\tomon\OneDrive\Documents\Class\Extragalactic Astronomy\sdss_response\sys.z.py", usecols=(0,1), skip_header=0, dtype=str)

    wavelength_u = passband_u[:,0]

    response_u = passband_u[:,1]

    wavelength_g = passband_g[:,0]

    response_g = passband_g[:,1]

    wavelength_r = passband_r[:,0]

    response_r = passband_r[:,1]

    wavelength_i = passband_i[:,0]

    response_i = passband_i[:,1]

    wavelength_z = passband_z[:,0]

    response_z = passband_z[:,1]

    v = [0, 400, 0, 400]

    plt.ylabel('Response')

    plt.xlabel('wavelength')

    plt.plot( wavelength_u, response_u, 'p-')

    plt.plot( wavelength_g, response_g, 'g-')

    plt.plot( wavelength_r, response_r, 'r-')

    plt.plot( wavelength_i, response_i, 'b-')

    plt.plot( wavelength_z, response_z, 'orange')

    plt.axis(v)

    plt.show()

    I have the axes set so they each go from 0 to 400 at the moment so that I can see the graph, but I am trying to set it so that The x axis goes from 2500 to 12,000 and they y axis goes from 0 to 0.1 with less intervals then I have now. Also for some reason the x-axis jumps back to 8000 from around 11,000. Can anyone help me out?

    graph: https://imgur.com/qzcyPWk x axis: https://imgur.com/eYxbKsP

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

    Editor w/ Best Scripting Lanaguage

    Posted: 07 Dec 2017 07:44 AM PST

    Atom, Sublime, Vi, Emacs, etc. all let you write code to automate tasks. Sublime has python (I think), VI has Vimscript, etc.

    Of these and similarly popular generic editors (not language-specific IDEs), with which of them have you had the best experience scripting / automating tasks. For example, I think that Atom requires you to have Node.JS installed and then write a plugin to extend anything, whereas in VIM you can just write a vimscript function.

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

    How does the programming community in general view React and React Native?

    Posted: 07 Dec 2017 11:05 AM PST

    Something worth investing in? Just a fad that'll pass over? Something small that'll turn out huge in the future? A language that'll be popular at first and then slowly fizzle out?

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

    Rails, Django, or Phoenix?

    Posted: 07 Dec 2017 09:15 AM PST

    OK, I'd like to get serious about web development to launch a few side projects that I hope will become my main gig. The three stacks I'm considering tripling down on are Rails, Django, or Phoenix. I have played with all three, but playing isn't creating more complex production projects.

    What I like about each:

    Rails: It's highly productive and I currently know Ruby the most. Plenty of jobs, if needed. Django: It's fairly productive and I know Python. Faster than Rails. Can use data science/ML in my web apps. Python's adoption is growing fast. An okay amount of jobs, if needed. Phoenix: It's fairly productive and much faster than Django and Rails. Functional programming and the Erlang ecosystem could lead me to write better code. While I know Elixir the least, I like the language and don't mind dropping OOP. 

    What I don't like about each:

    Rails: So much magic. Slowest of 'em all. Ruby adoption is going down, so I feel I'm investing in a depreciating asset and Ruby is mostly used for web development so I can't reuse the language that much in other areas. Django: the most explicit (by design) so I feel like I'm hand holding Django. It's slower to develop than Rails and less flexible. I feel like I'm investing in old technology, right or wrong, that hasn't progressed as quickly as Rails has. In a way, it's the opposite of Rails' situation. The language is going places unlike Ruby, but I'm not sure the framework is. Phoenix: it's a niche, there are fewer libraries, few jobs if I lose my current one, and there is so much to learn at once to get both Elixir and BEAM/OTP. 

    Do you have any thoughts on this? What would you do?

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

    What is wrong with this Visual Basic Code?

    Posted: 07 Dec 2017 08:45 AM PST

    So, I'm new to VB and I have to make a rock paper scissors, and it is pretty bad, but it works until Line 17 (End Select), and stops working at line 18.

    Can someone tell me what is wrong with it? Feel free to change anything about it.

    Module Module1

    Sub Main() 'Rock Paper or Scissors Dim PC As Integer Dim P1 As String Randomize() Console.WriteLine("Rock, Paper or Scissors?") PC = CInt(Rnd() * 2) + 1 P1 = Console.ReadLine() Select Case PC Case Is = "1" Console.WriteLine("The Opposition chooses Rock") Case Is = "2" Console.WriteLine("The Opposition chooses Paper") Case Is = "3" Console.WriteLine("The Opposition chooses Scissors") End Select 'Does not run the next code If P1 = "Rock" & PC = "1" Then Console.WriteLine("Draw") Else If P1 = "Rock" & PC = "2" Then Console.WriteLine("Lose") Else If P1 = "Rock" & PC = "3" Then Console.WriteLine("Win") Else If P1 = "Paper" & PC = "1" Then Console.WriteLine("Win") Else If P1 = "Paper" & PC = "2" Then Console.WriteLine("Draw") Else If P1 = "Paper" & PC = "3" Then Console.WriteLine("Lose") Else If P1 = "Scissors" & PC = "1" Then Console.WriteLine("Lose") Else If P1 = "Scissors" & PC = "2" Then Console.WriteLine("Lose") Else If P1 = "Scissors" & PC = "3" Then Console.WriteLine("Draw") End If Console.ReadLine() End Sub 

    End Module


    Thank you if you spend the time to contribute to this.

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

    Sending a randomly generated list over client-server TCP. Python

    Posted: 07 Dec 2017 08:36 AM PST

    I'm trying to create a generator using server client that contains a list of strings. Also, its suppose to keep asking the user for another string till user says no. I get the first string but when user types "yes" the whole list is given back, not the randomly selected strings. Any help would be great.

    Server

    import random import socket Port =3300 Server= socket.socket(socket.AF_INET, socket.SOCK_STREAM) Server.bind((socket.gethostname(),Port)) Server.listen(1) print ("The server is ready to recieve ") quotes = ["Hello son", "My favorite color is blood", "Where's Waldo?", "Help", "Mayo is better than ketchup"] while True: connectionSocket, addr = Server.accept() sentence = connectionSocket.recv(2048) for i in quotes: items = random.choice(quotes) connectionSocket.sendall(items.encode()) Server.close() 

    Client

    serverName = socket.gethostname() Port=3300 clientSocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) clientSocket.connect((serverName,Port)) msg = "Quote is: " while True: clientSocket.send(msg.encode()) msg = clientSocket.recv(2048) print(msg.decode()) x = input(("Would you like another quote? Type 'yes' or 'no' ")) if x =='yes': pass elif x == 'no': print ("Thanks for using me, bye! ") quit() else: print("Invalid input try again") clientSocket.close() 
    submitted by /u/Pandappl
    [link] [comments]

    How do I add python 2.7 as a Kernel in Jupyter Notebook?

    Posted: 07 Dec 2017 07:20 AM PST

    Im using Anaconda3's Jupyter Notebook, I want to install python 2.7 as a kernel, Is it possible?

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

    I have a program that I can export data from (.csv) - how can I automate it

    Posted: 07 Dec 2017 06:29 AM PST

    Hey!

    I'm using a program that tracks certain data and you can either view the data inside the program or extract it into a .csv file.

    What I would like to do is automate the process, so that it downloads the files, and names them accordingly (which ID and PC it was at) and saves them in some kind of folder.

    I would then extract the data I need from those files using pandas python script.

    What I don't know is - what can I do to download the files.

    Make a program in c++/c#? Automate it using AHK?

    Looking forward to your answers!

    Bye!

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

    Is there a framework that is beginner friendly for automating web browser user form testing?

    Posted: 07 Dec 2017 06:22 AM PST

    So I have a temporary User QA job. Basically my job is completely non-technical. It is simply me acting as a user and filling out forms. Each time I keep using the same information. I have to retype the information every time.

    Is there any beginner friendly web testing framework that can automate the filling out of forms?

    I want to program something to make my job easier. What should I read and where should I look for resources on how to solve my problem?

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

    How different is programming for a blockchain environment from regular old programming?

    Posted: 07 Dec 2017 12:01 AM PST

    Java Runtime.exec(command) will execute commands such as "touch test.txt" but does nothing when provided things such as "python test.py"

    Posted: 07 Dec 2017 05:06 AM PST

    Its strange, yesterday was working on this java program that executes python scripts that create text files using "Runtime.getRuntime("python test.py");". However today I go to work on it and it literally seems to do nothing when given those commands, however things such as "Runtime.getRuntime("touch help.txt");" work. I'm kind of lost on whats going on, when I run the "python test.py" from the command line it works. Any ideas? (I'm not getting any errors)

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

    No comments:

    Post a Comment