• Breaking News

    Tuesday, October 13, 2020

    High school teacher looking for card sorting program Ask Programming

    High school teacher looking for card sorting program Ask Programming


    High school teacher looking for card sorting program

    Posted: 13 Oct 2020 07:56 PM PDT

    I teach high school science in an online environment this year. Previously a lot of my learning activities involved physical cards or manipulatives that we would move around and sort. For example, sort chemical substances into two stacks of pure substances and mixtures. Or sort the biological levels of organization in order from smallest to largest (cell, tissue, organ, organ system, etc). This is immensely useful for student learning.

    I am desperately seeking a way to do this online and give each student the opportunity to practice sorting cards in their browser. A flashcard service like Quizlet won't do because the cards cannot be reordered, only flipped back and forth to see the term and definition. Quizlet's "matching game" is closer to what I want, but not really. I just want to have a virtual "table" with cards of my choosing, and a student can drag and reorder the cards however they want. I do not need validation or grading of student responses. I do not need collaboration or syncing between users. I do not need the state of the cards to save when the student leaves the website. What I want is similar to a user experience card sort - but in a browser.

    I'm not a programmer but I know the basics of html. What's the easiest way for me to do this?

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

    How to do your own "A website wants to open this Application"

    Posted: 13 Oct 2020 06:06 AM PDT

    If you have steam installed you can most probably write "steam:" in your address bar in your browser and it'll try to launch steam. You can also do different steam functions through this by writing them after the colon.

    How would one go about doing this by yourself? I'm assuming something registry but I haven't really thought about this, nor seen anything about it before so I dont' know where to start searching.

    I want to do it for a Java application that I've written that takes a link after the colon and then processes it.

    Thanks for any help.

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

    Windows Defender (And other anti-virus)

    Posted: 13 Oct 2020 06:35 PM PDT

    I have been recently writing a program in python, and I exported it and gave it to one of my friends, and I noticed that his computer's windows defender had issues when opening it (it wasn't trusted), is there any way to prevent this from occurring? Is there some sort of test I can do to make it a trusted program? Or is this something you need to apply for?

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

    What’s a good open source project for a beginner to try contributing on?

    Posted: 13 Oct 2020 01:16 PM PDT

    I have about 1.5yrs of development under my belt. 9 months of which were in a real world job. I still feel pretty green and slow.

    I'm interested in getting experience with an open source project but I'm not even sure where to start looking, let alone finding something that's within my depth.

    Tips?

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

    [C++] Simple mergesort isn't working

    Posted: 13 Oct 2020 09:44 PM PDT

    I feel like an idiot because I can't get this simple mergesort working. I know how to do a mergesort with setting mid and such, but I have to copy this pseudocode from the textbook and this is as close as I've been able to get it. Any suggestions would be much appreciated.

    #include <iostream> #include <vector> #include <string> #include <fstream> using namespace std; vector <int> merge(int h, int m, vector <int> U, vector <int> V, vector <int> &S) { int i, j, k; i = 0; j = 0; k = 0; while (i < h && j < m) { if (U[i] < V[j]) { S[k] = U[i]; i++; } else { S[k] = V[j]; j++; } k++; } if (i > h) { for (int t = j; t < m; t++) { S[k] = V[t]; } } else { for (int t = i; t < h; t++) { S[k] = U[t]; } } return S; } void mergesort(int n, vector <int> &S) { if (n > 1) { int h = floor(n / 2), m = n - h; vector <int> U(h), V(n - h); for (int i = 0; i < h; i++) { U[i] = S[i]; } int q = 0; for (int i = h; i < n; i++) { V[q] = S[i]; q++; } mergesort(h, U); mergesort(m, V); merge(h, m, U, V, S); } } int main() { // Read in list from file string listInput; ifstream inputFile("p1data.txt"); vector <int> originalList; while (getline(inputFile, listInput)) { int numberVersion = stoi(listInput); originalList.push_back(numberVersion); cout << listInput << endl; } inputFile.close(); int originalListSize = originalList.size(); mergesort(originalListSize, originalList); for (int i = 0; i < originalList.size(); i++) { cout << originalList[i] << endl; } cout << "Done!" << endl; return 0; } 
    submitted by /u/Ninjinka
    [link] [comments]

    Want to learn to create website for articles and affiliate eventually for my twitter account

    Posted: 13 Oct 2020 09:34 PM PDT

    My twitter is growing and I want to write articles so that I can make people subscribe to newsletter via mail.

    Also write articles on the website.I have prior knowledge on coding,so syntax won't be an issue, what are the fastest and easiest tools so that I can create a beautiful website?

    You can suggest me courses for this please.

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

    [Java] Generating a random string with certain conditions

    Posted: 13 Oct 2020 05:23 PM PDT

    Hello all,

    I am currently working on a JavaFX project for school that serves as an extremely elementary password validation program. The conditions of a valid password is for it to contain at least ONE upper case letter, ONE lower case letter, and TWO digits/numbers.

    Along with having to verify whether user inputted passwords meet these conditions or not, the program must also have the ability to generate a valid password for the user at the click of the button.

    I have gotten the program to a point where users can generate a random string. However, I have been unable to get it to a point where the randomly generated string will have an upper case, a lower case, and two digits everytime.

    Here is my current code for the portion of the program pertaining to generating a password: https://drive.google.com/file/d/1V8V4Ia0ju6EgHNl6Yg2fHd32BRNztEOz/view?usp=sharing

    I've created a for loop that will go through each character of the generated string and count whether the character is upper case, lower case, or a digit. I've attempted to wrap this in a do while loop so that the program continuously generates strings until it produces one that meets the conditions however it does not seem to work as intended.

    I have very intermediate knowledge so any guidance will be genuinely and greatly appreciated.

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

    Make this c# class better! With collection initializers

    Posted: 13 Oct 2020 08:27 PM PDT

    Cross post with /learnprogramming

    I am trying to write a vector class that can be initialized like this

    Vector A = new Vector{1.0, -12, -3};

    Right now I have it working, but I have to use a temporary List<double> and then use the ToArray() to place it in the permanent array.

    The main reason is that the Add method for some reason is only able to take one parameter at a time. I know that I can write custom Add methods to take two, three or more parameters and this will work. What if I want it to take any number of parameters? Right now the method I am using works, but it is clunky. I was hoping that the use of params would have allowed all items inside the {} to be passed to the function, but for some reason it still only passes one.

    Functioning code is linked below. Help much appreciated!

    https://dotnetfiddle.net/zmZJcv

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

    Get currency symbol for exchange rate api

    Posted: 13 Oct 2020 08:14 PM PDT

    Is it possible to get the currency symbol from https://exchangeratesapi.io/ in javascript?

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

    I give up - segmentation faults & memory management

    Posted: 13 Oct 2020 07:55 PM PDT

    https://github.com/Ratstail91/Toy

    So I tried writing a dictionary system for my programming language, but testing it in isolation has turned out to be a nightmare.

    github's CI and my local machine are giving different log results, and I can't figure out what's wrong with realloc(). Any help is greatly appreciated.

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

    Scheme programming: Counting equal items in 2 lists

    Posted: 13 Oct 2020 07:35 PM PDT

    Hi, I'm very new to scheme and I'm having a hard time understanding how to make this work. I need to return a score based on how many elements at the same positions in 2 lists are the same. Heres an example:

    list1 (-1,0,1,1,0,1)

    list2 (-1,0,-1,1,-1,1)

    score = (3 - 1) = 2 (the score should be (#same - #different) in the same index, with 0 just being neutral)

    In Java I would just compare the first element, then do something like: countSame++; or countDiff++;

    then return countSame - countDiff;

    but as far as I know Scheme doesn't work like this. How do I save the counts? Or do I need to go about this in a different way?

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

    How do you delete an index from an array and then shift all of the values to the left by one? C++ Question

    Posted: 13 Oct 2020 06:58 PM PDT

    I've been trying to figure this out and I'm having a hard time, I can get one variable to go away but then I get a duplicate similar to the following:

    Original:

    1

    2

    3

    4

    5

    after code:

    1

    2

    3

    5

    5

    Like for example if I try to get rid of the 4th index it just copies the fifth, but I want the fifth element to move over and to equal zero.

    What I want:

    1

    2

    3

    5

    I wrote a for loop and I don't really understand what is going on, can someone point me in the right direction?

    `for (int i = num; i < 5; i++) {` `array[i - 1] = array[i];` `array[i] = array[i + 1];` 

    }

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

    Andriod App resources and IDE, using Java

    Posted: 13 Oct 2020 05:11 PM PDT

    Hey all, I'm still a little fresh into the Java world, about a year into my bachelors in software programming. As a side project I'm planning on making an android app that tracks bowling scores for the night, and the league and also can allow you to input what pins you hit and miss and tracks that. Essentially, a mock of pinpal app on andriod and Apple.

    My questions are resources for getting started as this will be my first official full program ill be writing.

    Secondly, I typically use NetBeans and love it but alot of people also recommend eclipse or andriod studio. Would love to hear your all input!

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

    Issue with C, program prints values that arent supposed to print

    Posted: 13 Oct 2020 04:17 PM PDT

    Hi! I've been trying to find an issue with this code for a few days but I still can't find it.The main problem here is that when printing the values of each node it tries to print an extra node and makes up new values.

    The code work the following way, for example: I put numbers 10,11,15 and if the sum of all three numbers of the node are major than 20 then it adds the double before so the result would be: 20,22,30 || 10,11,15.

    Every time I try to execute this code in Visual Studio Code the program prints: 20,22,30 || 10,11,15 || 0,26345856,301989906. As you can see the program tries to print another node that doesnt exist so it makes up values. I've tried on some online compilers and this isn't a problem so what I would like to know is if there is any error in my code or if it's the compiler.

    Thanks in advance!

    #include <stdio.h> #include <stdlib.h> typedef struct list{ int num; int num1; int num3; struct list *next; }node; void create (node *p){ printf("Input first number: "); scanf("%d",&p->num); if (p->num==0) p->next=NULL; else{ printf("Input second number: "); scanf("%d",&p->num1); printf("Input third number: "); scanf("%d",&p->num3); p->next=(node*)malloc(sizeof(node)); create (p->next); } } void show (node *p){ if (p->next !=NULL){ printf ("\n%d",p->num); printf ("\n%d",p->num1); printf ("\n%d",p->num3); show (p->next); } } node* add(node *p){ node *aux; if((p->num+p->num1+p->num3)>20){ aux=(node *)malloc(sizeof(node)); aux->num=p->num*2; aux->num1=p->num1*2; aux->num3=p->num3*2; aux->next=p; p=aux; } return p; } void add2 (node *p){ node *aux=NULL; while(p->next!=NULL){ if((p->next->num +p->next->num1+ p->next->num3)>20){ aux=(node *)malloc(sizeof(node)); aux->num=p->next->num*2; aux->num1=p->next->num1*2; aux->num3=p->next->num3*2; aux->next=p->next; p->next=aux; p=p->next; } p=p->next; } } int main(){ node *prin=NULL; prin=(node*)malloc(sizeof(node)); create(prin); printf("Input numbers were: "); show (prin); prin=add(prin); add2(prin->next); printf("\nList with added nodes: "); show(prin); } 
    submitted by /u/BlooodmaD
    [link] [comments]

    Program For Locating Duplicates based on Number of Copies

    Posted: 13 Oct 2020 02:33 PM PDT

    Is there a program out there that can index a folder for duplicate files, based on criteria like the number of duplicates? I.E. a search that would only return files that there were 3 or more duplicates of etc.

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

    Advice on website that uses data from .dbf

    Posted: 13 Oct 2020 01:39 PM PDT

    Hi I am wanting to make a website where our store's customers can enter their name and ID# and then the website will search our files for a match and display the account information for them. Our store has a database that keeps the data in a series of .dbf files. I'm wondering what would be the best way to be able to search and parse these files for a specific customers records. I can open the .dbf in libreoffice and convert it to an excel file, and then open that with php but I'm wondering if this is the best way? Would it be better to find a way to get it straight from the .dbf or to convert it to something other than a .xlsx, or if I should be using something other than php? I don't need the website to alter the data in anyway just search and display. Sorry if this is a dumb question.

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

    PsychoPy stimuli broken up with horizontal green lines

    Posted: 13 Oct 2020 01:15 PM PDT

    1

    I've just started using PsychoPy and I've tried to flip text, shapes, gratings, all of which appear broken up with green lines. Anyone know how to fix this?

    I'm using PyCharm with Python 3.8 and I get these error messages, not sure if related:

    C:\Users\ra150\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\media\codecs\wmf.py:838: UserWarning: [WinError -2147417850] Cannot change thread mode after it is set warnings.warn(str(err)) C:\Users\ra150\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\image\codecs\wic.py:292: UserWarning: [WinError -2147417850] Cannot change thread mode after it is set warnings.warn(str(err))

    I rolled back pyglet to version 1.4.10 and the error messages disappear but the green lines remain.

    Here is the image and code for the grating:

    https://imgur.com/a/c90T3gH

    import psychopy.visual import psychopy.event win = psychopy.visual.Window( size=[400,400], fullscr=False, units="pix") grating = psychopy.visual.GratingStim( win = win, units="pix", size=[150,150]) grating.draw() win.flip() psychopy.event.waitKeys() win.close() 
    submitted by /u/mar_mite
    [link] [comments]

    Help in setting up a project for react and laravel

    Posted: 13 Oct 2020 02:45 AM PDT

    Hello lads and laddies, I am here with a probably pretty dumb question. I have started to try to make a site with react.js and laravel and so I have followed this guide https://www.youtube.com/watch?v=UqcxmY9XTs4&ab_channel=DinoProgramming or blog http://dinocajic.blogspot.com/2020/01/laravel-6x-with-react-and-react-router.html, it looked good and logical but now im kinda stuck with routing, the app.blade.php is the thing that gets rended but the div i have in app.js does not want to render the simple line of text so i guess its not loading it properly, how could i set it up so that it connects properly and can start making seperate site pages with router

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

    Get JavaScript variable in Java

    Posted: 13 Oct 2020 12:15 PM PDT

    I have been making a small application to run on a raspberry pi I have lying around that will cache the menus of local restaurants and allow for searches by dish name. I originally planned on using the Zomato API, but the dailymenu API call does not seem to work outside of a few cities. I switched over to using HTMLUnit in Java to scrape the data off of the website and just place it into objects for the search to work on.

    The first piece of code I wrote just parsed the HTML to get all of the data. It worked fine for some menus, but stopped working when menus had multiple tabs (like this). I believe the page uses React to dynamically change the menu, and HTMLUnit can't seem to get the updated tab after the tab button is clicked programmatically to load the next part of the menu (the dessert menu in my example page).

    I just realized a few hours ago that there is a JSON object stored in window.__PRELOADED_STATE__ by a script that contains all of the menu data across all of the tabs. I tried to get this through HTMLUnit by using the executeJavaScript() function and just using the code string "return window.__PRELOADED_STATE__" in it, but the returned object is null. Is there something else I can try to get the contents of the window.__PRELOADED_STATE__ variable or some other library I can use to just quickly grab this string?

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

    Need help in making a roadmap to learning how to make this program

    Posted: 13 Oct 2020 09:40 AM PDT

    Hello everyone

    I recently got an idea to make a program which would help make course selection and future plans easier in my university.

    I want to make a website/program which has options to help students know which courses they can take if they give their course prerequisites.

    For example, there exist Major courses A, B and C with prerequisites P1, P2 and P3

    'A' requires P1 and P3,

    B requires P1 and P2,

    C requires none.

    The website (or app) I wish to create will list the prerequisites listed by category (eg. science, math, English) which the user can select and it will calculate all possible major courses which can be taken by a user.
    Continuing with the above example, if a user has P1 and P3 the system will show only Major courses A and C.

    Which language(s) should I learn for this? I've some experience in most languages, intermediate at best.
    (Edit: intermediate is a broad term. An example of my projects: I have made webscrapers to autofill school forms in python. Also made some basic 2012-style websites by myself on HTML.)

    I was looking at React along with HTML, not sure if it's the best way to go.

    What should I aim to learn? Are there any helpful resources? Consider me to have the basics of programming done, I just wish to move from all the programming theory and "classroom" things to actually making something and maybe helping others.

    Thanks in advance for reading, I'll be awaiting your replies!

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

    Coding interview: How would it go if I did the problem inside a class

    Posted: 13 Oct 2020 09:11 AM PDT

    I see a Leetcode medium problem starts me with a blank function definition for a question about int to roman numeral conversion;

    function intToRoman(num: number): string { }; 

    My main language is Typescript. Would it be bad if I wrote a series of helper functions or even a class and did most of the work there? I am comfortable with the orchestrator/helper pattern so would do something like this.

    class RomanNumeral { public convertToIntString(int: number): string { const isValid = this.validateInput(int); if (isValid === false) { return false; } const largestDigit = this.findlargestDigit(int); const rawRomanNumeral = this.rawConvert(largestDigit); const adjustedRN = this.convert4s(convert9s(rawRomanNumeral)); return String(adjustedRN); } private validateInput() {} private findlargestDigit() {} private rawConvert() {} private convert9s() {} private convert4s() {} } function intToRoman(num: number): string { const romanNumeral = new RomanNumeral(); return romanNumeral.convertToIntString(num); }; 

    As I spoke through it I'd mention that helper functions could do the same thing, and that I'm doing this for mental clarity and to aid single responsibility. I would also be personally more effective since I'm writing the solution in a manner i've worked in for a while.

    The argument against it is, the overhead of a class isn't needed. And the function skeleton suggests the interviewer is not going to expect this. I'm interested to hear your thoughts either way.

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

    Best coding language to create Spanish learning software? (PC)

    Posted: 13 Oct 2020 08:38 AM PDT

    I really love languages and would like to create my very own Spanish learning software. Which language would you (the coding pros) recommend for me to write this in? I need a place to store a bunch of images and audio files to use in multiple choice questions, etc. Basically a coding language that could access these image files and audio files quickly. Preferably a coding language for a beginner as well. PC.

    Thanks friends!

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

    How do you make downloadable files on your website?

    Posted: 13 Oct 2020 08:25 AM PDT

    Python Modules

    Posted: 13 Oct 2020 08:14 AM PDT

    Please someone tell me which is the best modules to learn to master python

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

    Need help understanding the difference between conventional programming, artificial intelligence and neural networks

    Posted: 13 Oct 2020 08:08 AM PDT

    I see a surprising amount of software coming up that refer themselves as either an AI or a neural network and I have a hard time grasping the differences of it in terms of programming.

    Lets take an example to make my (mis)understanding easier (please go hard on me because I could be entirely wrong on everything I say here). Let's say we have the use case of an automatic chat bot.

    Convential programming

    User Input -> Algorithm (ex: find response based on keywords) -> Answer

    Basically you are just providing logic that provides the desired result. I could check certain words or phrases from the user input and give it types such as introduction, question or ending and extend my answer logic based on those types. The answer is solely dependent on the algorithm provided from the developer.

    AI programming

    User Input -> Algorithm to create answers based on previous feedback data -> Answer

    Here I am already having trouble understanding. As far as my understanding goes AI requires some kind of sensor to detect the success rate of the answer to increasingly provide better results based on gathered data. But how does it know what answer has a higher rate of success (or satisfaction in this case)? I get it for games where the algorithm has a clear ruleset (definition) on what is success and what is failure for the AI to determine what it should work towards for. I don't quite get it how to detect human satisfaction unless you get direct feedback from the user which answer is good and bad. But then if you do that, you could do the same for conventional programming and just exclude answer strings that people didn't like. Is it already an AI then?

    Or do you provide a lot of input data from real chats and let it select an answer based of real world examples that you just continuously integrate? Is that an AI? Or just another algorithm as for conventional programming?

    Neural network

    User Input -> Hidden layers -> Answer

    This one I understand even less. All I'm getting from articles is that the architecture is build in a way neurochemistry in our brain works. So if someone say's hello, I'm gonna give an answer based on different evaluations of hello in terms of readability, understandability, hostility,... and give an answer based on what combination of words matches with which answer? But then again, I guess that ties directly into AI, leading me to the same question again on how to determine the best result of some of those evaluations. I guess it's all based on feedback data that has to be given manually (on what is interpreted understandable or hostile as example)?

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

    No comments:

    Post a Comment