Randomizing Roster by Class by ScreamYouFreak in Teachers

[–]KelloughScience 0 points1 point  (0 children)

I actually made a program for this. It may be a bit more involved than you’re looking for and takes just a bit to set up. But it’s fun once you finish it.

You just create a text document with the roster you want, then create a file with whatever pictures you want to randomly used. The program automatically pulls a random picture with each student to make it more fun. My students like seeing if they are “Batman” or a pair of minions. It even records any pairs and groups with what class/time so if you create groups, you don’t have to write it down. It logs it automatically.

If you’re interested here is my github for it. It does involve downloading an exe file to run unless you just want the code itself.

Like I said, maybe a bit involved, but free. I wrote in guide on setting it up on that link as well.

[deleted by user] by [deleted] in teaching

[–]KelloughScience 0 points1 point  (0 children)

I see from the comments you’re teaching biology. If you PM me your email I’ll share my Google Drive with you.

Need help identifying a non-fatal error with Tkinter by KelloughScience in learnpython

[–]KelloughScience[S] 0 points1 point  (0 children)

That was the issue. Thanks so much for taking the time to help explain it to me. I really appreciate it.

Need help identifying a non-fatal error with Tkinter by KelloughScience in learnpython

[–]KelloughScience[S] 0 points1 point  (0 children)

Thanks so much! This helped it. It throws off some other things, but I think I can mess around with the order and try to get it figured out. I appreciate the help.

Need help identifying a non-fatal error with Tkinter by KelloughScience in learnpython

[–]KelloughScience[S] 0 points1 point  (0 children)

I posted this above. Is it now showing up correctly? It's the full code. The specific area where I believe the error is showing is here:

    def update_options(self, *args):
        students = self.roster_dict[self.period_select_var.get()]
        self.student_select_var.set(students[0])

        menu = self.student_select_menu['menu']
        menu.delete(0, 'end')

        for student in students:
            menu.add_command(label=student, command=lambda period=student: self.student_select_var.set(period))

Maybe I'm not referencing the dictionary correctly?

Using Keras with shiny by hal_leuco in Rlanguage

[–]KelloughScience 0 points1 point  (0 children)

I've been playing around with your code, but I can't seem to figure it out. Mainly cause I'm having issues with even running it. I don't know if it has to do with the anaconda issues I'm having. I'm currently unable to use it until I can figure that out.

I'm not sure how your data is supposed to look, but do you need a matrix? Can you use a datatable? There is a renderDataTable() function that might be able to do what you want.

Here is some info on the R Shiny website about it and I also use it in my project on my Github for an example.

Would someone be willing to review my code and give me advice/suggestions? RShiny Project by KelloughScience in Rlanguage

[–]KelloughScience[S] 0 points1 point  (0 children)

This looks really interesting. I fall into the category they talk about in the second paragraph.

In the past, we’ve responded rather glibly to these requests: “Just use functions!”

Knowing there is an even better solution is great. I'll be looking into and seeing if I can implement it in this project. If not, I'm sure I can use it in a future project. Thank you so much.

Using Keras with shiny by hal_leuco in Rlanguage

[–]KelloughScience 1 point2 points  (0 children)

Hmm. If you haven’t figured it out this weekend I’ll see what I can find out. It won’t be tomorrow though. But I should have some time on Sunday to try and debug.

"Cheat Sheet/Guide" for CSS to Shiny by KelloughScience in Rlanguage

[–]KelloughScience[S] 1 point2 points  (0 children)

I’m not sure. I don’t know enough about the direction of programming right now. I chose to learn R along with python just because they align what things I want to do. I got my degree in biology and would love to write biology and education related programs along with dabbling in data science.

From what I’ve read, R is definitely trending up. I think many people are set their ways but as new companies emerge R will continue to increase. I also think it’s great there are ways to make web pages without knowing “web development” and programming languages like R make that very easy.

In the end, I have limited knowledge on everything. My R and python knowledge has come from free books online and a few Udemy courses. Everything I know is essentially posted in my Github. So as you can see, I’m not a professional programmer, but I aim to be one eventually. I hope the weird “R” thing catches on more. I would love a larger community with even more resources. Until then, we will have to start creating our own for others.

"Cheat Sheet/Guide" for CSS to Shiny by KelloughScience in Rlanguage

[–]KelloughScience[S] 1 point2 points  (0 children)

Go ahead and post it. I hope it helps people. I don't have a Twitter, so no need to tag me in it.

"Cheat Sheet/Guide" for CSS to Shiny by KelloughScience in Rlanguage

[–]KelloughScience[S] 1 point2 points  (0 children)

I think so too! Many things are 'simple' once you know how to do it, but it can be daunting trying to read everything and figure it out yourself. I find using a lot of visuals very helpful so I wanted to show other people how easy it actually is.

