How to get into GUI programming? Ask Programming |
- How to get into GUI programming?
- [REST API] What should I return to the client if there is a 500 error?
- Can you open a URL based on user input?
- What are the Algorithms problems that haven't been solved yet?
- I'm trying to compile and run a working C++ program on Ubuntu and I have no idea what's happening.
- Simple script for website logging
- AI/ML
- List of Graph Theory Algorithms?
- Explain functioning in web architecture?
- (React Redux) Is this a possible spelling error on Tutorial Point?
- String array comparison problem
- Reprogramming a console, hard level.
- Requesting help with SQL. Variation on what a full outer join does
- Variable Explorer for Cling?
- Reader not reading Intagers as strings.
- Sorting methods
- Creating a check-in signaling system that would write data
- Is there a bigger expectation for software students today when making the final year project much harder today as opposed to 20 years ago with the internet resource at our disposal?
- Android: Split text to a new line whenever a comma appears
- Where to begin for my project?
- r Programming- Monopoly Code
- What do you do when you draw a blank, and everything seems too hard, and not worth the effort, and you are just sick of all the bs?
How to get into GUI programming? Posted: 17 Feb 2020 02:33 PM PST I had my first semester in computer science. Programming classes were about CLI programming (Competitive coding, basic data structures, some algorithms, etc). I tried to get into GUI programming, but honestly, i have no idea where to start, because everything seems weird. I think being able to create simple programs that detect mouse movement and basic interations, like clicks by the user, or keyboard detections and displays on screen is a simple, yet efective way to start. I use python3, by the way Any tips on where to start? Thanks in advance [link] [comments] |
[REST API] What should I return to the client if there is a 500 error? Posted: 17 Feb 2020 03:55 PM PST I've been building the error handling part of the API and I'm not sure what the response should be when there are 500 code errors. I know that there are security implications by responding with the error name and message, since there is danger of exposing implementation details that might provide hackers important information. My plan so far is just to respond with a 500 message saying "Something went wrong. Please contact support", and then save an error log in the server. However, I think this is not useful at all for the API consumers. So I'm curious about what would be a better way to handle this kind of errors. [link] [comments] |
Can you open a URL based on user input? Posted: 17 Feb 2020 09:31 PM PST Hi, I'd like to be able to open a webpage based on a URL+"user input". The first part of the URL is known, for example "https://docfind.myworkplace.com/something/?dN=" the user input is a document number after the "=". I currently have the URL bookmarked, open it (Chrome) to a "failed to load page" then add the document number to the end. I'd like to hit a link or run a script to ask for 1 or multiple numbers - it would save a lot of time when searching for docs. Is this possible use Chrome or IE? [link] [comments] |
What are the Algorithms problems that haven't been solved yet? Posted: 17 Feb 2020 08:45 PM PST |
I'm trying to compile and run a working C++ program on Ubuntu and I have no idea what's happening. Posted: 17 Feb 2020 07:18 PM PST I'm working on an assignment for a class. I have the file working on my windows machine in CLion no problem. For this class however, I need to have it compile/run on a Linux box which I'm connecting to over PuTTY.
Here's what happens when I try and compile/run it.
Here are the files:
Any ideas? I'm considering a priest. [link] [comments] |
Simple script for website logging Posted: 17 Feb 2020 07:01 PM PST Hi, I used to do programming years ago (C, Perl, SQL), and can write simple stuff with google search. However, I've never done web programming and would like some guideline or better yet a script template itself. So I have a website for which I need a script that will login and go to a page. I downloaded AutoHotKey and got a script (below) - web_browser := ComObjCreate("InternetExplorer.Application") web_browser.Visible := true web_browser.Navigate("") while web_browser.busy sleep 1000 username_input := web_browser.document.getElementById("email") username_input.value := My_User_Name password_input := web_browser.document.getElementById("pass") password_input.value := My_Pass_Word web_browser.document.getElementById("u_0_n").click() return But the script does not work because my website login is not on the page itself. There is a "My Account" link which opens a popup widget where I've to enter my credentials. My ultimate goal is to open 3 instances of this website (3 different credentials) in Chrome by using "Multi Session Box" extension (or any other trick that lets me open same website with different sessions side-by-side). But lets keep that aside for a while, even if I'm able to automate 1 session, thats okay too. [link] [comments] |
Posted: 17 Feb 2020 12:32 PM PST Hi everyone, i am a cs student currently in my second year, but i am trying to find ideas for my final project (capstone), i am very fascinated by artificial intelligence. I am thinking of building a smart conversational interface ( something like Alexa and siri) but really i dont know where to start. I am used to work with C and java. Is there any projects i can start working on and what are the languages and the tools i need to learn and use. Thanks [link] [comments] |
List of Graph Theory Algorithms? Posted: 17 Feb 2020 05:23 PM PST Algorithms tend to have names that I would never guess. This makes it hard for me to find the right algorithm that I need. It might be easier if I was given a list of algorithms and I manually look through them to pick one which best solves my problem. If anyone could identify an algorithm that could help, that would be great too! My problem is related to graph theory. I have a list of university classes. Classes have prerequisites, for example before you can take this class you need to take X other classes from {subarray of classes}. The prerequisites form a directed cyclic graph. For a given class, what is the minimum number of other classes that need to be taken such that the prerequisites of all taken classes are met? [link] [comments] |
Explain functioning in web architecture? Posted: 17 Feb 2020 04:31 PM PST |
(React Redux) Is this a possible spelling error on Tutorial Point? Posted: 17 Feb 2020 04:01 PM PST Hello, I am using Tutorial Point to understand about Redux (Link: https://www.tutorialspoint.com/redux/redux_react_example.htm ) In the sample code '/src/app.js' provided in the link above, following line i provided below seems inaccurate to me or maybe i am not just understanding the flow. Instead of importing from 'appContainer', shouldn't it be 'counterContainer' which is provided also provided in the link above? Otherwise, i am not sure how exactly it's importing 'Counter' in app.js Thank you [link] [comments] |
String array comparison problem Posted: 17 Feb 2020 03:52 PM PST I'm trying to compare the contents of a string array with another string. In the code below, I am checking whether the contents are "int" or something else. The issue I'm having is that there is no output. If the string array was [int, a, =, b, *, c], the output should be "keyword: int". However, I'm getting no output with the current if statement. [link] [comments] |
Reprogramming a console, hard level. Posted: 17 Feb 2020 02:07 PM PST Hey I just had question and wasn't sure it is even possible. I guess I'm just curious is that, is there a way in theory to recreate a Nintendo 64 console, and allow for when someone puts in the cart to add different shaders and stuff, like emulator but on hard level. Not a clone console, but more so a console that reads the data of the cart, and in the hardware, manipulates that data and adds layers of shaders and mods, like emulators do. I know most clone consoles just check your game and add a rom then emulate it. I'm more looking for a way to do what emulators do. However with no emulation. if that makes sense. I'm more here for knowledge, and just curious if it can be done. I think the Nintendo 64 is good example since today it really does not hold up graphically. [link] [comments] |
Requesting help with SQL. Variation on what a full outer join does Posted: 17 Feb 2020 01:16 PM PST I'd like the following result: [link] [comments] |
Posted: 17 Feb 2020 12:33 PM PST Is there a variable explorer for Cling, like in Matlab or %whos for ipython? [link] [comments] |
Reader not reading Intagers as strings. Posted: 17 Feb 2020 12:07 PM PST I have txt file that is converting each letter of the Bee Movie to a specified number, (First part of the code (Red Scanner)) For the next part of the code I would like the code to take each number and turn it into its respective abriviation of an element from the periodic table. The code, as far as I can is not reading the numbers as numbers (Like 1 or 34) to convert them and i have no idea why. Any help would be great. Thanks :) **Code** package thebeemovie; import java.util.Random; import java.util.Scanner; import java.io.*; public class TheBeemovie { public static void main(String[] args)throws IOException { Scanner Red = new Scanner(new File("D:\\BeeMovie.txt")); PrintWriter Adventure = new PrintWriter(new File("D:\\UBetterHeckinWork.txt")); int number = 0; while (Red.hasNext()){ String letter; letter = Red.nextLine(); int i = 0; while(i < letter.length()){ char e = (letter.charAt(i)); i++; switch(e){ case 'a': Adventure.print("1 "); break; case 'b': Adventure.print("2 "); break; case 'c': Adventure.print("3 "); break; case 'd': Adventure.print("4 "); break; case 'e': Adventure.print("5 " ); break; case 'f': Adventure.print("6 "); break; case 'g': Adventure.print("7 "); break; case 'h': Adventure.print("8 "); break; case 'i': Adventure.print("9 " ); break; case 'j': Adventure.print("10 "); break; case 'k': Adventure.print("11 "); break; case 'l': Adventure.print("12 "); break; case 'm': Adventure.print("13 "); break; case 'n': Adventure.print("14 "); break; case 'o': Adventure.print("15 "); break; case 'p': Adventure.print("16 "); break; case 'q': Adventure.print("17 "); break; case 'r': Adventure.print("18 "); break; case 's': Adventure.print("19 "); break; case 't': Adventure.print("20 "); break; case 'u': Adventure.print("21 "); break; case 'v': Adventure.print("22 "); break; case 'w': Adventure.print("23 "); break; case 'x': Adventure.print("24 "); break; case 'y': Adventure.print("25 "); break; case 'z': Adventure.print("26 "); break; case 'A': Adventure.print("27 "); break; case 'B': Adventure.print("28 "); break; case 'C': Adventure.print("29 "); break; case 'D': Adventure.print("30 "); break; case 'E': Adventure.print("31 "); break; case 'F': Adventure.print("32 "); break; case 'G': Adventure.print("33 "); break; case 'H': Adventure.print("34 "); break; case 'I': Adventure.print("35 "); break; case 'J': Adventure.print("36 "); break; case 'K': Adventure.print("37 "); break; case 'L': Adventure.print("38 "); break; case 'M': Adventure.print("39 "); break; case 'N': Adventure.print("40 "); break; case 'O': Adventure.print("41 "); break; case 'P': Adventure.print("42 " ); break; case 'Q': Adventure.print("43 "); break; case 'R': Adventure.print("44 "); break; case 'S': Adventure.print("45 "); break; case 'T': Adventure.print("46 "); break; case 'U': Adventure.print("47 "); break; case 'V': Adventure.print("48 "); break; case 'W': Adventure.print("49 "); break; case 'X': Adventure.print("50 "); break; case 'Y': Adventure.print("51 " ); break; case 'Z': Adventure.print("52 "); break; case ' ': Adventure.print("53 "); break; default: Adventure.print("54 "); break; } } } System.out.println("Working"); Scanner Blue = new Scanner(new File("D:\\UBetterHeckinWork.txt")); PrintWriter tp = new PrintWriter(new File("D:\\AnotherOneBitesTheJava.txt")); String number1; String number2; //number1 = Blue.next(); //number2 = Blue.next(); while(Blue.hasNext()){ String NotLetter = Blue.nextLine(); String[] numberString = NotLetter.split("\\s+"); System.out.println("Workinging"); for(int j = 0;j < numberString.length;j++){ int numbers[] = {j}; //dclaring array numbers = new int[j]; for( j=0; j<numbers.length; j++) for(j=1; j<numbers.length; j++) numbers[j] = Integer.parseInt(numberString[j]); /** switch(j){ case 0: NotLetter = number1; break; case 1: NotLetter = number2; break; } **/ // while(Blue.hasNext()){ // String nice; // nice = Blue.nextLine(); // int i = 0; //while(i < nice.length()){ // nice = (tp.substring(i)); // i++; switch(NotLetter.substring(j)){ case "1": tp.print("H "); break; case "2":tp.print("He "); break; case "3":tp.print("Li " ); break; case "4":tp.print("Be "); break; case "5":tp.print("B "); break; case "6":tp.print("C "); break; case "7":tp.print("N "); break; case "8": tp.print("O "); break; case "9":tp.print("F "); break; case "10":tp.print("Ne "); break; case "11":tp.print("Na "); break; case "12":tp.print("Mg "); break; case "13":tp.print("Al "); break; case "14":tp.print("Si "); break; case "15":tp.print("P "); break; case "16":tp.print("S "); break; case "17":tp.print("Cl "); break; case "18":tp.print("Ar "); break; case "19":tp.print("K "); break; case "20":tp.print("Ca "); break; case "21":tp.print("Sc "); break; case "22":tp.print("Ti "); break; case "23":tp.print("V "); break; case "24":tp.print("Cr "); break; case "25":tp.print("Mn "); break; case "26": tp.print("Fe "); break; case "27":tp.print("Co "); break; case "28":tp.print("Ni "); break; case "29":tp.print("Cu "); break; case "30":tp.print("Zn "); break; case "31":tp.print("Ga "); break; case "32":tp.print("Ge "); break; case "33": tp.print("As"); break; case "34":tp.print("Se"); break; case "35":tp.print("Br"); break; case "36":tp.print("Kr"); break; case "37":tp.print("Rb"); break; case "38":tp.print("Sr"); break; case "39":tp.print("Y"); break; case "40":tp.print("Zr"); break; case "41":tp.print("Nb"); break; case "42":tp.print("Mo"); break; case "43":tp.print("Tc"); break; case "44":tp.print("Ru"); break; case "45":tp.print("Rh"); break; case "46":tp.print("Pd"); break; case "47":tp.print("Ag"); break; case "48":tp.print("Cd"); break; case "49":tp.print("In"); break; case "50":tp.print("Sn"); break; case "51":tp.print("Sb"); break; case "52":tp.print("Te"); break; case "53":tp.print("53"); case " ":tp.print(" "); case "54":tp.print("Xe"); break; default:tp.print("PleaseWorkOnTheProject:)"); } } } System.out.println("The operation is compleation. "); tp.close(); Adventure.close(); }} [link] [comments] |
Posted: 17 Feb 2020 11:26 AM PST I have 2 unknown sorting algorithms, sort1 and sort2. I know that one is mergesort and one is heapsort. I have made a plot of the running time for various sizes of arrays (ordered array, reverse ordered and random) and I cant tell the difference. But I know that mergesort it stable and that heapsort isn't. How do I figure out which method is unstable? [link] [comments] |
Creating a check-in signaling system that would write data Posted: 17 Feb 2020 09:49 AM PST I understand that this is a very general question, but I'm not sure what to look for research, nor how to start. English is not my native language, so bear with me.
I have a device A. I want to set up another signaling device S that activates whenever electric current passes through it. I can set up cable management for device S, but my question is, what type of device should I use? I need something cheap because the only purpose for device S would be to send a signal whenever it receives power and then send a signal right before it has no longer power. So, two signals: One when it's activated and another one when it's deactivated. That's it. But, the ability to send that signal should be wireless. So, device S activates when electricity passes through it and then sends a signal to device A via wireless. The distance between these devices is 10 meters at max. After that, I need device A to send parameters boolean (true whenever the device is activated and then false when it's deactivated or something like that) and the timestamp to a PC, again via wireless, which is another 10 meters away from device A. Note that the timestamp is not actually mandatory. I can set it up via the PC. Device A would be the controlling device that would send info to the PC. The possibility of multiple devices S should be considered. Meaning that in the future there may be more than one and they should have an ID and other stuff to sent back to. I've made a scheme so you get the idea. So, what devices should I look for A and S? I think I'll figure out the programming part for those devices on my own, but I need them to be compatible and stuff. [link] [comments] |
Posted: 17 Feb 2020 03:18 AM PST |
Android: Split text to a new line whenever a comma appears Posted: 17 Feb 2020 08:33 AM PST I've an edittext that is populated with a string based on a previous selection. Is there a way to fill the edittext but whenever a comma appears but the next piece on text onto the next line [link] [comments] |
Where to begin for my project? Posted: 17 Feb 2020 08:21 AM PST hello reddit. I have little knowledge of how to code. i took a couple of classes in college but its been a few years. i am trying to make an app that can record elevation/height traveled and turn it into a score. where should i start? how can i make something like this? and recommendations would be very appreciated. just looking to be pointed in the right direction. [link] [comments] |
Posted: 17 Feb 2020 11:51 AM PST Hi, I am trying to running this on R Version 3.6.2 Output of rolling_double is not coming as expected. Can you please see and suggest changes Thanks in advance! Monopoly Board game simulationYou will create a simulation of the classic board game, Monopoly. The goal is to find out which spaces on the board get landed on the most. You will not simulate the entire game. You will simulate only the movement of pieces, and will keep track of which squares the pieces land on. If you have never played Monopoly before, I recommend watching a few videos on the topic. https://www.youtube.com/watch?v=4Hfe97Q5kuI You can also familiarize yourself with the game board. (Taken from Amazon's product page.) http://ecx.images-amazon.com/images/I/81oC5pYhh2L._SL1500_.jpg Official rules http://www.hasbro.com/common/instruct/00009.pdf Rules for movement The Monopoly Board is effectively a circle with 40 spaces on which a player can land. Players move from space to space around the board in a circle (square). The number of spaces a player moves is determined by the roll of 2 dice. Most often, the player will roll the dice, land on a space, and end his turn there. If this were the entire game, the spaces would have a uniform distribution after many turns. There are, however, several exceptions which provide the primary source of variation in space landing Go to Jail One space, "Go to Jail" sends players directly to jail (there is a jail space on the board). This space never counts as having been 'landed upon.' As soon as the player 'lands' here, he is immediately sent to jail, and the jail space gets counted as landed upon. This is the only space on the game board that moves a player's piece. The count of how often this space is landed on will always be 0. Rolling Doubles If a player rolls doubles (two of the same number), the player moves his piece, and then gets to roll the dice again for another move. However, if a player rolls doubles three times in a row, he is sent directly to jail. (The third space that the player would have 'landed on' does not count, but the jail space gets counted as landed on.) Card Decks: Chance and Community Chest A player can land on a "Chance" or "Community Chest" space. When a player lands on these spaces, he draws a card from the respective deck and follows its instructions. The instructions will sometimes give money to or take money from the player with no change in the player's position on the board. Other times, the card will instruct the player to move to another space on the board. The list of cards that can be drawn from each deck is provided below. There are nine cards in the Chance deck that move the player's token. There are two cards in the Community Chest deck that move the player's token. All other cards do not move the player's token. For the sake of this simulation, you only need to program actions for the cards that move the tokens. There is no need to do anything for 'get out of jail' or any of the other cards. A card may say 'move to the nearest railroad' or 'move to the nearest utility' or even 'go to property xxx'. In these cases, the player always moves forward. So if a player is on 'Oriental Avenue,' the nearest railroad is 'Pennsylvania Railroad' and NOT 'Reading Railroad.' The Chance and Community Chest get counted as landed on when the player lands on the Chance or Community Chest space. The player may also generate another count if the card moves the player to another space on the board. In those cases, a tally is counted for the Chance/Community Chest space, the token is moved, and then a tally is counted for the space where the player ends his turn. Jail Jail is the most complicated aspect of this simulation. If a player lands on space 11 (Jail), he is not in Jail. He is 'just visiting' jail. He generates a tally for landing on jail, and his play continues on as normal. A player can be sent to jail in several ways: he rolls doubles three times in a row; he lands on the "go to jail" space; he draws a card that sends hims to jail. As soon as the player is sent to jail, his token moves to jail (space 11), he generates a count for landing on jail, and his turn ends immediately. On the next turn, the player begins in jail and the player will roll the dice. If he rolls doubles on the dice, he gets out of jail and moves the number of spaces the dice show. However, even though he rolled doubles, he does NOT roll again. He takes his move out of jail and his turn ends. If he does not roll doubles, he stays in jail. A player cannot stay in jail for more than three turns. On the third turn he begins in jail, he rolls the dice and moves the number of spaces the dice show no matter what. Play then continues as normal. For this simulation, each time a player ends his turn in Jail, a tally will be counted as having been 'landed upon.' There are more rules on jail that include paying a fee to get out early, or using a get out of jail free card. We will not implement those rules. We will simply simulate a 'long stay' strategy for Jail. This means that the player will never pay the fee to get out jail early. He will roll the dice and only leave jail if he gets doubles or it is his third turn in jail. The Assignment Your assignment is to implement the rules of Monopoly movement. Part 1 You will first demonstrate that you have codes the rules by showing the output of the first 20 turns using the preset dice. Your output for this section should match the published results almost exactly. Turns 1-17 should be exactly the same. On turn 18, you might draw a different random chance card from me. This is allowed. The output should be very verbose. It should announce the player roles, where the player moves, what spaces get tallies, if they rolled doubles, etc. Try to match my published output as much as possible. Part 2 The next part is to run 1,000 simulations of a two-player game that lasts 150 turns. This is a total of over 3 hundred thousand tosses of the dice - 1000 games x 150 turns x 2 players + additional rolls if the player gets doubles. Your task is to keep track of where the players land. We ultimately want to build a distribution showing which spaces are most likely to be landed upon. Advance the tokens around the board according to the rules. Keep in mind the special situations involving the cards, jail, and rolling doubles. After 150 turns, reset the game and start over. Simulate 1000 games. Your final output will be two tables of the spaces on the board and their frequencies. Each table will show the space name, how many times the space was landed upon, and the relative frequency of landing on that space. The first table is arranged in descending order of frequency of landing. (Jail should be #1, Go to jail should be last.) The second table is arrange in the order of the spaces on the board. (Go will be #1, Boardwalk will be last.) You do not have to simulate or track money at all in this simulation. For your convenience, I have created the necessary data frames for the game board, and the two decks of cards. You can 'hard code' the functions that handle the decks. In other words, you can write something along the lines of Tips At first blush, the task may seem overwhelming.
steps
That is 60 points. Turn 19 and 20 are not graded.
Things we are looking for in the results tables (5 points each):
We will check for the following sections. Because your code will be quite long, it is VERY IMPORTANT you CLEARLY mark these sections for the grader if you want to recover points. a. drawing chance card b. drawing community chest card c. landing on "go to jail" d. roll again for rolling doubles e. going to jail for rolling three doubles f. jail functionality [link] [comments] |
Posted: 17 Feb 2020 06:22 AM PST Like, today, I was writing my Electron app, and it was supposed to be a nice relaxed day where I write something I already made a proof of concept of. And then shit started hitting the fan. "this sucks, I gotta put it in a nice function".. .."why tf am I writing this shitty function that I can't follow and only use in one place, I'll just go back to the basics and write it line by line". ..." why tf am I writing it line by line, this doesn't work without a function"... and so in a circle. I was so annoyed, thought about dropping the whole thing because I have been writing this shit on and off for 2 months, and all I have to show for it is the spongebob empty paper meme with just "The" written - 300 lines, and 4 abandoned versions of the project. So I said fuck it, and went for a bike ride to let off some steam. And then I came home, and it hit me that the best and most logical solution would be to make a good ol' modular agnostic function with 10 parameters that I can use in the two places I need, and I can adjust the parameter values outside if they aren't in a good format. And then in the shower, I wrote the whole thing in my head, and then I wrote it down, and outside of a few classics like missing "document." or a comma or a parantheses, it worked immediately, and perfectly. So yea. This shit is too stressful sometimes. I can't imagine how it can be when there is actual money on the line, and not just jerking off code for fun and edification. [link] [comments] |
You are subscribed to email updates from AskProgramming. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment