• Breaking News

    Friday, May 28, 2021

    How to teach students programming? Ask Programming

    AskProgramming

    How to teach students programming? Ask Programming


    How to teach students programming?

    Posted: 28 May 2021 09:31 AM PDT

    Hi, I am currently working on my bachelor thesis and would like to work on the following topic:

    How can we teach programming to students regardless of their age.

    I've already found out about solutions like "Scratch" but I don't think that's the optimal solution. I am thinking of a solution in which you can give commands to a robot or something similar by painting characters.

    Maybe someone here already has experience with it or an exciting solution.

    Thank you!

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

    Does there exist an code editor that can show particular selected execution paths only?

    Posted: 28 May 2021 01:00 PM PDT

    This is a bit of a weird question, not really sure what to call this sort of feature (actually not sure if it exists). Currently, I'm working on some spaghetti code, and for the purposes of this question let's assume that's an unsolvable problem. We have a function that takes in a bunch of configuration options and then does everything.

    What I'd like is an editor where you can poke, say, an 'if' and say "show me what the code would look like if we knew that one branch of this conditional was used, and we threw away the other one." Extra credit if the condition could be tied to the variables rather than the conditionals (show me the code if this config flag was set to 'true'). ExtraExtra credit if it could evaluate things like flag1 && flag2.

    Do tools like this exist? It seems like a stretch, but I come from vim-land where everything is just text... I know the IDE guys have all sorts of cool toys...

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

    Should I use my tablet?

    Posted: 28 May 2021 07:32 AM PDT

    Hello!! I am very new to programming but I have a problem, I don't have a computer. Well, I kinda do but let's just say it's unusable. I can't get a new one as I am 16 and don't have a way to make money yet, but I do have this amazing tablet. It is a Samsung s6 lite, and it's the best tablet I've ever owned (maybe because the rest of them were cheap but lmao) I have a cute keyboard that use for it as well when I am writing my short stories. Any advice?

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

    Extend Monitor display in WPF

    Posted: 28 May 2021 09:38 PM PDT

    Hi, as I mentioned I want to extend my WPF UI to another screen. When user click the extend monitor button, the UI content will be extended. Is there any ways to solve it?

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

    Distributed Databases for Social Media like apps

    Posted: 28 May 2021 08:53 PM PDT

    I was honestly getting fed up with censorship on major social media platforms and I was thinking would it be possible to create some sort of distributed database that can be used to store data for a social media app (I didnt really think that blockchains would work as they keep all the data and this would take up too much storage especially for the use of social media apps). What i was considering was something similar to bittorrent where the followers of a certain influencer would help store the influencers data in order for users to be able to access this data even if the person who posted it is offline. I do realize that this idea isnt perfect so I was hoping someone here with more experience would be able to give me some advice on how this could be improved upon. Thanks.

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

    Safe running multiple programming langs on a same PC?

    Posted: 28 May 2021 01:57 PM PDT

    Hello all,

    I have been a sole Python user for awhile, and I was just wondering if it is safe for a machine to run both Java and Python? Would it cause the PC to malfunction, cause error, etc.

    (Planning to use Eclipse IDE, and been using PyCharm for Python)

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

    Frontend / Backend synchronisation problem

    Posted: 28 May 2021 02:34 PM PDT

    Let's say in your frontend user interface, the user interacts with an object (json object) and you need that object to always be in sync with the backend object (stored in the DB)

    A straighforward answer would be that whenever the user does a change to that object you have to call your API backend to save it.

    But then:

    How do you handle the case when saving the object fails? When that happens, the UI and backend are no longer in sync since the change already happened in the UI but not committed to the database.

    How do you handle the case where the save doesn't just store the object as it is coming from the frontend but needs to do some modifications to it? When that happens, the changes made in the backend are not in sync with what the user sees in the frontend.

    Considered solution:

    Have the backend return the object as it is in the database when the save succeeds or fails so that the UI can use that value to revert back the UI state in case of failure or update the UI in case of success.

    But this just does sound very clean to me, in case of failure returning the full object doesnt sound like good practice in addition to having to return message errors. And in case of success it feels overkill to have to rerender the whole UI using the updated object whenever a change is made.

    Are there any better solutions you've used or came accross in the past?

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

    Question about Fast Inverse Square Root

    Posted: 28 May 2021 03:32 PM PDT

    If the exponent is odd (has a 1 in its rightmost digit), shouldn't the bit shift move that bit into the mantissa? Why doesn't that mess up the calculation?

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

    I need a program that would show me the ratings of typed-in movies

    Posted: 28 May 2021 11:45 AM PDT

    If there's a better subreddit for this question, please direct me to it.

    My problem is that the only website that shows all movies that play in all cinemas in my country is movies.ch. It's a tiny country so I'm more than willing to spend like 1h to travel through half the country to see a great movie.

    Especially now that there are no movies coming out there are a lot of older movies (for example I've recently seen movies like Goldfinger or The Good, the Bad and the Ugly in cinemas and going to see Pulp Fiction this week). There are and will be some older gems I don't recognize by name and I don't wanna miss them.

    What I need is a program that would let me paste all of the movies' names and rank them by RT audience score and IMDb score

    If anyone's willing to do that please say how much you'd need for it.

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

    Up-to-date tutorial (video or blog) on how to build a video chat app with Twilio?

    Posted: 28 May 2021 03:05 PM PDT

    I've found a few videos on youtube and blog posts on twilio's website, but most from 2020 or before.

    I am specifically looking for a React + Twilio app but could be without React if the code is easily transferrable.

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

    Place for high-quality computer-related posters?

    Posted: 28 May 2021 02:51 PM PDT

    Anything SGI, Cray, computer graphics, vintage, would be cool.

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

    ModuleNotFoundError, even though import is working fine

    Posted: 28 May 2021 11:33 AM PDT

    I'm currently using Python Crash Course and it has been a few days that I'm stuck at chapter 15 on the die example, because of this error. Here's the program I'm trying to run:

    from random import randint from plotly.graph_objs import Bar, Layout from plotly import offline class Die: def __init__(self, num_sides = 6): self.num_sides = num_sides def roll(self): return randint(1, self.num_sides) die = Die() results = [] for roll_num in range(1000): result = die.roll() results.append(result) frequencies = [] for value in range (1, die.num_sides+1): frequency = results.count(value) frequencies.append(frequency) x_values = list(range(1, die.num_sides+1)) data = [Bar(x = x_values, y = frequencies)] x_axis_config = {'title': 'Result'} y_axis_config = {'title': 'Frequency of Result'} my_layout = Layout(title = 'Results of rolling one D6 1000 times', xaxis = x_axis_config, yaxis = y_axis_config) offline.plot({'data': data, 'layout': my_layout}, filename = 'd6.html') 

    Which I copied exactly as the same as the book. It works just fine until the part where I use plotly. It then gives this rather big error:

    Traceback (most recent call last): File "c:\Users\Luan\Documents\automate\Python Crash Course\15 die.py", line 33, in <module> offline.plot({'data': data, 'layout': my_layout}, filename = 'd6.html') File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\offline\offline.py", line 586, in plot pio.write_html( File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\io\_html.py", line 508, in write_html html_str = to_html( File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\io\_html.py", line 131, in to_html fig_dict = validate_coerce_fig_to_dict(fig, validate) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\io\_utils.py", line 15, in validate_coerce_fig_to_dict fig_dict = plotly.graph_objs.Figure(fig).to_plotly_json() File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\graph_objs\_figure.py", line 596, in __init__ super(Figure, self).__init__(data, layout, frames, skip_invalid, **kwargs) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\basedatatypes.py", line 559, in __init__ self._layout_obj = self._layout_validator.validate_coerce( File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\_plotly_utils\basevalidators.py", line 2450, in validate_coerce v = self.data_class(v, skip_invalid=skip_invalid, _validate=_validate) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\graph_objs\_layout.py", line 6242, in __init__ self["template"] = _v File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\basedatatypes.py", line 5806, in __setitem__ super(BaseLayoutHierarchyType, self).__setitem__(prop, value) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\basedatatypes.py", line 4796, in __setitem__ self._set_compound_prop(prop, value) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\basedatatypes.py", line 5207, in _set_compound_prop val = validator.validate_coerce(val, skip_invalid=self._skip_invalid) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\_plotly_utils\basevalidators.py", line 2743, in validate_coerce return super(BaseTemplateValidator, self).validate_coerce( File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\_plotly_utils\basevalidators.py", line 2450, in validate_coerce v = self.data_class(v, skip_invalid=skip_invalid, _validate=_validate) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\graph_objs\layout\_template.py", line 319, in __init__ self["data"] = _v File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\basedatatypes.py", line 4796, in __setitem__ self._set_compound_prop(prop, value) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\basedatatypes.py", line 5207, in _set_compound_prop val = validator.validate_coerce(val, skip_invalid=self._skip_invalid) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\_plotly_utils\basevalidators.py", line 2450, in validate_coerce v = self.data_class(v, skip_invalid=skip_invalid, _validate=_validate) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\graph_objs\layout\template\_data.py", line 1653, in __init__ self["scattercarpet"] = _v File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\basedatatypes.py", line 4800, in __setitem__ self._set_array_prop(prop, value) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\basedatatypes.py", line 5281, in _set_array_prop val = validator.validate_coerce(val, skip_invalid=self._skip_invalid) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\_plotly_utils\basevalidators.py", line 2542, in validate_coerce res.append(self.data_class(v_el, skip_invalid=skip_invalid)) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\graph_objs\_scattercarpet.py", line 2072, in __init__ self["marker"] = _v File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\basedatatypes.py", line 4792, in __setitem__ validator = self._get_validator(prop) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\basedatatypes.py", line 4274, in _get_validator return ValidatorCache.get_validator(self._path_str, prop) File "C:\Users\Luan\AppData\Roaming\Python\Python39\site-packages\plotly\validator_cache.py", line 29, in get_validator importlib.import_module("plotly.validators." + parent_path), File "C:\Users\Luan\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked ModuleNotFoundError: No module named 'plotly.validators.scattercarpet' 

    I searched everywhere on troubleshooting the ModuleNotFoundError but still couldn't solve it, what am I doing wrong here?

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

    How do you handle sensitive data when uploading things to GitHub?

    Posted: 28 May 2021 11:22 AM PDT

    I have some sensitive info like API keys in an .env file and I don't want to upload the .env file to GitHub so that no one steals my keys. So what's the best way to handle this if I still want to share my project with people?

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

    App with map of a specific city

    Posted: 28 May 2021 07:20 AM PDT

    Hey guys! I'm making an app for a friend, he wants an app that will take a location input (street name, postal code, etc.), this location being a fire, a code for the type of fire input and will output which fire station will respond. No need to have an actual map drawn on the screen. As long as it outputs the right station with the right units that will respond, it's good. However, I don't know which language to write this in. At first i thought python, but i didn't find much useful libraries to help me with all the geographical stuff. Then i thought about Java, but I didn't have much success finding any libraries that will help me with all the map mechanics i need. So a friend suggested I learned JavaScript for this app. What do you guys think?

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

    What's the best way to let unexperienced users modify a page on a website?

    Posted: 28 May 2021 03:31 AM PDT

    Just started my first internship and I have to do some work on the association's site. One problem that was mentioned to me was the way pages were modified : pages with content that regularly changes need to be modified through a .ini file containing HTML-formatted text spread across multiple... containers? variables? in a very unintuitive way. The person who has to do this is not at all experienced with this stuff and it's a bother for her.

    My first thought was to instead parse XML for the content and generate that XML through an easy-to-use tool, either from the site or a desktop app; but my lack of experience makes me wonder if that's the only solution. Is there a 'right' way to achieve this?

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

    SVG: Why does <text> elements appear in the browsers but not in image viewers

    Posted: 28 May 2021 12:05 AM PDT

    I have asked this question on StackOverflow, but it seems unlikely that I'm going to get an answer.


    I am trying to render a chart but encounter a problem: The <text> elements appear in browsers (Chrome, Firefox) but not in traditional image viewers (Eyes of GNOME, GIMP, Inkscape).

    Code

    Image

    At first, I thought that it was because image viewers are incapable of rendering fonts, until I came across an asciinema's thumbnail, which is displayed perfectly by Eyes of GNOME.

    Question: Why does this happen and how to fix this?

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

    How to really fix undefined reference to `newuser::inputusername()''? I'm pretty sure I linked them correctly.

    Posted: 27 May 2021 10:38 PM PDT

    makefile

    CC = g++ TARGET1 = 1 TARGET2 = 2 TARGET3 = 3 TARGET4 = TwoD TARGET5 = newuser FLAG = -std=c++11 all: $(TARGET1).cpp $(TARGET2).cpp $(TARGET3).cpp $(TARGET4).cpp $(TARGET5).cpp $(CC) $(FLAG) -c $(TARGET1).cpp $(TARGET2).cpp $(TARGET3).cpp $(TARGET4).cpp $(TARGET5).cpp $(CC) $(FLAG) -o $(TARGET1) $(TARGET1).o $(CC) $(FLAG) -o $(TARGET2) $(TARGET2).o $(TARGET4).o $(CC) $(FLAG) -o $(TARGET3) $(TARGET3).o $(TARGET5).o #$(CC) $(FLAG) -o $(TARGET4) $(TARGET4).o clean: rm -f $(TARGET1) $(TARGET2) $(TARGET3) rm -f $(TARGET1).o $(TARGET2).o $(TARGET3).o $(TARGET4).o $(TARGET5).o 

    only use TARGET3 AND TARGET5

    newuser.h

    #include<iostream> using namespace std; #ifndef NEWUSER_H #define NEWUSER_H namespace newuser{ string username; string password; void inputusername(); void inputpassword(); string getusername(); string getpassword(); } 
    

    No comments:

    Post a Comment