• Breaking News

    Friday, December 8, 2017

    Programmer job for someone familiar with scientific computing ? Ask Programming

    Programmer job for someone familiar with scientific computing ? Ask Programming


    Programmer job for someone familiar with scientific computing ?

    Posted: 08 Dec 2017 06:13 PM PST

    Hello all!

    I am close to finishing up a PhD in aerospace engineering. I have been working on computational mechanics but as I've gotten closer, I've realized I really dislike my field. For my research, I code scientific formulations that I develop, which are very computationally intensive (HPC clusters 30-40 core jobs 3-4 days runtime.) I really feel like changing my career path after my PhD. However, I don't quite have a lot of great skillsets. One thing I realized I quite enjoy is optimizing code for faster runtime (not compiler optimizations, that's crazy smart stuff, just trying to optimize algorithms, using some memory hacks, rolling loops, writing codes intelligently, decreasing conditionals etc). It was always fun to try to shave off processing times from my codes. I mostly code in FORTRAN, C/C++, with a (very) basic understanding of openMPI. I am pretty okay with Python as well.

    So during this life crisis of mine, a question that I had for all of you was, do you believe I could market myself to the programming industry at all. I am probably not even looking at amazing jobs, just something interesting that I could pay bills with.

    Thank you!

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

    Unsure how to use Calendar API in my web app

    Posted: 08 Dec 2017 05:04 PM PST

    I'm still ~fairly~ new to programming, but am trying a project which is a web app with the google calendar api. I have planned to use rails as my backend language but am just unsure how to use any of it together / link it together.

    I used the quickstart html provided by google which gave me a basic webpage that can display my timetable events. however, i want to do some more advanced processing and I have been advised to do it in rails which i already know.

    how do i link my web page with the html, with the calendar api, and with rails?

    can anyone give me any help or any pointers/tutorials or any material which may help me?

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

    How do people build flight booking sites?

    Posted: 08 Dec 2017 07:00 PM PST

    I see alot of 3rd party flight websites, how are they created? (As far as flight scheduling queries etc)

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

    Nine patch drawables in android

    Posted: 08 Dec 2017 06:55 PM PST

    Right now I am using canvas.drawCircle() to draw dots that represent objects. How can I do this with nine patch drawables instead? Here is my onDraw method.

    protected void onDraw(Canvas canvas) { super.onDraw(canvas); if(snakeViewMap != null) { float tileSizeX = canvas.getWidth() / snakeViewMap.length; float tileSizeY = canvas.getHeight() / snakeViewMap[0].length; float circleSize = Math.min(tileSizeX, tileSizeY) / 2; for (int x = 0; x < snakeViewMap.length; x++) { for (int y = 0; y <snakeViewMap[x].length; y++) { switch (snakeViewMap[x][y]) { case Nothing: mPaint.setColor(Color.WHITE); break; case Wall: mPaint.setColor(Color.RED); break; case SnakeHead: mPaint.setColor(Color.BLACK); break; case SnakeTail: mPaint.setColor(Color.GREEN); break; case Apple: mPaint.setColor(Color.RED); break; } canvas.drawCircle(x * tileSizeX + tileSizeX / 2f + circleSize / 2, y * tileSizeY + tileSizeY /2f + circleSize / 2, circleSize, mPaint); } } } } 
    submitted by /u/FR33ZEx
    [link] [comments]

    If you learnt CS in high school (age 11-18), could you briefly describe how CS was taught?

    Posted: 08 Dec 2017 01:58 PM PST

    I'm a teacher in the UK and I know that whilst South Korea, America, Singapore, New Zealand (and many more) have relaunched their CS curriculum, some countries started in the 80's and never stopped.

    I'd be particularly interested in countries such as Russia, Romania, Poland, Hungary, Greece. All countries welcome though.

    Please state your country, whether it was state school or private (fee paying) school and the rough structure of typical lessons.

    CS education is still in its infancy in the UK and many countries and I think we've got a lot to learn from you all.

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

    Problem converting simple code from standard .Net to core.

    Posted: 08 Dec 2017 05:02 PM PST

    In standard net, this code works perfectly. I want to see the info of the certificate:

     static void Main(string[] args) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.sbb.ch"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); X509Certificate2 certificate = new X509Certificate2(request.ServicePoint.Certificate); Console.WriteLine(certificate); Console.ReadLine(); } 

    However, the same code used in .NET Core will raise an error "System.PlatformNotSupportedException: 'Operation is not supported on this platform.'" for the X509Certificate2 operation.

    Any ideas? I just need to get the details of a certificate in core.

    submitted by /u/Hammond-of-Texas
    [link] [comments]

    How would use variables of a struct in another program? [c]

    Posted: 08 Dec 2017 04:56 PM PST

    I have a struct initialized in my original program, but want to change a value of one of the variables in the struct to "INVALID"

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

    How to add up values in ArrayList?

    Posted: 08 Dec 2017 03:14 PM PST

    Say I have 15 products each one has a product code 101,102 etc. Then it has a price assigned to it. How do I allow user to input the product codes from a list and then it calculates the price of all the product they input?

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

    Languages to recreate an airport website?

    Posted: 08 Dec 2017 02:55 PM PST

    I want to create a functional and aesthetic airport website. Maybe create my own API if I can't find one. This will be a side project added to my portfolio.

    What languages would be appropriate/easy to create this?

    ---- OR!!

    Should I do an airline website instead of airport? If so, what languages?

    Thanks!!

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

    Does anyone here work for a web application product that DOES NOT support IE?

    Posted: 08 Dec 2017 07:20 AM PST

    My work's development team spends a lot of time making sure things look the same on all browsers, including IE 11 (we only support the latest version of IE), and according to our user tracking stats, a very tiny percentage of users are using IE. This could even be just developers and staff testing things out on IE.

    I'd like to know if there are some web applications that don't support IE.

    Is it really that faux-pas to not support IE?

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

    How does it work to create an ID for my own service using a social web site's login API?

    Posted: 08 Dec 2017 11:02 AM PST

    Let's say my service (app or web site) has nothing to do with Facebook (e.g., posting to Facebook) but uses Facebook's login API so that users can join/login into MY service without manually creating a new ID.

    I have tested Facebook's API. If I call the login API, I am asked if I would allow my service to access the Facebook account. If I allow it, the API returns "accessToken" and "userID". The access token seems to be a long cryptic string and the user ID is a short numeric string.

    But under the hood, I need to generate a user account for the user on my service. The ID can automatically be generated and be transparent to the user, something like "facebook-[user's facebook ID]". But what about the password? At first, I thought I could use that access token as the password, but it seems that access token changes for each login.

    My app can get the signal that the user is authenticated by Facebook, but hackers can decompile my app and send a fake message to my server, something like "Facebook user ID is [fake id by the hacker] and is authenticated by Facebook".

    So, I thought, my app may send the user ID and the access token to the server, and then the server call some Facebook API to test if the access token is valid. Is that how it should work? I could not find tutorial for this by searching Google. If you know one, please let me know.

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

    [C] Reallocating a string array

    Posted: 08 Dec 2017 01:43 PM PST

    Hello, For simplicity, I will refer to char* as string.

    I'm trying to reallocate an array of strings (char**). The array is resized, but all strings are lost in the process.

    Here's how I reallocate:

    void reallocText(char*** text, int count) { *text = (char**)realloc(*text, count * sizeof(char)); } 

    Here's how I populate my string array:

    myArray[row] = string; ++row; reallocText(&myArray, row + 1); 

    string is a char* and data is saved correctly to it.

    Thank you in advance!

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

    What is a good way to learn Groovyscripting to use in JIRA?

    Posted: 08 Dec 2017 01:15 PM PST

    Hi,

    I would like to learn groovy scripting to use in Atlassian JIRA. Should I learn groovy first? Or is there a difference between learning how to make a groovyscript and groovy compilable code? In other words, what would be a good way to learn groovyscripts?

    Thanks!

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

    How to create a lucky draw application, similar to reddit secretsanta matching

    Posted: 08 Dec 2017 12:51 PM PST

    Hello!

    I would like to create a rather simple application, what I can use with my friends and family.

    Idea: I list up names on a website dropdown, and the one who would like to participate in that game, selects his/her name. After that, clicks on a button and to him/her is displayed name to who he/she is making a gift (giftee). Someone else gets his/her name but it remains secret, whose name someone got.

    If computer randomly gives to the one wanting to have a giftee his/her own name, application displays it as "click again".

    My HTML, CSS and JS are here: https://jsfiddle.net/5w7nnudf/5/ And Python here:

    1) luckydraw.py

    import cgitb; cgitb.enable() import cgi import random import json print('Content-type: text/html\n') num_lines = sum(1 for line in open('/home/Tauri/public_html/test/computer.txt', 'r')) print(num_lines) number = 4 - num_lines if number > -1: computerChoice = random.randint(0,number) #giftee.txt is where I store the names of participants (among who the matching is done) f=open('/home/Tauri/public_html/test/giftee.txt') lines=f.readlines() computerChoice = lines[computerChoice] form = cgi.FieldStorage() user = form['user'].value if user in open('/home/Tauri/public_html/test/users.txt').read(): file = open('/home/Tauri/public_html/test/current.txt', 'w') file.write("You already participated!") file.close() else: if computerChoice in open('/home/Tauri/public_html/test/computer.txt').read(): file = open('/home/Tauri/public_html/test/current.txt', 'w') file.write("Click again please!") file.close() else: if computerChoice == user: file = open('/home/Tauri.Turkson/public_html/test/current.txt', 'w') file.write("Click again please!") file.close() else: file = open('/home/Tauri/public_html/test/computer.txt', 'a') file.write(computerChoice) file.close() file = open('/home/Tauri/public_html/test/users.txt', 'a') file.write(user + '\n') file.close() file = open('/home/Tauri/public_html/test/current.txt', 'w') file.write(computerChoice) file.close() file = open('/home/Tauri/public_html/test/giftee.txt', 'r') lines = file.readlines() file.close() file = open('/home/Tauri/public_html/test/giftee.txt', 'w') for line in lines: if line!= computerChoice: file.write(line) file.close() else: file = open('/home/Tauri/public_html/test/current.txt', 'w') file.write("Matching is complete!") file.close() 

    2) readLuckydraw.py

    import json print('Content-type: application/json\n') file = open('/home/Tauri/public_html/test/current.txt', 'r') last = file.readline() print(last) file.close() 

    Problem: it works, but very slowly - doesn't give feedback (to user) whether it's loading or not, and sometimes shows the same name that is selected from dropdown.

    How can I make that application fully functional?

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

    Looking for an API to make and alter word clouds (on a by-word basis) with HTML canvas?

    Posted: 08 Dec 2017 08:08 AM PST

    Can somebody give me a bird-eye view of what it would take to build a website like nicehash.com?

    Posted: 08 Dec 2017 11:46 AM PST

    I am looking for a new hobby that makes money and I think this would be a great way to learn to program. Can somebody give me like a 4 sentence overview of what technologies/languages I would have to learn to build a site like nicehash.com?

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

    Program infinitely repeats itself! Help (Program with Scanners and Strings)!

    Posted: 08 Dec 2017 07:22 AM PST

    Here is my code: public class Quiz {

    public static void main(String[] args) {

     Scanner smashInput = new Scanner(System.in); introduction(); question1(smashInput); 

    }

    public static void introduction() {

     System.out.println("Welcome to my game!"); System.out.println("Answer the following questions!"); System.out.println(); 

    }

    public static void question1(Scanner smashInput) {

     System.out.print("Which smash game has pichu? "); String answer = smashInput.nextLine(); checkAnswer(answer, smashInput); 

    }

    public static void checkAnswer(String answer, Scanner smashInput) {

     while(!answer.equals("melee")) { System.out.println("Your wrong... try again"); question1(smashInput); } System.out.println("Correct"); 

    } }

    Forgive me if the answer is obvious, but I'm just getting back into programming after taking a year off (I took a beginners java course and then stopped). So here, the program will ask for an answer, check to see if it's the answer I want, and if it's not it's supposed to repeat itself until the user gets it right. Once it's right I want it to stop, but after getting it wrong a few times and then getting it right, it continues to repeat itself. I've stared at this for awhile and I still can't figure it out.

    Thanks!!!

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

    New to coding, need help graphing in Python.

    Posted: 08 Dec 2017 10:44 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

    spectra_1Gyr = 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]

    Java or C# in 2018 and beyond

    Posted: 08 Dec 2017 01:55 AM PST

    So I'm doing a study where we can choose our programming languages between C# and Java. Which one of the two programming languages will be better in 2018 and beyond?

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

    Error using scan() in R. Trying to enter data file in model as vector but reading the header.

    Posted: 08 Dec 2017 04:57 AM PST

    I have to enter a data file of 360 temperatures (so just one column of data with a header) into a model. The model is usually entered as a vector: temp = c(1, 2, 3, 4) I have tried entering it like temp_data = read.csv("Temperature.csv", header =TRUE) temp = temp_data but I think it is reading the header, and the model won't work as it has a different number of temperature values to days. I've also tried the scan() function. Please help, complete noob

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

    I have 6 wooden pieces that should build into a 3x3x3 cube. How would you go about building a program that would find out in what order they should be placed?

    Posted: 08 Dec 2017 04:44 AM PST

    It looks something like this

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

    No comments:

    Post a Comment