What is the proper way of using constructor? It is a good practice to use conditions, and loop inside a constructor? Ask Programming |
- What is the proper way of using constructor? It is a good practice to use conditions, and loop inside a constructor?
- I just heard a shell is an OS (Linux, Windows, Apple, etc) but then someone else said you don't have to run Linux you can run Bash on Linux, what does that mean?
- How to solve this partitioning problem using c?
- Why joins are impossible in (partitioned/sharded) NoSQL databases?
- Locking memory location using mutex in c++
- How much is enough?
- Angular: TypeError: this._ngZone is undefined
- Remote programmer year end gift?
- [Question/C++] Optimization of processing of vector of objects
- Python N largest key values in list of dictionary objects
- apache config is not my strong suite
- Need Data Compression Project Ideas
- What language would be most optimized for creating and saving randomly generated mazes?
- Python graphing from an excel file
- Absolute noob looking for a script/program that pipes certain text from a PDF into a pre-exisiting Word file
- Language choice in regards to others?
- Programming with Bash on linux
- [Software Development] Looking for a mentor
- How can add image background on Dart splash screen?
- Homework help C language
- Flutter or Unity for a simple mobile app?
- Can someone help verify if my Dataframe solution is correct?
- need help for java programming
- Is there a seemless way to program Arduino using Python code?
- Exiftool and batch renaming/metadata, please help
Posted: 03 Dec 2020 10:23 PM PST Here's the source code of my prof in Object Oriented Programming (Python). I just want to know if this is a good practice? [link] [comments] |
Posted: 03 Dec 2020 09:33 AM PST If Linux is the shell, are they saying you can run a shell in a shell? Thank you! [link] [comments] |
How to solve this partitioning problem using c? Posted: 03 Dec 2020 09:12 PM PST A natural number that is greater than one can be partitioned as a sum of some prime number(s). Your task is to find out as few primes as possible that sum up to the natural number. If the number of such partitions is more than one, only the partition with the greatest product of those summands is considered. Each test case will contains a natural number n, 2 <= n <= 1000000. For each input, output a single line that contains the number of summands and also all summands, separated by a space. The summands for each test case should be listed in non-decreasing order. I only know to consider 2 summands, 3, 4...(definitely not a correct way) [link] [comments] |
Why joins are impossible in (partitioned/sharded) NoSQL databases? Posted: 03 Dec 2020 10:04 PM PST |
Locking memory location using mutex in c++ Posted: 03 Dec 2020 09:48 PM PST I'm learning to use threads in c++. I'm confused about how the mutex here actually locks the location, specifically how WaitForSingleObject() and ReleaseMutex() work to make the sum variable thread safe. Could you please help me walk through what happens with the first thread which to hit WaitForSingleObject() and the first one to work past it? How does the first thread to finish get past WaitForSingleObject()? And how does ReleaseMutex() not release the mutex for all the threads? Thanks. [link] [comments] |
Posted: 03 Dec 2020 04:05 PM PST Hi All, I'm feeling really overwhelmed with my current situation. I've been trying hard to break into this field, but I just can't seem to figure out how and I'm really beginning to doubt my capabilities. Quick rundown of my credentials and history. BS in Materials Physics 2 Years High School Teacher (school closed pre-covid) 1 Year Tech Support in a Hospital Lab. Went to a Coding Bootcamp before I started working in the hospital lab and learned Swift. I had to get a job local to me for family reasons, and there wasn't anything local for mobile development. I did put one app on the app store. With the help of a distant colleague, I started learning web development. Rails backend, ruby front end, but I'm not naturally coding in these languages yet. Since then, I've purchased around 13 courses on Udemy to pursue in the very little free time I have. I have swift decently well down I think, and I've some Python from my undergrad. I've since been learning HTML, CSS, Ruby, Rails, JS, JQuery, React, Vue and Angular, etc and I have classes and UI/UX and C programming and Kotlin as well to round off mobile development for me. Most of these I'm very much a novice with. With Covid going on, the laboratory is frankly overworked and understaffed and it's begun to affect my mental health (and everyone else whose working there, it's kind of a mess. Way waaaaay too much work for how many people are currently employed there). I want to move on from this position and finally into a position I can turn into my career. How much do I need to know and be able to do in order to be successful in a programming position? I don't want to be a burden on a place that employees me, but I am getting kind of antsy in this position. Thank you for your help! [link] [comments] |
Angular: TypeError: this._ngZone is undefined Posted: 03 Dec 2020 02:37 PM PST Hi all, I've been learning/working with Angular for a personal project, and I've run into an error that I can't find a solution to. You can see my full repo here. It's relatively small, it's only got one real page so far. I did my initial setup via angular's CLI, and haven't touched package.json at all. The issue comes in the MainNavComponent.html at line 2, according to my browser's console. The error is as follows:
This is weird, because I don't call ngZone anywhere in my code, let alone in the main nav component. The only thing that I can think of is that in the MainNav component, I do set up an isHandset method which requires a BreakpointObserver. Looking at BreakpointObserver, it looks like it may use ngZone. This error happens before ANYTHING else, so the page never even loads. The whole webpage is, currently, completely broken because of it. Has anyone ever encountered this? I've deleted my ngModules folder and reinstalled several times now. I've tried doing npm update --all to see if it's a version issue. Nothing has worked so far. I'm really confused as to how this even happened- this code was working just fine literally a week ago (last time I made any changes). I didn't change anything about my environment or the code between last week and today, I'm at a loss as to how it managed to break itself. [link] [comments] |
Remote programmer year end gift? Posted: 03 Dec 2020 05:52 PM PST I lead a team of six programmers who usually work in the office and have been remote since March due to the pandemic. Usually at the end of the year, we go out for dinner and video games my treat, plus a bottle of something nice for each of them. Looking for remote gift ideas besides something lame like a generic gift card. I thought of shipping them something but don't have their home addresses, and don't want to invade their privacy. What would you want if you had a choice? [link] [comments] |
[Question/C++] Optimization of processing of vector of objects Posted: 03 Dec 2020 04:53 PM PST Hello guys, I have a bunch of objects and all of them are inheritors from BaseObject with virtual function Process(). So I am going through the vector of these objects and call Process() for each of them. Another thing is that these objects form a chain so I need to process them one by one or data will be broken. It is not a chain line since some objects are inputs for a few of others. It looks more like a tree. Sometimes I have a branch that will merge with chain back again. I try to say that conveyor is not an option. And this loop has really bad performance. So my question to you: is it possible to make the processing faster? Maybe I should leave the loop alone and go to the optimization of each specific object? The processing of each object has some general view: get inputs (a different number for each), do some math with inputs, assign the result to a "value" member. All objects can be looked like some "value" that can be used as inputs for other objects. Please share any ideas with me, even crazy ones. [link] [comments] |
Python N largest key values in list of dictionary objects Posted: 03 Dec 2020 04:43 PM PST In python 3 you are given a list of dictionary items i.e. [{...},{...},...] each dictionary item have identical keys and one key is an integer field Using only built-in modules and no external packages, how do you find the top N number of items in the dictionary list which have the largest integers in their key value field? [link] [comments] |
apache config is not my strong suite Posted: 03 Dec 2020 03:36 PM PST not sure if this is actually an apache issue or config issue or possibly just me. i have a setup with a server which is behind a load balancer. the server has apache 2.4.6 and running os: Red Hat Enterprise Linux Server release 7.1 (Maipo) apache has a bunch of defined urls which are then going to a backend which is written in nodejs and the issue is when uploading "larger" files (20mb+), funny enough this doesn't occur on my test server which is essentially the same in everyway just with no load. i get the following error. ## error Bad Gateway The proxy server received an invalid response from an upstream server. ### my config [link] [comments] |
Need Data Compression Project Ideas Posted: 03 Dec 2020 02:23 AM PST Hi. So in our Data structure course we picked the data compression project and unforunately our proposal was reject and my group was asked to come up with more feature in our data compression project. We are already doing hybrid text based compression (lzw + huffman) but what other features can I add to the project to make our course professor approve it? :) [link] [comments] |
What language would be most optimized for creating and saving randomly generated mazes? Posted: 03 Dec 2020 02:20 PM PST I'm generally new to programming (have only taken one class in c++ ages ago) and I'm working on a project that requires generating a random maze, then exporting it and its solution as a pdf or some other vector file. Is there a programming language that is better suited for this, or does it not matter beyond its ease-of-use? Edit before I get called out: I did a better google search and am currently learning about Prim's algorithm and other maze generators. Still overwhelmed by options, though. [link] [comments] |
Python graphing from an excel file Posted: 03 Dec 2020 01:57 PM PST Hey im having a bit of troubles graphing cause i need to create the code so it only graphs one specific name but if i put the other names it will also graph it. It is line graphs Implement a Python function (called grafTemps) that allows, given the name of a file like the previous one and a place, draw the graphic corresponding to the evolution of the maximum temperatures throughout the years present in the file. For example, for the pordata2.csv file provided, the call grafTemps ('pordata2.csv', 'Braganca') must produce the following graphic. [link] [comments] |
Posted: 03 Dec 2020 01:51 PM PST Hi guys, I am an absolute noob but I'm hoping that you might have a tip for me on where I should start looking, or what keywords I need, to find a program. I feel like it might already exist in some way or shape, but I just can't find it. I was hoping I could find a little program / script that I can load a PDF into, that can look for text in a certain table cell, and pipe them into an already existing text. Reason asking is that part of my job is taking information out of standardized PDF's and enter it into a Word document, and it's doing my head in having to do this by hand every day. If anyone has heard of something that might resemble this, please do let me know. And I apologize if this isn't the right forum to be asking this in! [link] [comments] |
Language choice in regards to others? Posted: 03 Dec 2020 01:40 PM PST Hello! I'm currently in school for cybersecurity and wanted to self-teach some programming languages on the side. Since Python is a pretty well-rounded language and is used often with cybersecurity tools, I figured it's a near necessity at this point to have it under my belt. With that being said, I feel a low level language would be helpful as well. I would want to be able to understand and reverse engineer malwares so I plan on also learning C and delving into Assembly as well. The crossroad I'm stuck at is the worth behind learning C++. Would it be helpful to learn it past basic syntax when I have Python or C at my disposal for Higher and Lower level language uses respectively? I also need to be comfortable with Java and HTML so if C++ wouldn't be a necessity it would be a big time saver. Thank you in advance! TL;DR - if C and Python: C++? [link] [comments] |
Programming with Bash on linux Posted: 03 Dec 2020 01:31 PM PST Hello, new to bash on linux. Small question, · If the number entered is between 100 and 500, your script should print out the "X" character as many times as the number entered. If I was to make a for loop with this script, how can I reprint out a variable X amount of times from user input within a for loop? [link] [comments] |
[Software Development] Looking for a mentor Posted: 03 Dec 2020 06:08 AM PST Hello! :)I'm looking for someone who would be willing to mentor me a little bit and answer some question along the way. My preferred language would be java (but would be open for learning new languages) I have an OK grasp of OOP and Algorithms/Data Structures. I'm also interested in Machine Learning (currently working through sentdex neural networks from scratch). Just reply to this post or write me a PM :) Thanks in advance! (I could teach you german, danish or maybe even guitar in return) [link] [comments] |
How can add image background on Dart splash screen? Posted: 03 Dec 2020 12:02 PM PST There is my code from widget which has the content of splash screen. u/override [link] [comments] |
Posted: 03 Dec 2020 05:48 AM PST Hello programmers, first of all i'd like to thank those who responded to my previous post and helped me a lot but i'm gonna get straight to the point. I have a homework, a guessing game involving while loops so basically the game will keep asking you to guess the number until you get it right. The program works fine, however the input of the user will be taken as an integer, and when i put a decimal number the program prints what's inside the while loop infinitely. How do i prevent this from happening? Is there a way so that the scanf function only reads the whole number and not include the decimals after it? Thank you! sorry for bad english 1st year student here :D wear a mask, wash your hands. [link] [comments] |
Flutter or Unity for a simple mobile app? Posted: 03 Dec 2020 11:34 AM PST I've made small puzzle-type games on the desktop before in VB and C#, but this will be my first mobile game. It will be about as simple as Checkers. Can you please tell me the pros and cons of Flutter vs. Unity for this level of app? I've never used either. Thanks in advance. [link] [comments] |
Can someone help verify if my Dataframe solution is correct? Posted: 03 Dec 2020 11:31 AM PST Hello, I have created a csv of data with the following columns: (1) app_key (2) churn, (3)tenure https://i.stack.imgur.com/NAlFF.png I have performed the following code in order to drop app_key and churn from my data so that I can run an XGboost model I dropped the app_key column so that I could perform an XGBoost operation on the data set. Given that the app_key field is just a customer key, I needed to remove that in order to run XGBoost operation. You can see the XGBoost operaton below. Shap_output is a dataframe with several columns of data that represent coefficients of each feature. The problem with this output is that it only gives me the coefficient without any customer key that I can use to connect the coefficients with. The rows are listed by numbers (0), (1), (2), etc.. I would like to produce a final output that contains app_key with the corresponding coefficients that have been output from shap_output so I can easily lookup which customers have low coefficients. I attempted to do this by adding the dataframe of my original csv (test_data) before dropping the values with my new output, but I'm unsure if this is the correct approach. My main concern is that the rows may not align since I'm unsure if there's any unique sorting. I'm unaware of how to check if sorting may be happening as well. below is the code I used to join my shap_output with my app_key Can someone please let me know if this approach is the best way to ensure that I end up with one output that has the app_key and the corresponding outputs from shap_values? Or is there a better way to connect my app_key label with the corresponding coefficient? Thank you so much! [link] [comments] |
need help for java programming Posted: 03 Dec 2020 04:59 AM PST can anyone help me to get the output like this ? i tried use for loop and failed to get same output everytime Enter an integer between 1 and 20: 8 1 2 3 4 5 6 7 8 2 7 3 6 4 5 5 4 6 3 7 2 8 7 6 5 4 3 2 1 its should be like a box [link] [comments] |
Is there a seemless way to program Arduino using Python code? Posted: 03 Dec 2020 10:53 AM PST I tried once before but got stuck at one point. This was years ago though. Has anything come out to make the process easier? Thanks! [link] [comments] |
Exiftool and batch renaming/metadata, please help Posted: 03 Dec 2020 10:48 AM PST Hi, I work in digital preservation and our institution is currently in the process of migrating legacy data to a new digital preservation platform. The new platform is highly automated but is dependent on a very specific file naming convention. Because of the nature and use of our content, it is very important to retain the "current" file name in the embedded metadata. I say "current" because the file has already been renamed once from the raw file name at time of digitization. Basically, I need the "current" filename to be saved in the metadata, instead of the original "raw" name during a batch rename. Example: Raw file name: 0001.CR2 Current file name: bx1_fl2_03.tif (this needs to get added to metadata) New file name: refid_NNNNN.tif (changing the file name to this) refid- unique ID NNNNN- five digit, padded, sequential number I have looked into Adobe Bridge's Batch Rename Tool and the "Preserve current file name in XMP metadata" but all I can find after the rename is "Raw File Name: 0001.CR2" in the metadata. I have also looked into using exiftool, but I admit I have only ever used this to view metadata for a given file, not write a new file name. Everything I have found so far says that it can be done, but I am having trouble figuring out how to do it (and in a batch function). Any help you can give is much appreciated!! [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