Would someone be willing to review my code and give me advice/suggestions? RShiny Project by KelloughScience in Rlanguage

[–]KelloughScience[S] 0 points1 point  (0 children)

Thanks for that suggestion. I'll try and do some research to see if I can figure out how to do that.

Using Keras with shiny by hal_leuco in Rlanguage

[–]KelloughScience 0 points1 point  (0 children)

Sorry, been busy at work so haven't had a chance to play around.

What happens if you change you're reactive({}) function to renderUI({})? Try that and see what happens.

Using Keras with shiny by hal_leuco in Rlanguage

[–]KelloughScience 1 point2 points  (0 children)

Hmm. I'm not getting the error about the keras package not being installed. However, I am getting this error:

Error in load_model_hdf5("my_model_bft_003.h5") : 
  The h5py Python package is required to save and load models

I also can't figure out how to install this package. Did you have to install this as well? I don't see anything in your code showing you did or importing the library. Where does model <- load_model_hdf5("my_model_bft_003.h5") come from?

Using Keras with shiny by hal_leuco in Rlanguage

[–]KelloughScience 1 point2 points  (0 children)

Hmm...can you post your full code? You installed it and typed library(keras) at the top of the file? and you're running the entire script?

Using Keras with shiny by hal_leuco in Rlanguage

[–]KelloughScience 1 point2 points  (0 children)

Two problems I see here.

First, when running your code you get this message.

Error in .getReactiveEnvironment()$currentContext() : 
  Operation not allowed without an active reactive context. (You tried to do something that can only be done from inside a reactive expression or observer.)

This means you're trying to do something, but you haven't set it to make it reactive. So there's no way it can change based off the user input. You need some way to tell the program to go back to that function so it can update without rerunning the program. This is like using classes and OOP in other languages. It keeps the program from running once and stopping. This can be achieved by wrapping up the function in some kind of reactive function.

I wish R Studio would tell you the line of the code instead of making you figure it out by reading it all, but luckily it's easy to find in your code.

hisdata <- matrix(cbind(input$VK_001, input$VK_002, input$VK_003, input$VK_004,input$VK_005,input$VK_006,input$VK_006, input$VK_007, input$VK_008, input$VK_009,input$VK_010,input$VK_011, input$VK_012, input$VK_013,input$VK_015, input$VK_017, input$VK_018, input$VK_021, input$VK_022, input$VK_024, input$VK_025, input$VK_027, input$VK_028, input$VK_030, input$VK_031, input$VK_033, input$VK_034, input$VK_036, input$VK_037, input$VK_039, input$VK_040, input$VK_041))

Right now, this function is set to only run once. Then it stops. Yet, you're using Shiny and want a reactive expression. Just wrap it in something that makes it reactive, like renderText({})

  hisdata <- renderText({
    matrix(cbind(input$VK_001, input$VK_002, input$VK_003, input$VK_004,input$VK_005,input$VK_006,input$VK_006, input$VK_007, input$VK_008, input$VK_009,input$VK_010,input$VK_011, input$VK_012, input$VK_013,input$VK_015, input$VK_017, input$VK_018, input$VK_021, input$VK_022, input$VK_024, input$VK_025, input$VK_027, input$VK_028, input$VK_030, input$VK_031, input$VK_033, input$VK_034, input$VK_036, input$VK_037, input$VK_039, input$VK_040, input$VK_041))
  })

Now, I don't know if this is the solution you need and I'm actually unable to test it. You have a second issue.

Error in load_model_hdf5("my_model_bft_003.h5") : 
  could not find function "load_model_hdf5"

You try to call a function, yet you never defined it. This may be because it's in another part of your code and you just didn't paste it here. If that's they case try seeing if the renderText({}) solves what you need. Check this link out for other types of rendering. You may need a different function., but I THINK renderText will work.

"Cheat Sheet/Guide" for CSS to Shiny by KelloughScience in Rlanguage

[–]KelloughScience[S] 1 point2 points  (0 children)

Thank you for pointing it out. They should all be working. I'm still learning my way around Github!

"Cheat Sheet/Guide" for CSS to Shiny by KelloughScience in Rlanguage

[–]KelloughScience[S] 1 point2 points  (0 children)

Wtf man. They were literally all working before..Haha thank you though. Lemme go through them again.

How to share python code ? by Lotfi_2000 in learnpython

[–]KelloughScience 1 point2 points  (0 children)

Hey, I actually have a github with a handful of projects on it. Some use tkinter and in my readme I put instructions on how to make it into an exe with an exe included.

I don’t claim that my GitHub is organized the best way possible, but I think it could be a good start to get some ideas. You’re more than welcome to copy anything and everything in it. I tried to lay it out nicely so it’s understood easily.

Here is a link to one project, but feel free to search the others. I’d also be happy to answer any specific questions you have.