• Breaking News

    Monday, February 8, 2021

    Having troubles doing word assignments in class (newbie) Ask Programming

    Having troubles doing word assignments in class (newbie) Ask Programming


    Having troubles doing word assignments in class (newbie)

    Posted: 08 Feb 2021 04:14 PM PST

    I'm really struggling in my java class. This is the 3rd coding class I've taken at uni and I still feel just as lost as when i started. Every professor I've taken will show us the basics like variables, logic, if statements, etc.

    But then they just give assignments that ask us to write a program that does some random task such as taking in the input of a user, telling them how many characters in the string, vowels, etc (this was example from last week's assignment) without telling us what we'd need in there.

    It's like teaching a person about different food ingredients, then telling them to a meal. There's no connection. They don't say "here's the ingredients you need, here's the steps, etc". We're just supposed to know it and do it. This is every coding class I've ever taken and I feel like I can't move on until I understand how to approach problems.

    What the hell? How do they expect us to know what to do? People tell me constantly, "just break it into smaller parts". Yeah that's fine and all, but it still doesn't teach me what I need to know for the given problem.

    In my old math classes for example, my teachers would teach us how to approach word problems. They'd say "if you see the word "and" it means to multiply." If you see this, then it tells you that you'll need to use that", and so on. I don't get that in coding.

    How do I know I need to use a constructor or different classes, and if statements? What clues do I look out for to know what I'll need to solve a problem? For example, If a someone were to ask me to write an If statement, then I can do it. But I would have no idea when they are used or how to tell that I'd need one.

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

    Aerospace Engineering Student, C++ vs Python

    Posted: 08 Feb 2021 06:44 PM PST

    I know this topic is likely beaten to death but I wanted to throw my specific situation out there. I am an aerospace engineering student, and I of course know MATLAB (thanks Texas A&M and Arizona State) but I need to make myself more marketable and choose which to learn. Had someone who worked in hiring for years for NASA tell me to learn one of the two. I know both would be ideal but I simply don't have the time to do both, I'm still a full time student. From what I've read: C++ = more powerful, hard to master. Python = beginner friendly but not quite as capable (subjective). If i HAD to pick one... which? I'm honestly more concerned about what will look better on resumes and what my industry will want me to know rather than what is actually best to be good at. I'm not a programmer or EE, so any input is great

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

    Which text insertion alternatives are there to clipboard and SendKeys?

    Posted: 08 Feb 2021 05:51 AM PST

    I have a speech to text application which inserts text using the clipboard. This mostly works great in various applications but some applications will append extra spaces when pasting text. One of these applications is Word 365. "Smart cut and paste" is a function enabled by default in Word and one of the things it will do is add an extra space before the pasted text. With words this is fine but when inserting punctuation the extra space is extremely annoying.

    I use SendKeys (to do Ctrl + V) and for inserting new lines (Enter key) in certain applications. I could do the same with punctuation but I would run into problems when writing something that starts with parenthesis and then a long word which would also have to be inserted with SendKeys.

    Here's an example of how it could look. Code is simulated keypress. The rest is pasted using the clipboard.

    "I am writing an essay about XT (Xenotransplantation) including do hickeys, gerbils and xylophones! Marvelous."

    Simulating key presses take time.

    If a user speaks the entire sentence with punctuation it will insert all of it without extra spaces. But the user will pause to think, sometimes just before a punctuation is said which will result in the extra space.

    Now this issue is not persistent as the "Smart" "smart cut and paste" is sometimes a bit too smart.

    I know that Microsoft uses Text Services Framework for text insertion with Windows Speech Recognition but I have been advised against using it mainly due to it not being properly maintained anymore. Windows Dictation uses a different API but it is not publicly documented. Neither of these present the issue.

    The speech to text application uses UI Automation, IAccessible2, Edit Control Messages and Windows Messages to gain information about text and caret position. Word 365 does not support text insertion with UI Automation so that is not an option.

    Dragon from Nuance does not present the samme issue in Word but I assume it uses its own proprietary text insertion(?).

    Are there any alternatives to text insertion that does not rely on the clipboard and isn't as slow as SendKeys?

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

    Python Query

    Posted: 08 Feb 2021 09:33 PM PST

    I am so sorry if this seems like a stupid question to ask but can you please help me out on what I am doing wrong in this piece of code, it's a fairly short code written by a school kid where I just want to separate sentences using an or a.

    Input :

    def my_function(food):

    for x in food:

    if food == "apple": 

    print("I ate an" + x )

    elif:

    print("I ate a" + x )

    fruits = ["apple", "banana", "cherry"]

    my_function(fruits)

    Output:

    File "<string>", line 4

    print("I ate an" + x )

    ^

    IndentationError: unindent does not match any outer indentation level

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

    Advice Help

    Posted: 08 Feb 2021 05:31 PM PST

    Hi all! I need to ask some general advice since I am a bit lost in my programming journey. A bit of background about myself, I took AP Computer Science Principles my senior year of high school where I learned the basics of Python and a little bit of Processing Javascript? (not sure if this is actual JS or a library I think?). I had a good time in the class and over the summer, I did a 1 month program where I learned Javascript a little bit (Google CSSI). Fast forward a bit I'm a freshman now who in the first semester did Python and now in my second semester is currently doing Java + Javascript/HTML/CSS (learning react in the process). I been struggling with these 2 courses and can't seem to grasp the concepts yet. I have a good understanding of functions, variables, loops but still struggle. For example, for my java class, I need to write code to make a high roller game with some of the code being given but we have to fill the rest out. I feel confused and lost and have no idea how to tackle the problem since there's so much that is being asked. I really want to learn how to be a good programmer and make my own applications or projects but I been struggling with these courses and feel like programming ain't for me. I feel like I am trying to do too much and learn too much instead of taking my time and just picking one thing that I should be focusing on. In addition to this, I found a lot of great tutorials online that I think are really good but feel overwhelm with doing that in addition to my college courses. I haven't been given the time or energy with learning all of this. I remember during winter break, I tried to make my own project in python but couldn't think of anything to write or even how to start one. I see that people mention projects but what types of projects? What projects can I make with Python/java/Javascript? What's good for what? How to escape tutorial hell? How to take that next step as a programmer?

    Sorry if this seems long and sounds like a rant. I think I'm just a bit lost and stressed with my classes right now that I needed to vent it out. Any sort of advice or tips is much appreciated!

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

    Trouble importing modules in Python

    Posted: 08 Feb 2021 09:39 AM PST

    Hi, I'm currently working on a Flask app with a folder structure that looks like this:

    server/

    ......server.py

    ......folder1/

    ............__init__.py

    ............module1.py

    Inside server.py, I am importing a function from folder1.module1 using the following:

    from folder1.module1 import my_func

    This works fine locally, but after I deploy my Flask app to Heroku, I get the following error:

    ModuleNotFoundError: No module named 'folder1'

    I have tried looking up info related to relative import and absolute import, but it still doesn't work. I was wondering if anyone knows what the problem might be.

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

    Can someone please explain the difference between ActiveX for web and ActiveX for desktop?

    Posted: 08 Feb 2021 08:57 AM PST

    Question involving use of sizeof() to get the size of an array in C

    Posted: 07 Feb 2021 11:50 PM PST

    Hello; sorry if this is a silly question, but I don't get why sizeof(ptrtoArr) returns 8 (instead of 7?) within the binsearch() function I'm creating.

    #include <stdio.h> // Linear search void linsearch(int *ptrtoArr, int target){ for (int i = 0; i < sizeof(ptrtoArr); i++){ if (ptrtoArr[i] == target){ printf("Target is element #%d.\n", i+1); } } } // Binary Search void binsearch(int *ptrtoArr, int target){ int size = sizeof(ptrtoArr); printf("The size of this array is %d.\n", size); //why 8? } int main(){ int array[7] = {-2, 3, 4, 7, 9, 11, 13}; int target = 11; linsearch(array, target); binsearch(array, target); return 0; } 

    Edit: Ok thanks everyone! Haven't read through everything in detail yet, but I'll just pass the array size for now.

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

    SD/Fast Help?

    Posted: 08 Feb 2021 07:14 AM PST

    Hello everyone!

    I'm a grad student working with some old code, and I've run into a point where I need to use a code called SD/Fast (link included at the end of the post). The problem: it's essentially discontinued at this point. This is a shot in the dark, but has anyone on here run SD/Fast or something similar? For specificity on what I'm trying to do, I have a Makefile I'm trying to compile, but SD/Fast is called within the Makefile, so it's failing when it gets to that point. The options I can think of at the moment are:

    1. Find a license key through questionable means.
    2. Find an open source version I can use to substitute.
    3. Find a legit version.

    Thanks so much in advance to anyone with advice or help!

    https://support.ptc.com/support/sdfast/index.html

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

    Are these books on Humble bundle good for both beginners and experienced developers?

    Posted: 08 Feb 2021 02:35 AM PST

    Few browser tabs or all the tabs?

    Posted: 08 Feb 2021 03:23 AM PST

    How many tabs do you use on your browser. If I have more than 7 myself I have to start closing them.

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

    How many arguments can the range() function take?

    Posted: 08 Feb 2021 04:48 PM PST

    Python language

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

    Imagemagick gif creation

    Posted: 08 Feb 2021 12:58 PM PST

    Hi, I'm new to the raspberry pi world. I'm trying to create a gif using imagemagick but it's not using all the photos.

    I've slimmed it down to 3 photos, and so the order should go 1,2,3,1,2,3,1,2,3 etc. Instead it's doing 1,2,1,3,1,3,1,3,1,3,1,3...

    The code is as basic as it gets but I can't figure out why it might be doing this, especially just with three photos.

    convert - delay 10 - loop 0 image*.jpg animation.gif

    I've also tried it with more photos and it just spends ages on the first photo then blinks to the last photo before going back to the first and repeating!

    Any help is greatly appreciated

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

    Understanding 2D convolution output

    Posted: 08 Feb 2021 12:51 PM PST

    I am beginner in Convolutional DL. I saw the following architecture in a paper: For images of size 256*256,

    type filter size/stride output size
    convolution 11*11 / 4 96 * 54 * 54
    convolution 1*1 / 1 96 * 54 * 54
    max pool 3*3 / 2 96 * 27 * 27

    I do not understand the output size of the first 2D convolution: 96*54*54. 96 seems fine as the number of filters is 96. But, if we apply the following formula for the output size: size = [(W−K+2P)/S]+1 = [(256 - 11 + 2*0)/11] + 1 = 62. I have assumed the padding, P to be 0 as it is not mentioned in the paper anywhere. Keras Conv2D API produces the same 96*62*62 size output. Then, why paper points to 96*54*54? What am I missing?

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

    [MAX_PATH] what is it?

    Posted: 08 Feb 2021 12:21 PM PST

    Whilst learning C++ I've come across

    TCHAR szModName[MAX_PATH]; 

    What does MAX_PATH mean?

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

    Just an idea I had

    Posted: 08 Feb 2021 05:44 PM PST

    Maybe this already exists somewhere but Someone should make make a program that ever day changes your desktop background to like a random inspirational picture/meme(or just a pictures of happy dogs). If you do know of something like this please tell me where I can get it.

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

    Oracle SQL - Procedure to update another table

    Posted: 08 Feb 2021 11:33 AM PST

    So my procedure should add a row to the table INSÄTTNING. Some keys are reference keys. When the row has been inserted it should take P_BELOPP and subtract it with SALDO which is in another table called KONTO. The new amount should be added into that column and replace the old amount. My code looks like this so far:

    create or replace procedure do_insättning( p_radnr in insättning.radnr%type, p_pnr in insättning.pnr%type, p_knr in insättning.knr%type, p_belopp in insättning.belopp%type, p_datum in insättning.datum%type) as begin insert into insättning(radnr,pnr,knr) values(select radnr from kontoägare,select pnr from bankkund, select knr from konto); insert into insättning(belopp,datum) values(p_belopp,p_datum); update konto set konto.saldo = konto.saldo - p_belopp where kontoägare.radnr = p_radnr; dbms_output.put_line('Saldo: '||''||saldo); end; 

    I get that SALDO must be declared error. Would it even work as i intend?

    Ive tried some programming forums without any luck. Hope its pretty understandable :)

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

    SQLite3 Data Table not Updating on Ubuntu (Pics) (Pycharm)

    Posted: 08 Feb 2021 05:11 AM PST

    Hey everyone, I'm pretty new to programming. I have an alright knowledge of Python but my SQL knowledge is quite poor. If this question is basic I apologize, but thanks for helping and any upvote visibility. I've been spending my COVID time learning programming and I'm following a stock trading program tutorial using SQL tables to gain a more practical understanding of the language.

    I've been using this guide. I've been copying this tutorial almost every step of the way on this project, but I've run into an issue with updating my tables through Python, which is a consistent issue I've been dealing with.

    image 1 Here is my code updating app.db and the subsequent results. (I know the last line is useless) However, when I check the database in the Pycharm terminal image 2 I only see the results I manually entered earlier. This leads me to believe I am not really updating my database. Does anybody know what I'm doing wrong?

    Thanks for the help!

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

    Facebook API how to read billing threshold of ad account

    Posted: 08 Feb 2021 02:16 AM PST

    Hi everyone,

    I want to know how to get the billing threshold in the facebook marketing API v9.0. I can view it in Payment setting of an ad account (marked by red color in the attached image) but I can't find any related field in ad account object of marketing API.

    Thank you for your help.

    https://drive.google.com/file/d/1K8MYW3Oe3hmmVugMDFK-kQ8Xo-ixPuBi/view?usp=sharing

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

    How can I create a script to interact with my PC's files and a browser app?

    Posted: 08 Feb 2021 06:48 AM PST

    So my use case is using an image modifier to modify a set of photos I have. I want to automate a process where I upload photos to a browser application from my laptop, download the modified photo, and then upload and modify the next one, and download that. Then repeat until the photo album has the entirety of its contents modified.

    What is the simplest way to do this for a naïve programmer? It's a lot of photos and I can't sit around doing it myself.

    Any suggestions to approach or what language/toolset I can use?

    I have limited programming experience but can learn what I need. I just need to know what's possible and where to start.

    Thank you all very much for any suggestions or insight.

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

    Verifone POS potential uses?

    Posted: 08 Feb 2021 06:42 AM PST

    How customizable is the software used by POS devices, such as the Verifone mx915? Can it run custom code? How does it interact with software on a computer? Could a code savvy consumer get any use out of it?

    Will it play Doom? lol

    What is there that I should know if I'm considering buying one?

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

    Are there any general purpose protocol definition languages?

    Posted: 08 Feb 2021 12:46 AM PST

    Hey all! I need to document an existing websocket API (that I don't control), and I'm wondering if there's a suitable formal language for defining it.

    My first thoughts point to things like ProtocolBuffers or Thrift as a service definition language. But they have some serious limitations in doing this: their JSON serialization protocols are quite ridgid, and even if one was to implement a custom protocol (and this is quite easy in Thrift), you still need to include a lot of metadata that wouldn't match the Websocket API I'm documenting.

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

    Which processor should I go fo from, i5-10th gen. with hexa core processor, i5-11th gen with quad core processor & i7-11th gen with quad core processor? Basically, 70% of time is spent in coding (VS code, IntelliJ, PyCharm etc.) and sometimes video editing.

    Posted: 08 Feb 2021 06:34 AM PST

    How hard is it to get a job for gems of India?

    Posted: 08 Feb 2021 04:38 AM PST

    I am currently perusing cse in India from a tier 3 college. Soon my placement are going to start. I really love making software. But my academics is fucked up. I don't know if I will make a fucked up software or not.

    Gems stand for general Engineering male student.

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

    No comments:

    Post a Comment