Do you also get into the programming zone? Ask Programming |
- Do you also get into the programming zone?
- Whats the best free programing tool?
- Why use recursion over iteration?
- Why is accessing some random element near the start of an array FASTER than accessing a random element near the end?
- I keep googling things I just learned about in class, is this fine?
- How do I perform mathematical operations on numbers within a string and return the same string but with the updated numbers in Java?
- Front-end built once, deployed on both mobile and web. Is it possible?
- how do I remove the comma from the last number in the array?
- I need to interview a programmer for an assignment
- Where do you do your code reviewing process?
- Comparing function's growth rates
- Java Inheritance question
- Windows app development
- How can I split a numberic array into multiple arrays based on their sum?
- How is python/tkinter using less memory than c/gtk on the Rpi3 using freebsd?
- Mapscript error in Python-flask inside Docker
- Know of any good dashboard apps?
- Do all programmers speak English?
- Why can't execute the code to the secondary window in javascript?
- Json deserializing and serializing using Lombok and Jackson
- Get first two digits of a number in Python without slicing
- [PHP][JQUERY] How do deal with this security exploit in my system ?
Do you also get into the programming zone? Posted: 05 Feb 2021 04:59 AM PST Since the title doesn't exactly describe what I mean, let me explain: So when I listen to electro music via headphones and drink coffee, I get into a tunnel vision where I ignore all other Input from the outside and focus only on my programming task on my screen. I go into a trance mode where I see/imagine all the logic of the Programm structure with mental eye before I proceed to programm perfect code, that fulfills the current task and is bugfree. This mode/zone continues for like 10 hours straight after which I have completed a workload originally intended for several weeks and after I then finnaly get up and notice that I am dehydrated and my blood sugar level is running close to null. Anyone else experiencing what I described? [link] [comments] |
Whats the best free programing tool? Posted: 05 Feb 2021 09:32 PM PST Hello, I am a first year IT student at college. I came up with what i think is a neat idea for a computer program. I was wandering what the best free program is to use to develop my idea ? (this is one of my first times actually using reddit so if im doing it incorrectly i apologize ) Thanks! [link] [comments] |
Why use recursion over iteration? Posted: 05 Feb 2021 12:58 PM PST Basically the title, but I do already understand that it's normally less lines of code which can also means it's less prone to errors. However with that in mind, I feel like to instinctively think of a recursive solution is VERY hard for me to do. Second question, have any of the full time devs on here actually used a recursive solution for something on the job and can you explain that. [link] [comments] |
Posted: 05 Feb 2021 09:57 PM PST I know they are both O(1) complexity, i'm talking at the hardware level here. I know the difference is also very, very, very small. Just recently I was doing a leetcode challenge one of which was a solution where lots of random access is done near the end of a 2D array. I found doing the exact same solution except from the front was ~10-20 ms faster and i'm talking consistently faster. This was in C++ with vectors I then setup a test in python, and initialised an array of size 1 million, with random elements. I timed random element acccess near both the front and back, and the front of the array consistently produced faster results. I made sure the access was random to eliminate the compilers ability to optimise via caching etc. Why would this be? I have always had the assumption accessing anywhere in memory should be roughly consistent. Thanks for any input. Happy to share code if requested. [link] [comments] |
I keep googling things I just learned about in class, is this fine? Posted: 05 Feb 2021 03:15 PM PST Im in a python class (but I don't think the language matters for this question) I keep getting told a lot of the time people look up syntax, and the goal isn't to memorize syntax, and Im mostly sure this is just that. Like right now im looking up the syntax for checking how to check if a number is in a list. Im just making sure what Im doing is fine, its not against any rules (Like im not taking a test that says no using google) so its definently not wrong, but Im just making sure its not harming me unknowingly thanks [link] [comments] |
Posted: 05 Feb 2021 06:32 PM PST For instance, I have the following string: "I took 15 credits last semester and 18 this semester." I want to add 3 to each number in this string and return the following string: "I took 18 credits last semester and 21 this semester." I also have another string that uses commas: "I went on 12 walks last week, but only 10 this week." I want to add 2 to these numbers so the string is returned as: "I went on 14 walks last week, but only 12 this week." I've tried using Matcher and Pattern, StringBuilder, etc. but nothing has been working for me. Any help would be appreciated. [link] [comments] |
Front-end built once, deployed on both mobile and web. Is it possible? Posted: 05 Feb 2021 12:12 PM PST Hi, I'm the founder of a small company that puts out tech products. Although not technical myself, one of the many roles that my small company needs me to fill in is the CTO role. I don't code, rather come from a design background. We currently have multiple products, but the relevant ones for my question are:
However, the mobile app will now need elements from the other two apps. I suppose that the FE (front-end) dev of the Mobile App will have to replicate:
But then it's a cat-mouse game, where every single change I make on the React app will have to be replicated on the mobile app. And vice versa. Is there any tech stack I can choose where we can either work once and use the built things twice? Or at least get to something that's as close as possible to this? Surely the bigger tech companies must've done something about it — although when I look at the Amazon App, I can sense that it's clearly differently built from their web browser app. P.S: Since we're here, may I also ask: any fantastic disadvantages from being 'fragmented' across different tech stacks with different apps? FWIW all these apps will be served from the saved DB and back-end [link] [comments] |
how do I remove the comma from the last number in the array? Posted: 05 Feb 2021 03:51 PM PST public static void main(String[] args) throws FileNotFoundException{ Scanner scan = new Scanner(new java.io.File("numbers.text")); double[] arr = new double[scan.nextInt()]; for (int i = 0; i < arr.length; i++) arr[i] = scan.nextDouble(); int min = arrMin(arr); int max = arrMax(arr); System.out.print("The array : {"); for (int i = 0; i < arr.length-1; i++) { System.out.print(arr[i] + ","); } System.out.println("} contains " + arr.length + " elements"); int first = 0, last = arr.length-1; int mid = (last-first)/2; System.out.println("The first element of the array is " + arr[first]); System.out.println("The last element of the array is " + arr[last] + " and is at position " + last); System.out.println("The middle element of the array is " + arr[mid] + " and is at position " + mid); System.out.println("The largest element of the array is " + arr[max] + " and is at position " + max); System.out.println("The smallest element of the array is " + arr[min] + " and is at position " + min); } } [link] [comments] |
I need to interview a programmer for an assignment Posted: 05 Feb 2021 09:38 AM PST Hello there. I'm learning software development and one of my homework assignments is interviewing a programmer/software developer (specific career doesn't matter as long as it's related to programming). I'm sorry for any grammatical errors or vague questions. English isn't my native language. I want to get this over with as quickly as possible so I'll just drop the questions here if no-one minds...
[link] [comments] |
Where do you do your code reviewing process? Posted: 05 Feb 2021 04:47 AM PST I usually coding c/python on vscode and use gitlab for version control and I found gitlab mr pretty annoying for code review. So I am trying to find a better way for it🙂 [link] [comments] |
Comparing function's growth rates Posted: 05 Feb 2021 01:02 PM PST Hello, I've been stuck on one of my comp sci assignments for a long time now because I simply think that its wrong. It wants me to order some functions from lowest growth rate to highest growth rate. I have them as so, 1.) sqrt(n)*log(n) 2.) 9n*log(n) 3.) 7*sqrt(n) 4.) n^4 5.) 2^sqrt(n) 6.) 2^(n^2) It says I'm wrong but I literally don't believe it. I need someone on here to tell me I'm wrong and perhaps where I'm going wrong in my thinking. [link] [comments] |
Posted: 05 Feb 2021 11:06 AM PST If Dog extends Mammal, and Mammal extends Animal (superclass), is Dog considered a subclass of Animal in addition to being a subclass of Mammal? In other words, are subclasses of a subclass classified as a subclass of the parent class? [link] [comments] |
Posted: 05 Feb 2021 10:47 AM PST Hi, most of my experience is concentrated in specific platform tooling (shell, Perl, pho, python) and some backend development (python and php mostly). I've made the switch to windows 10 sometimes mid last year and was curious what folks in here thought about windows 10 development. I figure some c# c++ and dot.net were where it was at. If I'm wrong tell me what languages I should be looking at. My real question here is: how is the platform for developing applications? I get web and mobile is all the rage at this point but I have some real interest in designing some applications with alternative user interfaces that are more intuitive. I'm wel aware there is quite a gap between my experience and what I'll need to learn to get there. I'm willing to put the time and work in. [link] [comments] |
How can I split a numberic array into multiple arrays based on their sum? Posted: 05 Feb 2021 10:42 AM PST Here's my problem: I have a numeric array that contains more or less random numbers.
and a variable
It determines the amount of arrays I want. So like this for example:
However, I don't just want to split the array, I want to sort it in a very specific way. I want the sum of each array to be as close to the other ones as possible. Example: This would be a bad output:
The values are quite different from each other. This output would be much better (see how the values are really close to one another):
Any ideas for a program logic/an algorithm that would be able to deal with this problem as efficiently as possible? Btw; I'm using JavaScript here, but I care more about the idea than the actual programming. PS: It doesn't matter if the output is different each time or consistent. PPS: Oh I forgot to mention, that I don't want to do that. I want the values in each sub array to be pretty random. Like, I don't want an array with big values and one with small ones. I want a more or less even or at least random distribution in each sub array. [link] [comments] |
How is python/tkinter using less memory than c/gtk on the Rpi3 using freebsd? Posted: 05 Feb 2021 06:30 AM PST I'm practicing programming with guis on hardware with more limited resources. Since I've always felt that memory was my largest constraint when programming on the PI, I wanted to establish a baseline for how much I would have after accounting for the background processes. I fired up top and checked the "RES" column. My top 3 biggest sinks are In all memory usage is 180M Active, 23M Inact, and 340M free. I figured depending on the os, and desktop environment, people probably have between 200 and 250M free so I would want to keep my programs to around 150+- a few mb. I'm most familiar in writing guis in Racket and Python, so first I wanted to check how much resources each interpreter used on their own. Then I wrote a program to display a button using python/tkinter, racket/gui/, and c/gtk3.0. What is surprising to me was how memory efficient python was. It even used less memory than straight C + gtk. I recognize that this isn't scientific, and that there is probably a lot more things going on here, so what do y'all thing is going on? [link] [comments] |
Mapscript error in Python-flask inside Docker Posted: 05 Feb 2021 09:12 AM PST I have a simple flask app and I am trying to run in Docker
My Dockerfile is:
But I get the following error when I run
`` This happens only when I have the Python VENV activated when running outside Docker but I don't know why I am getting this error inside Docker. [link] [comments] |
Know of any good dashboard apps? Posted: 05 Feb 2021 07:40 AM PST UPDATE: I found wtfutil which appears to do what I want. __________________________________________________________________________ In order to be more efficient at my development work, I'm looking for a dashboard I can run on a spare low-power system and monitor (such as a R.Pi). There are many specific dashboards (e.g. zabbix, github), but I want a single screen for everything so I don't have to round-robin check things all the time or context switch. Possible Features
Unneeded features
Company Panes
Personal Panes
Possible simple DIY solution if I can't find anything.
[link] [comments] |
Do all programmers speak English? Posted: 05 Feb 2021 01:25 AM PST Whatever country I've been to, whatever proficiently in English is normal or not, there's one thing that always seem to be true... If a person works as a programmer, he/she speaks fluent English. Is this because the community internationally is in English and that all (most) programming languages has syntax with English words in them? [link] [comments] |
Why can't execute the code to the secondary window in javascript? Posted: 05 Feb 2021 06:55 AM PST the class name isn't wrong Also, if I execute the following code in that tab's console, it worked see: then it clicked and jumped to the page [link] [comments] |
Json deserializing and serializing using Lombok and Jackson Posted: 05 Feb 2021 06:00 AM PST I have 2 get Api calls which should return me a Json object { "entityId" : "123", ... } and [ { ...}, {...}, ... ] What did my pojos look like? Currently, I have an item class for the base object and for the response a list of Items. But I am getting a cannot deserialize from json array to collecting list error. Not sure if I unbeatable how Jackson ( with Lombok) work. [link] [comments] |
Get first two digits of a number in Python without slicing Posted: 04 Feb 2021 11:46 PM PST I know that to get the first two digits of a number in Python, you can simply use slicing. However, I am on the staff for an intro CS course where we haven't taught slicing to students, and instead they have to use math operators and while statements to do so. I want to write a function that gets the first two digits of a number, where if the number is less than 10 it returns Is there a way to remove the first [link] [comments] |
[PHP][JQUERY] How do deal with this security exploit in my system ? Posted: 04 Feb 2021 11:32 PM PST My site/app is running on a local machine at work, so the threat isn't huge as we are a total of 10 users but knowing that such an exploit exists still makes me uncomfortable and I want to solve it once and for all. Once a user logs in, his clearance level is queried and stored in a session variable $_SESSION["clearance"]; In all pages I have a page included that contains all possible actions and who can perform them in the form:
I use inarray to check if a user's clearance is included in the action's array. So from above, user with clearance [5] can only insert into table_1 but not modify column_1. He can update a column with the same name in a different table, "table_id_2". Problem is, the table DOM id #table_id_1 is sent using AJAX along with the new value to update, column name,....to a page that handles the UPDATE for all of my tables. Currently, what's stopping user with clearance [5] from changing the dom id of "table_id_1" or change it directly in the ajax call to "table_id_2" (in page source) and thereby be granted access to update a column having the same name "column_1" in "table_id_1" which he does not have access to? Sometimes, the same page can include two php tables, both querying data from the same database table, but one user could update column in one table but not the other...user could simply swap the table id's in the DOM. And thank you in advance. [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