• Breaking News

    Monday, January 4, 2021

    Developer's survey for thesis Ask Programming

    Developer's survey for thesis Ask Programming


    Developer's survey for thesis

    Posted: 04 Jan 2021 03:13 PM PST

    Hey everyone, I'm helping my friend with her thesis, and we need your support. We have to collect data about developers and associate it with Github history. You only need to have a Github account and complete a quick survey. We will be grateful for your support.

    https://agh-profilingproject.herokuapp.com/

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

    Can .exe files have their source code leaked and how to protect against it

    Posted: 04 Jan 2021 05:09 PM PST

    I finished my first ever project today and it's a just a silly python program, I was wondering if anyone can somehow decompile the .exe file and steal the source code and if yes, how can I protect the program from having its code stolen?

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

    How do you stay focused when your program takes 20s to a few minutes to run/compile?

    Posted: 04 Jan 2021 10:34 AM PST

    Maybe I just need to hide my phone and stop using the internet while working...

    But basically I have an extremely hard time waiting for my program to run, especially for these short/medium run times. Heck long run times can work better because I know to be at my computer 20 minutes later.

    Fidgit toys like silly putty didn't help. 20 seconds is too short to mediate.

    Ideas to keep my mind in the Programming mindset?

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

    How can I combine programming with graphics?

    Posted: 04 Jan 2021 02:49 AM PST

    Hello everyone!

    I'll try to keep it short, I'm a graphic design student and I enjoy doing everything from web design to animations and 3D graphics.

    I've started learning front end web development so I can visualize my web designs and I know people also write shaders and extensions with python for Blender.

    Apart from the above how could I combine programming with graphics?

    Thank you in advance and don't hesitate to ask for more details if you want!

    Edit: Thank you everyone for your suggestions! I will look into all of them and probably set on one or some of them!

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

    Discord program idea

    Posted: 04 Jan 2021 04:12 PM PST

    I wanted to dabble with programming (I'm sure it's way over my head but lets try).

    On discord, my friend's server has a gambling bot (just for fun) and I wanted to write a program or learn how to write a program (can pay for someone to teach me) on how to respond to the bot during a simple coinflip game where I have to bet a percentage of my chips. I wanted to show my friend that the game is very easily beaten as there's a method I use manually to win at the coinflip game. For an example. You type +coinflip (heads/tails) (X amount, I usually bet 5% of my chips first). Than if I win, I bet the opposite coin. However, (this is where it gets fun) if I lose, I always double my original bet and add 1-4% and keep doing so until the side I've been betting appears (it never exceeds 6 losses.

    submitted by /u/Nervous-Diver-9374
    [link] [comments]

    [JAVA] remove owner from removed dog? - beginner

    Posted: 04 Jan 2021 01:08 PM PST

    Hi, I'm stuck with trying to remove owner from the removed dog. I've added:

    Owner owner = findOwnerMethod(ownerName);

    owner.removeDog(dogToRemove);

    and public void removeDog(Dog d).

    I don't even know what to ask... It's not working. I've added Owner owner = findOwnerMethod(ownerName); to get access to owner.removeDog() from the owner class.

    I've added owner.removeDog(dogToRemove); to call method removeDog from owner class.

    public void removeDog(Dog d) to remove the dog.

    Could you point me to the right direction? thx

    Main method:

     public void removeDogMethod() { System.out.println("Command?> remove dog"); System.out.print("Enter the name of the dog?> "); String name = input.nextLine(); String ownerName = null; Dog dogToRemove = null; for (Dog d : dogList) { if (d.getName().equalsIgnoreCase(name)) { dogToRemove = d; System.out.print(name + " is now removed from the register"); } } if (dogList.isEmpty() || findDogMethod(name) == null) { System.out.println("Error: no such dog"); } else { dogList.remove(dogToRemove); Owner owner = findOwnerMethod(ownerName); owner.removeDog(dogToRemove); } } public Dog findDogMethod(String name) { for (Dog d : dogList) { if (d.getName().equalsIgnoreCase(name)) { return d; } else { } } return null; } public Owner findOwnerMethod(String name) { for (Owner o : ownerList) { if (o.getName().equalsIgnoreCase(name)) { return o; } else { } } return null; } 

    Owner method:

     private Dog[] dogsOwned = new Dog[0]; public void removeDog(Dog d) { Dog[] copyOfArr = new Dog[dogsOwned.length - 1]; for (int i = 0; i < dogsOwned.length; i++) { if (!dogsOwned[i].equals(d)) { copyOfArr[i] = dogsOwned[i]; } } } 
    submitted by /u/Csharpgoblin
    [link] [comments]

    Does implementing an interface and extending a class automatically create a thread?

    Posted: 04 Jan 2021 02:54 PM PST

    Hello, I am learning about java and threading (multi-threading).

    I read a sentence that one way to establish this is to just "implementing an interface and extending a class" or use ' java.lang.Thread ' library.

    So does creating an interface (or i guess abstract class) automatically create a new thread? I am having hard time confirming if this is the case from searching/researching.

    Thank you

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

    How come people can play the same game but get different glitches? Shouldn’t everyone experience the same glitches? Thinking of a game that was released recently in particular.

    Posted: 04 Jan 2021 04:47 PM PST

    How can I sort dates using double linked lists?

    Posted: 04 Jan 2021 07:47 PM PST

    I'm working with WINAPI, the program works but I need order dates. I have the list: struct mylist{ string date; mylistprev; mylistnext; }origin,aux; My program can add, modify and delete.

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

    How can I make a compiler for simple C?

    Posted: 04 Jan 2021 08:01 AM PST

    I took a class on compilers an year ago, and learned how to parse. However, I couldn't figure out how to make a C compiler out of it.

    What I can do and cannot do are listed below.

    • I could easily make a recursive descent parser for a simple language. It was easy to make a calculator with that.
    • I am pretty sure that I know how the compiler works. I learned it from the lecture and google!
    • I tried to implement an LR1 parser to parse any simple language, but I couldn't make it as it is too vague.
    • I have my dragon book with me, but it didn't really help to make any kind of compiler(not interpreter, as I could make my calculator).
    • Until now, I failed to make a simple C compiler which was given as an assignment. The assignment suggested to use lex and yacc, but I failed to make a compiler with that. I tried other libraries, but those didn't help me make the compiler.
    • I'm afraid I haven't tried making a simple python interpreter. It looks like I can't make it with my current skills.

    The language I'm using is not that important in this question, but I use (modern) c++, just to let you know.

    Can someone help me learn how to make a compiler?

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

    Why does my mode program print some extra big numbers?

    Posted: 04 Jan 2021 07:16 PM PST

    https://ibb.co/1vc3Hkn

    #include<stdio.h> #include<stdlib.h> #include<string.h> void sort(int arr[]){ int i,j,temp; for(i=0;i<50;i++){ for(j=0;j<50-1-i;j++){ if(arr[j]>arr[j+1]){ temp=arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } } void fprint(FILE* p,int arr[]){ int i; for(i=0;i<50;i++){ fprintf(p,"%3d ",arr[i]); if((i+1)%10==0){ fprintf(p,"\n"); } } } int main(){ FILE* p=fopen("output_2.txt","w+"); int a[50]; int i; srand(time(NULL)); fprintf(p,"Class A original\n"); for(i=0;i<50;i++){ a[i]=rand()%101; fprintf(p,"%3d ",a[i]); if((i+1)%10==0){ fprintf(p,"\n"); } } fprintf(p,"\n"); //--------------sort-------------- sort(a); fprintf(p,"Class A sort\n"); fprint(p,a); fprintf(p,"\n"); int j; //------mode-------- int count,maxcount,tm,mA[50],mB[50]; mA[0]=a[0]; tm=mA[0]; count=maxcount=1; j=0; for(i=1;i<50;i++){ if(a[i]!=tm||i+1==50){ if(count>maxcount){ maxcount=count; mA[0]=a[i-1]; }else if(count==maxcount){ j++; mA[i]=a[i-1]; } count=1; tm=a[i]; }else{ count++; } } fprintf(p,"mode A : "); for(i=0;i<=j;i++){ fprintf(p,"%d ",mA[i]); } fflush(p); fclose(p); } 
    submitted by /u/JacksonSteel
    [link] [comments]

    What are some of the most amazing // impressive things that have been solved with programming?

    Posted: 04 Jan 2021 07:17 AM PST

    Title

    Tried looking up a list but my googling skills are clearly worse than I thought given how little I found

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

    Have you had success programming with “walking desk”?

    Posted: 04 Jan 2021 09:00 AM PST

    I've had back pain that's gotten extremely painful over the last two years, and now I'm getting sick of sitting. I've always been curious about standing desks/walking desks, but I'm worried that I wouldn't be able to focus as well while standing or walking. A walking desk would be more of a commitment due to the fact there is a treadmill under you so you can't go back to sitting. Does anyone use a walking desk daily?

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

    An idea of mine: a net labyrinth. Please help

    Posted: 04 Jan 2021 04:54 PM PST

    I am definitely no hacker or professional programmer. I just had an idea and wanted to share it. I have no idea if this is already something or even if this is in the rules of this sub.

    The idea is this:

    A USB is connected to some thing capable of computation, display, and connection to any net.

    The USB has an "IP" or some unchangeable identification in the hardware.

    The USB has the ability to send and receive encoded data to a certain server.

    The server contains a 3d "labyrinth". The labyrinth is a multilayered map of walls, turns, levers, and ladders. The USB is blind and cannot see the walls or any other feature. All USBs start at the same vector.

    The user can tell the USB to go left, right, etc. There can also be a subfunction to check for a lever or a certain feature.

    When a user runs into a wall occupied with a "bazaar", they are referred to a page most likely a .onion. A bazaar is any referral to any site despite the site's intention.

    When a user has run into a wall that does not contain a bazaar, the USB is terminated from participating in the labyrinth.

    Due to the nature of things, the walls of the "origin" will all be bazaars. Bazaars can be sold and rented along walls. The beginning most likely contains a hub/hidden wiki. The end most likely contains confidential information and "easter eggs".

    Please comment if you have any further ideas and/or can make this or help me make it. I know some code but I'm no developer.

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

    Allow users access to a server for a period of time?

    Posted: 04 Jan 2021 04:39 PM PST

    I want to build a website that allows users to sign in, pay some money and then access a server for a limited amount of time. Think of a 'rent a server' type site.

    The website, user authentication, payment etc can all be done using ASP.NET or django with a payment processor. A database could have a field of 'time_remaining_on_server'.

    How would I allow users access to the server, and then stop that access when their time runs out?

    I was thinking of generating a dynamic url for rdp and then deleting the route after time expires?

    Or maybe this can all be done inside azure, using their identity and authentication stuff?

    Or maybe a link from the users homepage that is only displayed when they have paid coupled with a random generated password for the server???

    Any help with the plan would be welcome!

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

    Would it be profitable to develop a commercial game engine?

    Posted: 04 Jan 2021 06:48 AM PST

    I always wanted to develop a game engine, the idea was to make game develoment easier without putting limitations on the developers, but if I finished the engine and it was working well, would it be profitable if I had proper marketing and funding, how much do you earn from a project like this?

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

    Why do some applications like Google Maps have several different APIs if it’s just one program?

    Posted: 04 Jan 2021 02:02 PM PST

    Would it be possible to create a chrome addon, that extends the buffer capabilities on Youtube and Twitch?

    Posted: 04 Jan 2021 10:00 AM PST

    I am hella annoyed. I have a 1 Gbit connection and I watch a lot of Youtube and Twitch. And with a lot of videos and vods, I rapidly scroll/skip through them.

    While sometimes its working when I dont do it too fast, 90% of the times its absolute shit.

    I dont know how players can be this bad with a gigabit connection that they dont buffer fast enough when I skip through it, and I wondered if it would be possible to create an addon, that would solve that issue?

    Why dont these webistes have an option to let me decide what size of buffer I want? Small disk space? Small buffer. Huge disk space and fast internet, just fucking go for it? Hell, let me buffer an hour it advance.

    Why is this not a thing? Is there anything preventing from that?

    And could there be an addon that would make that possible? And what problems would that have to overcome?

    Im very intersted, please enlighten me!

    Cheers and happy new year

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

    What would I need to do to reverse engineer the source code for a games engine?

    Posted: 04 Jan 2021 12:31 PM PST

    Why is this being downvoted? I'm curious about how to do this. There's an old game I like that's buggy as hell and I want to see if I can fix it, but I don't have the source code.

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

    How do you securely share api keys with end users?

    Posted: 04 Jan 2021 04:58 AM PST

    I'm trying to figure out a good way of sharing (secret) api keys from business to business.

    This is the process used today:

    1. A developer, typically using postman/curl/similar, makes a "create api key for user" call to an admin api using their developer credentials.
    2. The server creates an api key and stores the hash in the db, then sends back the api key
    3. The developer copies the api key into a text file, and the text file is then encrypted (typically by creating a password-protected 7zip archive).
    4. The developer sends the encrypted file to the end user in one way or another. This could be via email, slack, sharing the file through google drive (using the end user's described email), usb drive...
    5. The developer sends the password to the end user using another method, typically through an sms or slack message (effectively, 2FA)
    6. (half the time) The end user sends us an email telling us that they got a "corrupted file" because Windows couldn't recognize the file extension. The developer spends twenty minutes helping the end user.

    This works mostly fine, but there's a few issues that I'm trying to resolve, without having to spend all too much time on the problem.

    Here's some of the problems:

    • Effectively, only developers can create and distribute api keys. This is perfectly fine for now though.
    • The developer can see the end user's api key, so it's not exactly zero trust. This is OK though, a malicious developer could do so much more damage elsewhere.
    • Since there's an entire process to follow, this process must be documented and then learned by new developers, which takes time.
    • The process takes a few minutes of manual work. This is fine for now, but annoys the devs since the end users tends to misplace their api keys, especially in lower environments.
    • There's many way for the process to fail due to human error. The developer could for example...
      • forget to set a password
      • set an overly short password
      • send the password alongside the encrypted file
      • forget to encrypt the data and just send the api key "as is" via slack
      • accidentally miss a character when copy-pasting the api key
      • forget to remove the text file with the api key from their laptop

    I'm thinking of doing this instead:

    1. The developer makes the same call as before, but includes email and phone number for the end-user.
      • The end user could possibly enter this themselves using a private key, but then we need to send that key to them, and then we're back at square zero again...
    2. The server creates the api key (and stores the hash in the db), then does the same thing that the developer used to do: stores the api key in a text file that is then encrypted with a password, then sends the encrypted file via email and then sends the password via sms.

    Does this sound like a good idea? Is there a better way?

    Pros:

    • Almost a fully automated process, with steps that cannot be ignored
    • Much faster for everyone involved
    • The email that is sent could be pre-formatted with helpful information on how to extract the key and how to use the api (by including a link to the api documentation)
    • The API key is never stored anywhere, and the entire process is stateless.

    Cons:

    • More code to manage until the end of time...
    • It's a bit custom - I'm sure there's a standard for this. But sharing secret keys is out-of-band for e.g. OAuth2, and in my years as a software developer I've never seen two companies use the same solution, so there probably isn't a widely used standard out there...
    • ???

    Some alternatives:

    • Let a third party handle this. I don't think there's a third party out there that fulfills the legal requirements set by all of our customers. And having to integrate with a third party is probably more work than doing it ourselves. Also, all of our customers have email and phones, but there probably isn't any other shared third party that everyone could authenticate themselves through.
    • Store the api key encrypted in the auth service (but discard the password), and instead of sending the encrypted file itself, send a single-use link to the email that links back to the auth service. The sms still contains the password. When the end user visits the link they're sent back an html form where they can enter the password, which is then sent to the server to decrypt the api key, then the api key is sent back as part of the html. Essentially, the OAuth2 Authorization Code flow. Though at this point we might as well use a third party auth service (as opposed to reimplementing OAuth2 ourselves), but that's orders of magnitude more work than the original solution (...which is <100 lines of code).
    submitted by /u/Ran4
    [link] [comments]

    does anyone know how i can align a button beside an input type= text ?

    Posted: 04 Jan 2021 07:30 AM PST

    This is the code, I would really appreciate if you could help out

    https://jsfiddle.net/gy78eLsw/

    i want the registrer button to be beside the last label (skole) and input type=text

    submitted by /u/No-Swimmer7468
    [link] [comments]

    Looking for book for programmers

    Posted: 04 Jan 2021 04:47 AM PST

    Hi all, I've been programming for some time now, and I like learning new stuff related to the field. I would like to read some interesting book intended for programmers but isn't about some particular framework or language, and it's usage. I am looking for something more like popular literature.

    Do you have any suggestions?

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

    Is there any alternative to HomeBrew?

    Posted: 04 Jan 2021 06:58 AM PST

    I tried apt-get install nmap (because I want to use nmap) but it said I needed a JDK (Javascript Developer Kit), which I'm not sure why I need something called a JDK to install the nmap function. But so I looked it up and it said I need something called Homebrew. But for whatever reason, Homebrew doesn't work on either of my Mac machines. I've tried 3 times, it never finishes the "Installing Command Lines for XCode" phase. I even went to sleep and woke up.

    Sort of a side question though... why do I need a JDK (And is Homebrew a JDK), that sounds like something that would allow you to write Javascript, but I'm not writing Javascript, I Just wanna install the tool nmap.

    Thanks a lot!

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

    Why do Ransomwares have own extensions?

    Posted: 04 Jan 2021 06:50 AM PST

    Wouldnt it be smarter to do "random" extension on so the victim cant find out which virus encrypted the harddrive? Why do they even have own extensions, isnt the encryption possible without adding an own extension?

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

    What is the difference between a pure function, first class function & first order function?

    Posted: 04 Jan 2021 04:29 AM PST

    No comments:

    Post a Comment