• Breaking News

    Thursday, December 2, 2021

    Can you have all the advantages of a software developer without a degree? Ask Programming

    Can you have all the advantages of a software developer without a degree? Ask Programming


    Can you have all the advantages of a software developer without a degree?

    Posted: 02 Dec 2021 12:49 PM PST

    I want to be a software developer but I don't think that a university is suitable for my person and my learning process. Do you think I could be a software developer without a degree? ( I live in europe). Will I obtain work visas despite the lack of degree and will I be fairly paid?

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

    How do you write unit tests for network code?

    Posted: 02 Dec 2021 09:53 PM PST

    For a program that uses sockets and involves clients and servers interacting over a network, what are the best practices for writing unit tests? I'm totally unfamiliar with how tests are written for this type of program and online resources haven't been particularly helpful.

    As an example, how would I write a unit test for the following function in Erlang (a loop in a server program for accepting connections)? It seems like there's too many moving parts to isolate behavior.

    accept_connections(ListenSocket, DictPid) -> case gen_tcp:accept(ListenSocket) of {ok, ClientSocket} -> io:format("Accepting:~w~n", [ClientSocket]), gen_tcp:send(ClientSocket, "Welcome! Enter your name\n"), ClientPid = spawn(fun() -> io:format("Client connected"), setup_user(ClientSocket, DictPid) end), gen_tcp:controlling_process(ClientSocket, ClientPid), accept_connections(ListenSocket, DictPid); {error, Error} -> io:format("Accept Error: ~w~n", [Error]) end. 
    submitted by /u/alphabay12
    [link] [comments]

    How do I build curl data string/arg dynamically in a bash loop

    Posted: 02 Dec 2021 06:24 PM PST

    I am trying to submit data to elasticsearch. I have my index setup. My pipeline is correct. I am struggling to dynamically build the curl data. Note this is not about sticking curl in a loop, it's about building up the argument for -d

    This works in bash terminal, but not for a bash script (this is an edited example from the documents)

    curl -X PUT "http://elasticsearch:9200/genericData_index/_bulk?pipeline=genericData_index-pipeline&pretty" -H 'Content-Type: application/json' -d' { "create":{ } } { "message": "entry1,info1,40,244.3,4,2021-12-02 10:00:00","field": 40,"field2": 2,"field3": 30.33} ' 

    This works for a single entry from a bash script:

    #!/bin/bash curl -X PUT "http://elasticsearch:9200/genericData_index/_bulk?pipeline=genericData_index-pipeline&pretty" -H 'Content-Type: application/json' --data-binary @- << EOF { "create":{ } } { "message": "entry1,info1,40,244.3,4,2021-12-02 10:00:00","field": 40,"field2": 2,"field3": 30.33} EOF 

    This works for 3 entries in bulk with one submission

    #!/bin/bash curl -X PUT "http://elasticsearch:9200/genericData_index/_bulk?pipeline=genericData_index-pipeline&pretty" -H 'Content-Type: application/json' --data-binary @- << EOF { "create":{ } } { "message": "entry1,info1,40,244.3,4,2021-12-02 10:00:00","field": 40,"field2": 2,"field3": 30.33} { "create":{ } } { "message": "entry2,info2,40,244.3,4,2021-12-02 10:00:00","field": 40,"field2": 2,"field3": 30.33} { "create":{ } } { "message": "entry3,info3,40,244.3,4,2021-12-02 10:00:00","field": 40,"field2": 2,"field3": 30.33} EOF 

    what I want

    #!/bin/bash curl -X PUT "http://elasticsearch:9200/genericData_index/_bulk?pipeline=genericData_index-pipeline&pretty" -H 'Content-Type: application/json' --data-binary @- << EOF for i in $(seq 10); do { "create":{ } } { "message": "entry$i,info$i,40,244.3,4,2021-12-02 10:00:00","field": 40,"field2": 2,"field3": 30.33} EOF 

    This obviously does not work as is. I have also tried to build the string before the curl command but I am really struggling here.

    Caveats:

    • This is not homework. Feel free to spoil the answer because I have a headache!
    • Submission from python is even trickier because there's some auth crap I may not be able to get around. I KNOW the curl command works, I have been sitting here firing off record test submissions. But I need to dynamically add the data in bulk.
    • A curl call per record is not going to cut it either unfortunately though that would be much easier to dump the whole thing in a loop and that is most of the results I am getting, but that is just too heavy. I need to submit a bulk of about 800 records, I'll split them up if it's too heavy into chunks, either way I need the dynamic loop working for building each bulk submission, even if it's split into lots of 100 I still need the loop to dynamically build -d argument.
    • Note the $i in the message of my loop, that is because I need to throw some entries in there dynamically which is the point of looping for this
    • this isn't really an elasticsearch/kibana question, it's more of a curl question or a bash question, but any help would be much appreciated!

    Even if you have some ideas to try I'll give em a whirl. Obfuscated the data obviously.

    Thank you!!!

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

    Node Js permissions.

    Posted: 02 Dec 2021 04:56 PM PST

    Hi everyone, I need some help with the installation of Node Js, the first time I installed it I did it directly from the website, the LTS version, this brought me a lot of permissions problems so I reset my computer to factory because I could not uninstall node. Now I installed it with NVM and supposedly I shouldn't have permissions problems but I do, now I don't know how to fix it. I tried almost everything in this Stack overflow link and I couldn't solve it either. After installing NVM I saw that in this video he mention that I should change .bach for .zsh and I didn't do that when I installed it. Does anyone know if this could be the problem, or do you have a solution for this? I would really appreciate it.( Btw, I´m using macOS Monterey and the errors are "Perms check on local node_modules - not ok" and " Perms check on local bin folder -not ok") I´m new at this so any guidance is really appreacited! Thanks!

    submitted by /u/TheComrade11-8
    [link] [comments]

    Creating a for loop to loop through a nested list

    Posted: 02 Dec 2021 08:10 PM PST

    Hi, I have a nested list ttc_list which is basically formatted as follows:

    [[Ball(Mass = 1, radius = 1), Ball(Mass = 1, radius = 1), -0.9551175266892363] [Ball(Mass = 1, radius = 1), Container(radius = -10, mass =1e+09), 2.0607393496589017] [Ball(Mass = 1, radius = 1), Container(radius = -10, mass =1e+09), 3.9634857433379773],...] 

    Essentially, each list inside ttc_list contains a ball object, another ball object (or a container object, which is a child class of ball), and a time value; which is the time for the two balls/the ball and container to collide.

    I am trying to extract the list inside ttc_list which has the smallest positive time value. Right now my code is only extracting the smallest time value, irrespective of whether it is positive or negative, and I'm not sure why. Some help would be appreciated!

     temp_time = ttc_list[0] print('temp time tuple is', temp_time) for m in ttc_list: for p in range(len(m)): if ttc_list[p][2] <= 0: continue print(ttc_list[p]) if temp_time[2] > ttc_list[p][2]: temp_time = ttc_list[p] 

    so temp_time should be the list which has the smallest time value

    Thank you!

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

    Help with website possible javascript Issue

    Posted: 02 Dec 2021 04:21 PM PST

    Hi all, I am trying to fix a website that displays professors. Ive gotten almost everything to work but I cant seem to make the select professor/course work from the dropdown menu's. I am not well aquanted with Javascript and was wondering if someone would be willing to take a look at the sites code? It is mostly php files. I dont think I can add the files here but if anyone wants them DM me and I can send them! I am doing this to help everyone in my university since the original website was shutdown it seems.

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

    Looking for feedback/advice on my career entry plan

    Posted: 02 Dec 2021 12:33 PM PST

    Hey everyone, I'm sure you get these kinds of posts all the time so I'll try to keep it as concise as I can.

    I want to land a job as a software engineer as quickly as possible, and I have very minimal experience with Python so far. After much Googling and browsing job posting requirements, here is what I've decided to learn before I start applying:

    To start, I've enrolled in the Google IT Automation with Python Professional Certificate program through Coursera.org as well as CS50's Introduction to Computer Science through Harvard. I'll be paying for the certificates for both.

    After those are completed, I'll continue studying Python while diving into C (I haven't found a certificate course for this just yet). While learning C, I'll also be studying:

    • Django
    • AWS Cloud Computing
    • SQL
    • Git
    • .Net
    • REST
    • Docker
    • HTML5 (familiarizing myself with this one instead of learning it front to back).

    Throughout all of these studies, I'll be coming up with small ideas for programming projects to load into a basic website for a portfolio that I'll attach to my CV.

    I know this is probably a lot to learn, but I can study full time so I'm hoping to make short work of it. Will this be enough to land an entry level job as a software engineer without an AA or BS? Is anything I've listed extraneous to my immediate goal, or am I missing anything I should add?

    Any advice would be much appreciated, thanks!

    submitted by /u/Gloomy-Alternative97
    [link] [comments]

    User-created script that prevents other users from connecting to game server

    Posted: 02 Dec 2021 04:17 PM PST

    Hi,

    Apologies in advance that this is very vague. I am not extremely familiar with this, but I was wondering if anyone could give me any advice.

    I sometimes play a small browser-based video game which someone created as a university project. It has a sister game (also a university project) which is a little more advanced. This sister game allows users to create personal lobbies ("parks") which they can then design. One of the ways that they can do this is through a small area where they can enter some sort of code (not sure which language), which can control what happens to other users when they enter the park (where they land, can kill them, etc).

    Recently this ability to script has become something of a problem, because someone found a way to use this to "ban" the accounts of other users from entering any parks/anywhere at all in the game, apparently indefinitely. I say "ban," but it appears to be preventing other users from connecting to the server (they see a "Could not Connect!" error message) rather than an official ban like the admins of the game could place.

    The developer of this game has not made any updates for about two years and is apparently for all intents and purposes gone. This game is still in beta and no new accounts can be created (I personally do not have an account). About 95% of the game's users are unable to play it at this point.

    I guess what I was wondering is: does anyone know what a user could enter into this console to prevent everyone that enters their park from connecting to the server? And, if so, is there a way to undo it/would you have any suggestions as to how we could undo it? The average age of the playerbase is about 14. I'm not sure how sophisticated it would be.

    The game in question is Coaster Town.

    I know that this is horribly vague, I'm very sorry. Absolutely any suggestions would be really appreciated.

    TLDR: Someone on a browser-based video game created a script that indefinitely prevents other users from connecting to the game's server. The dev is AWOL. Does anyone know what this might be and if it can be fixed without actually having owner's access to the game?

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

    what are the topics that should be covered for teaching noobs

    Posted: 02 Dec 2021 03:55 PM PST

    i plan to make material for noobs with no experience in programming, the main goal is to make them comfortable with the basics so they are qualified to tackle other learning on their own. there should be also a simple project at the end. i want you to help with the topics needed to be covered. i am thinking about using are javascript or python. give me your feedback

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

    Diagnosing Segment Fault of pthread mutex

    Posted: 02 Dec 2021 11:48 AM PST

    I have a system which segfaulted on an acquire of a custom thread mutex object. (this custom thread mutex is a wrapper so it can run on multiple operating systems, in this case though, it is executing linux).

    Unfortunately I have struggled to recreate this seg fault on the system. It is a linux based system and I know the segment fault occurred somewhere within the 'acq' method. Based on my crash file (core dump), I did not have symbols loaded into my build, but I am able to see the backtrace of the crash, and I was able to see the last method called was the **'acq'** method.

    Here is some simplified code of that thread mutex implementation. I don't think the embedded linux system was running out of memory (as we have profiled the system before and we barely ever get above 10% capacity, mostly even less). Usually when I see a segment fault I think pointers or bad array access, but a lot of this code seems to be safe with pointers and simple just call pthread methods.

    I'm not overly familiar with pthreads, but is there anywhere in this implementation where you'd see a potential for a segment fault? I realize this could be like looking for a needle in a haystack, but I am trying to exercise every option.

    struct mutexData {

    pthread_mutex_t m_mutex;

    }

    ThreadMutex::ThreadMutex(){

    m_data = nullptr;

    }

    // last function call before segment fault?

    void ThreadMutex::acq(void)

    {

    if (m_data == nullptr) {

    // create mutex

    m_data = new mutexData;

    pthread_mutexattr_t mattr;

    pthread_mutexattr_init(&mattr);

    pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE_NP);

    pthread_mutex_init(&m_data->m_mutex, &mattr);

    }

    switch (pthread_mutex_lock (&m_data->m_mutex))

    {

    case 0:

    break

    case EINVAL:

    throw exception;

    default:

    throw exception;

    }

    return true;

    }

    My goal is to try to reproduce this error again on the system (it seems to happen very sparingly) to understand why and fix the issue.

    Thanks for any help!

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

    Everyone writes code in a separate editor before posting it to Reddit?

    Posted: 02 Dec 2021 03:14 PM PST

    It seems that the only way to format code is placing four leading spaces at each line. Manually doing so is very inconvenient. The way I do it is copying the code to a temporary editor like VS Code, selecting all, pressing tab to indent, then copying all and pasting it to the Reddit's "text" field.

    This is annoying. Is everyone doing the same way? There is no way to format code other than leading spaces, right? I mean, I have tried things like "````" but it did not work.

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

    Problem sending formData (Javascript) to server (Java)

    Posted: 02 Dec 2021 03:05 PM PST

    wanted to write a javascript function that records the screen of the user and saves it onto a server.

    It seems to work so far and records the user-selected screen (i printed most variables into the console for testing purpose but here deleted it for clarity, the ids etc are filled), but there is a problem when i am trying to upload it.

    Since i am new to JavaScript programming, i seem to be stuck now, i tried to change mimeTypes/types in ajax since i am not sure if they are used right, did not help.

    I run the JavaScript frontend on a local XAMPP and the Java backend on a local WildFly.

    Would be so glad if anyone got helping ideas.

    The code i wrote is integrated into a existing project, i will post the snippets i wrote.

    Here is the code on pastebin for easier reading:

    https://pastebin.com/aWhSe5qx

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

    Administration and finances software PLEASE HELP!!

    Posted: 02 Dec 2021 09:26 AM PST

    Hello! Im interested in learning programming to develope a project management/finances software, the idea is to be able to use it everywhere (desktop app, webapp and mobile) it needs features like automations, related databases, complex formulas, timelines, filters, restrain acces to users, etc. I could say it would be a combination between Notion, Monday and Quickbooks. It would need integrations with gmail, drive, etc.

    The thing is the more research I do the more confusing it gets, so far I believe Python, Java and Javascript could do the work but I don't know if platforms like wordpress and figma (where I started) are still usefull. So,

    1. Is wordpress and figma usefull for this case?
    2. Is JS, Java and phyton the way to go? or,
    3. What programming languages should I use to develope this tool?
    4. Is Html and CSS a must for this?
    5. What learning platforms do you recommend?
    6. Thank you very much!!!
    submitted by /u/reguer
    [link] [comments]

    I'm watching a thing on using Burp Suite and is this correct ?

    Posted: 02 Dec 2021 11:45 AM PST

    They were trying to intercept data between two machines (I'm guessing between the host computer and the web server enjoy google or whatever). He first goes into Firefox and sets a manual proxy of 127.0.0.1 (or something) with port 8080, but doesn't say why. Then in Burp Suite he goes to the proxy tab and puts the same 127.0.0.1 with port 8080 in the options. But how does this show a practical situation? Nobody is going to just set a manual proxy ip# and just tell people, and even then, why doesn't he ⠀just use the ip# that he was on originally instead of making a manual one? If anyone is interested it's here, I time stamped it too... https://youtu.be/2_lswM1S264?t=122 ​ **Also as an aside, I believe the reason he is on a Virtual Machine is because it wouldn't be intercepting if it's not from a different "machine", is that right? ​ Thank you!

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

    Sending a request to a rest API through json or dt?

    Posted: 02 Dec 2021 11:24 AM PST

    My google-fu is failing me at the moment so pardon the stupid question.

    I'm trying to build an API (and learning C# at the same time which isn't helping to be honest...) as well as a client to interact with said API.

    I'm used to vb/Soap type projects where you can basically go ResultsDt = soaprefference.GetBlah(RequestDt)

    and then either watch the thing do its thing or watch it implode because there's too much data going in/coming back.

    since a rest api is uri based I am not entirely sure if/how I would be able to do something similar.

    The premise is this;

    I have a filetable in SQL on the server. This filetable is updated nightly with images for products based on new pictures being added, old pictures being removed or updated. As well as products being "turned off"

    The client machines also have that same filetable.

    Our current application which was made before I switched us to filetables basically goes through each file one by one and checks if it exists, if it's size is different, if the date is different etc... for 75000 to 200000 files during a given time period.

    The approach I want to take is this;

    Client requests a list of all files from the file table, this is a "dumbed down" list that has the stream ID, file name, cached file size, write time and a few other piece of info but no blob.

    So far pretty simple. The client then writes this to a temp table and does a comparison of the local file table with the results and whatever is not there/different then needs to go back to the API as another request, this time with blob.

    The part I'm iffy on and I can't seem to find anything on how, is... Am i going to have to make hundreds or thousands of uri requests or can I send some sort of object or a json that contains a list of either all the ID's I want or small batches of them (files are all roughly 20kb or less)

    The API is only intended to be accessible via this application(which is another thing I need to figure out, how to make it inaccessible via web browsers when not in debug mode but one thing at a time.) which has no user interference so beyond my code going wonky somehow I'm not worried about something external sending the wrong type of request.

    In all honesty I should just fucking modify the old program to work like this but I'm trying to learn new things on the boss' dime. :P (he's obviously all for it but still)

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

    SSH with VPN on: can I be traced?

    Posted: 02 Dec 2021 10:29 AM PST

    Title. My internet uses vpn and I ssh into remote sever.

    Obviously the NSA / FEDs can clap me any moment but I'm talking about like a medium sized company

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

    You can no longer hack google forms to see the answers to questions, right?

    Posted: 02 Dec 2021 02:02 PM PST

    I understand that before you could check the source code of the page, write the question in the search engine and see the answer or inspect the questions and in the script it more or less told you which was the correct answer since only the incorrect ones appeared. I tried to do this with the last form given to me and none of the options worked.

    submitted by /u/Garrett-Wilhelm
    [link] [comments]

    Is there something like flutter or revery for C?

    Posted: 02 Dec 2021 09:55 AM PST

    Hello, I have been spending my time looking at good looking at cross platform non native gui like flutter and revery.

    A sad thing about these libraries is that they do not give me any way of using it in C. Not that i want to use it in C, i just want to be able to use it in Zig

    sorry if i said something wrong in my question

    have a nice day!

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

    Need help with java on eclipse

    Posted: 02 Dec 2021 09:29 AM PST

    I am new to java and I am following a tutorial and going off the code they use. I am trying to change the background of the window I have made. The code im using is this.setBackground and when I try to than enter Color.black it will not work and keeps giving me an error I have no idea what the issue is I have checked and rechecked the code if you have any idea can you please help thank you!

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

    Excluding video games, what types of software or users would be most affected if CPUs moved away from the x86 architecture?

    Posted: 02 Dec 2021 09:13 AM PST

    Let's ignore developers of software that needs to be ported because obviously they need to do work to port their programs to a new architecture.

    Much of regularly used software such as Microsoft Office, Adobe programs, CAD programs, compilers/IDEs etc. are regularly updated and people generally use the latest versions of these programs, at least when installing on a new computer, and the software developers would port them over to the new architecture. We see this with the new M1 Apple Macintosh computers. Open source software would be easy to port since the source code is available.

    Old computer games are the only programs in common use I can think of that specifically will not have a ported over version. What other software commonly used by home users or businesses would likely not be ported over?

    For example, someone who uses Microsoft Word 2007 can still use the latest Word on a different architecture but LucasArts will not be making an official port of Star Wars: X-Wing vs. TIE Fighter.

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

    Is making a password manager hard AF?

    Posted: 02 Dec 2021 05:13 AM PST

    I have made full-stack crud apps before. and by hard I mean does it require years of expertise in cyber security or not? thanks.

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

    Changing text based on day of the year

    Posted: 02 Dec 2021 08:23 AM PST

    Hi all,

    As part of a Christmas gift, I'm looking to create a webpage that will display a different message on each day of the year. The code I have written for this is as follows:

    <body>
    <p id="message"></p>
    <script>
    var today = new Date();
    let text;
    if (today = Date("Dec 02 2021")) {
    text = "This is the first message";
    } else if (today = Date("Dec 03 2021")) {
    text = "This is the second message";
    } else if (today = Date("Dec 04 2021")) {
    text = "This is the third message";
    } else {
    text = "Error";
    }
    document.getElementById("message").innerHTML = text;
    </script>
    </body>

    Using this code, the webpage displayed "This is the first message". At first this seemed like a success, but then when I tried changing the date for that message, the webpage still displayed "This is the first message".

    Could anyone tell me what is wrong with my code and how I could fix it? I am brand new to coding, so I'm sure it's full of errors.

    Thank you!

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

    No comments:

    Post a Comment