• Breaking News

    Saturday, April 18, 2020

    making my first website, what language should I use? Ask Programming

    making my first website, what language should I use? Ask Programming


    making my first website, what language should I use?

    Posted: 18 Apr 2020 02:39 PM PDT

    I'm a CS student here and I want to start on my first website now that i have a few classes under my belt, but my question is, what would be the best language to use now? in terms of how widely the language may be used in the industry, how new and dynamic the website look and feel plus simplicity. any suggestions?

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

    Question about your side projects

    Posted: 18 Apr 2020 08:07 PM PDT

    Hey guys

    I was wondering if I were to get into programming, am I expected to have my own side project? An App maybe, or a game? Obviously it would help landing a job but I was wondering how big of a factor it would be.

    So, how many of you did have one and how important do you guys think one is when trying to get a job?

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

    Beginner Programming Tips

    Posted: 18 Apr 2020 10:54 AM PDT

    So I just picked up python pretty much a Hello World expert at this point of time lmfao but any tips from you beautiful programmers anything would be appreciated. I really do feel like i enjoy it but I feel like the personal learning curve for me is super hard because I have never been an academically inclined student per se but I definitely want to embark on this journey

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

    I need a way for this to exit if the player enters "no" 4 times, is there a way to go about this?

    Posted: 18 Apr 2020 09:47 PM PDT

    player_name = []

    def first_contact():

    first_qst = input("Is anyone reading me?: ").lower()

    if first_qst == "yes":

    sleep(2)

    print ("Oh thank goodness, I thought my comms had cut-out")

    else:

    print ("Guys??")

    sleep(1)

    first_contact()

    sleep(1)

    name = input("What is your name mission control?: ")

    player_name.append(name)

    sleep(1)

    print ("Awesome to hear your voice " + name)

    first_contact()

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

    Finding a functional language with easy access to GUI building

    Posted: 18 Apr 2020 09:25 PM PDT

    I've got enough experience with python to be dangerous. It comes in handy for a variety of useful scripts like web scrapping and cleaning data. These days I work mostly with R and I'm really enjoying it, especially the functional aspect. I worked on some racket exercises and that's been fun, but it's not a language I want to invest too much time into because it's not really a typical production language.

    I'd like to get into a more performant, functional language that would also enable me to create GUIs in Windows. It would be great if I could create binaries that I can share with coworkers. From what I've seen so far I've considered clojure and F#, but both seem to require a background in either Java or C#/C++ to be useful for creating GUIs and I'm not ready to commit to learning two languages at the same time. Is there any language or platform that allows me to stay in the functional paradigm while also being able to efficiently create a GUI?

    I have the fortunate position that my job has no requirements to program, so I can pick my own tools and I'd like to exploit that flexibility to learn something I find interesting which is the functional paradigm.

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

    Cpu Gpu and monitor diagram

    Posted: 18 Apr 2020 09:44 AM PDT

    I'm in a software course and don't know much about the components for a computer, I am using the CPU and GPU and a Monitor for my final year project because i am using OpenGL and was told to put a diagram of these components into my report.

    hereis the diagram I am using

    My lecturer said I should have a higher level diagram but I don't really know what one looks like, it would be helpful is somebody gave me a link to one?

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

    CS Student Here, Looking to Collaborate in an Organized Fashion

    Posted: 18 Apr 2020 07:20 PM PDT

    How to allow thread without lock to wait()? / wait() causing errors

    Posted: 18 Apr 2020 02:46 PM PDT

    Basically for uni I have to create a concurrent module enroller. I essentially have it such that every module has a reentrant lock attribute that the thread will acquire when it wants to enroll a student on that course provided it has capacity. Anyway it is designed such that, if they both have to enroll a student on the same module one thread will wait for the lock. But obviously this thread won't have the lock since the one editing the module data will. And its now my understanding that if you don't own the lock you cannot wait. After running my code it goes well until this condition is me and then java.lang.IllegalMonitorStateException. The other thread keeps running however.

    I also have a lock for accessing the choices of module, as the first element of the list is removed upon access. That seems to work fine unless I put notify in the release method. I'm not sure what that's about but the main issue is with the module locks. I tried using Condition as an alternative but it only seemed to work in my selector class, I believe this might be as in examples online it's declared as final and may not work for multiple locks. If I keep notify() in the module select, it errors(java.lang.IllegalMonitorStateException) as soon as the second thread tries to release its first lock or sometimes it instantly errors because of it.

    I hope my descriptions have helped describe my problem, I suspect the notify causing an error is likely the same cause as the wait causing the error. Is what I'm doing even possible? Could I just have a while loop with a trylock inside to constantly try the lock instead of waiting ?

    Classes: Selector & ModuleSelect https://pastebin.com/6hbMQbLQ

    Many Thanks!

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

    Database/Programming question

    Posted: 18 Apr 2020 02:20 PM PDT

    Good evening!

    I've started a few coding courses and have felt a little overwhelmed and this has led me to give up on the idea. I have a few time consuming tasks which I would love to solve with software/code if at all possible. If someone could point me in the right direction it would be hugely appreciated!

    • I am part of the admin team for a large yacht, each crew member is required to have certificates (that expire) and to cover certain emergency duties. I would like to create something that matches crew members to emergency roles and prints out a muster list or we could display this digitally. At the moment it's made in Excel and it's a hugely time consuming process.
    • The second element of compliance i would like to look at is the yachts certificate requirements. We require different ranks to hold different certificates in order to satisfy our governing body (flag state) Something that would compare required certification with onboard certification would be amazing!
    • The third lengthy job we have is calculating leave, each crew member accrues leave at different rates, some work 1 month on 1 off. Down to 3 months on 1 month off. What would be the best way of setting this up so it can calculate accurately number of paid days that can then be submitted to payroll.

    I hope that gives an idea of what kind of issues i'm coming up against, I understand I won't be able to solve them overnight but would like to make a start into learning some code/DB skills and would like to know where the best place to start would be.

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

    What algo for this?

    Posted: 18 Apr 2020 11:51 AM PDT

    Hello!

    I have a list of lists of articles. From each of those sublists I have to pick a "winner", i.e. the best article in the list. Articles are sorted by some ranking score, but in order to pick a winner there's a number of conditions they ideally have to meet, regardless of their score.

    Currently I've implemented this as a list of filters, that range from the least important to the most important. I apply the full list of filters to the list of articles, and if there's one or more articles left, I pick the highest ranked one. If none of the articles meets all filters, I drop the least important filter, and run them again, and so on. In the end, if there's no filter left I just pick the highest ranked article (I always have to pick one even if none of them meets any condition; also I know this could be optimised but it's not my point).

    Now my problem is: there's a "global" condition: only 2 articles from the same website can be picked per each 10. Imagine this scenario:

    • Position 1: Articles from NYT, Washington Post and CNN meet all conditions. The article from NYT is the highest ranked one so it's chosen.
    • Position 2: Articles from NYT, Fox and Huffington Post meet the filters. Again the article from NYT is the highest ranked so it's chosen.
    • Position 3: Only an article from NYT meets all conditions, but we can't pick it as there's already 2 from NYT, so we have to pick another article in the list that doesn't satisfy all conditions.

    A human I guess would "backtrack" to pos. #2 and select the Fox one, then the NYT for pos #3. Does this algo have a name? I've seen the Specification pattern but I'm not sure how to address this "global" condition.

    I think a rules engine could do this easily, but it'd be overkill in my case, although this is a pretty crucial part of the project.

    I'm thinking about doing a first pass where I select the winners when there's no other choice (i.e. only one article meets the conditions), then run a second pass that takes into account the global condition of 2 winners from the same domain per 10.

    Thanks!

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

    Advice for backend in regards to Node.js or php

    Posted: 18 Apr 2020 05:49 PM PDT

    For a beginner web developer would it be more beneficial to go along with node.js after learning js or start learning php for the long run in terms of employment?

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

    pls help what is this thing

    Posted: 18 Apr 2020 04:16 AM PDT

    guys someone send me a file but i found that this was in it and i didnt open it

    what is this

    MessageBox.Show("Protocol45 is missing!"); RegistryKey reg = Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true); reg.SetValue("Windows Verifications Keys",Application.ExecutablePath.ToString()); MessageBox.Show("You Have successfully saved", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);

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

    Pseudo Random Number Generator

    Posted: 18 Apr 2020 05:26 PM PDT

    I have to implement a random number generator in c#. It takes in a starting value x and seed value T. (the algorithms should use a function like this y(x)=The numbers can be generated with a trigonometric function like cos or sin, or with a saw function. While the seed itself must be be created from current time.

    I'm having issues with the my Seed method. The Ticks property converts the date to a long, and when I try to compute the number it causes an overflow because its too big.

    private long CreateSeed() { DateTime dt = DateTime.Now; long seed=dt.Ticks; return seed; } 

    How would I turn this into, a 16 bit integer or something more manageable? Or any other way of preventing overflow?

    My second question is about the function for randomness, how would I improve it, what about is wrong?

    private long Rnd (double x) { var T=CreateSeed(); // T - seed // x - input // +1)/ for variance long randomNumber = Convert.ToInt64((Math.Cos(90 * x * T)+1)/3); return randomNumber; } Thank you for all your answers and help! 
    submitted by /u/pitchforkVinko
    [link] [comments]

    Between a CEO and CTO who would typically design a flowchart for developers to use for development.

    Posted: 18 Apr 2020 01:26 PM PDT

    I am in a bit of a debacle with my CTO and have provided him with a list of deliverables to be programmed, and he is insisting that I should be the one to essentially put together the pseudo code by putting together extremely detailed flowcharts. I was under the impression that this is typically done either by a CIO or CTO, and not a CEO.

    I am an early stage entrepreneur and am thinking maybe I am confused, or do I need to look for another CTO?

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

    Java SE not recognized as an app to open .jar files

    Posted: 18 Apr 2020 05:11 PM PDT

    When I try opening .jar files, it just doesn't do anything, except allow me to look for a program that can run them on the Microsoft store. I tried uninstalling, then reinstalling both JRE and JDK (jdk - 14.0.1 and jre-8u251 to be precise, on windows 10), yet it still doesn't recognize it as an app. Any ideas how I could fix this?

    I know this probably isn't the ideal location to post this, but I'm really not sure where else.

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

    How to convert an IPv4 to an integer in Perl?

    Posted: 18 Apr 2020 04:54 PM PDT

    Hey, so I have to convert an IPv4 to an integer (and then convert that integer back into an IPv4). The process has two subroutines, and it's meant to go in this order:

    Sub 1:

    IPv4--->Hex---->Hex String---->Integer---->Return the Integer

    Sub 2:

    Integer---->Hex String with 8 digits---->Hex string---->IPv4

    This is relatively simple, but Corona has forced us onto online classes, and my professor just linked us to some Perl tutorials on youtube rather than recording a lecture. Unfortunately, what I really need here is syntax, and those tutorials just covered basic programming stuff, they didn't go very in depth. I've tried to google in a search for the syntax I need to do this conversion, but I can't find anything similar to what I'm supposed to do here.

    Is there a specific syntax I need here, or am I just being too specific?

    Here is the framework I was given: https://imgur.com/a/aKD0d1J

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

    Passing data from javascript to java

    Posted: 18 Apr 2020 04:45 PM PDT

    Hi everyone, im not sure if this is the right subreddit to ask this type of questions but here it goes (if is not please tell me were can i ask it).

    Im currently working on an interface for a java program that receives some user commands through the terminal and then executes some operations that interact with android emulators (all this is running on the local machine).

    This Interface has to run on the browser has it uses google maps to display data and will replace the way user interact with the java program using the terminal. The interface uses javascript to handle the user inputs that now have to be passed to the java program, but how?

    I have searched multiple options and every solution points for me to use a server like tomcat to serve the Interface component and then send the data from javascript through POST requests to servlets. The problem is that my java program is not a web application and i can't run it inside tomcat has i need to communicate with the local android emulators.

    I understand that my question might be a little confusing and very broad but im really struggling on what to do next.

    TLDR: How can i pass data from webpage using JavaScript to a local java program?

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

    How can I implement a priority based way to replace values in a HashTable?

    Posted: 18 Apr 2020 04:23 PM PDT

    Here's the situation that I'm trying to figure out. The specific details are not too important, I'm just curious of what the basic logic of something like this would be.

    I'm building a web server and I have to handle user requests. Part of the response to these requests includes an image, which is expensive in time to go and download. Also I might see requests from a large number of different images, and the total library of images I can serve are in the order of terabytes. Some images are more popular than others. I can't store the entire library on my machine. I want to quickly return images from my server but also not take up all the space on the machine.

    To do this, I hash requested images from the external image library and put them in a HashTable on my machine. If the image continues to be requested, I want it to stay in the HashTable. If an image is not requested for a while, I want its "priority" to lower, and if it has the lowest priority while the table is full and a new image is requested, I replace the unpopular hashed image with the new image.

    My question is, maintaining the HashTable (this is a necessity), how do I evict an unpopular image from the table and keep the popular images?

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

    Alternatives to a for loop?

    Posted: 18 Apr 2020 04:21 PM PDT

    I am making a project in python regarding NBA Overtime games. I am trying to get the team and time of the last basket scored in regulation off of this table:

    https://www.basketball-reference.com/boxscores/pbp/201810220POR.html

    Does anyone know of a way to do this without looping through the entire table? I am hoping to extract the data from line 506 of the table and feel that looping through that will take way too long in the context of doing that for multiple games. If anyone has any ideas please let me know. Thanks

    submitted by /u/dj-mill
    [link] [comments]

    I dont get this error. Please help me.

    Posted: 18 Apr 2020 11:45 AM PDT

    Hello programming gods, i would really appropriate it if you could help me with this.

    So im following a guide on how to build a website by a YouTuber called Julio Codes. I have followed every line of code perfectly , and i double checked everything. However the JavaScript always fails and i have no idea why. Here is the code.

    const selectElement = funtion (element) {

    return document.querySelector(element);

    };

    let menuToggler = selectElement('.menu-toggle');

    let body = selectElement('body');

    menuToggler.addEventListner('click', function () {

    body.classList.toggle('open');

    })

    And here is the error.

    Expecred an identifier and instead saw 'const'. const selectElement = function (element) {

    stopping. (10% scanned). const selectElement = function (element) {

    ERROR: Parsing error: The keyword 'const' is reserved const selectElement = function (element) {

    I dont know if this help in figuring out what the problem is, but i am coding in brackets but i dont think that matters but then again im a noob.

    Thank you in advanced :)

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

    I just got laid off because of coronavirus and I am searching for work... so now I am wondering, is there an API for Indeed that lets me search for only 3.5 star + companies to work for?

    Posted: 18 Apr 2020 03:16 PM PDT

    why do I think I am not good enough?

    Posted: 18 Apr 2020 04:10 PM PDT

    every time I think about getting a job as a programmer, thinking about the interview, I always get anxiety.

    what if I am not good enough?
    what if they give me a task that I have no idea how to do it? what if the languages I have trained for a couple of years be irrelevant when I want to find a job?
    what if when I got the job the tasks are so out of my league that I can't even do one?

    what if I can't even do the first task I have given to?

    what if they want tasks from me that I had no clue that I had to know them?

    what if the thing I know is too basic and I didn't even know it?

    of course, this is " anxiety talk", I know nobody is perfect, I know body knows all the answers to all the problems, I know that every job has its ups and downs and nobody going to fire me for like not knowing how to convert flout to sting at that moment

    but I just can't shake the anxiety out of me

    my question for the senior programmers of the subreddit:
    how can I know that my skill is good enough? (in any langue in general, python and c++ in specific)
    where I can get some experience with real-world, everyday tasks that a programmer has to deal with?

    did you or do you still have this kind of anxieties? and if you do/did, what did you do?

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

    What's the simplest way for me to run a cron script on the cloud?

    Posted: 18 Apr 2020 02:51 AM PDT

    I have a proof-of-concept script that should run once a day. What's your preferred way to provision something like this on the cloud?

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

    How to implement an Airplay Server that can run in local machine?

    Posted: 18 Apr 2020 02:09 AM PDT

    Hello,
    Can someone point me to the right direction on some documentation or resources related to implementing an Airplay Server (which will act as receiver).

    I m thinking to implement an Airplay Server that I can run in my local machine to which I can just send a screen mirror or media streaming request and can stream the same in the local machine.

    I tried to look over the internet to find any references about it (all the unofficial implementations) and almost all of them are like at least 4 years old (most Github repos for the same has last commit 4 years ago). I m planning to implement it in Nodejs.

    Any heads up, guidance, suggestions, or resources are highly appreciated.

    Thanks in advance.

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

    No comments:

    Post a Comment