FAQ Database Discussion Community


How to improve redundancy in HTML and ROR with partials?

html,ruby-on-rails,redundancy
I have these 2 partials written for my Ruby on Rails application. Is there any clever way two merge them into one? Copy pasting one partial into the other is not allowed What I would like to have is something like this: @member = 'Player' render 'team/team_partial' @member = 'Staff'...

How to measure redundancy in code bases?

architecture,software-engineering,software-design,redundancy,entropy
I inherited a medium-sized code base, whose only programming paradigm appears to have been Copy&Paste. There are literally dozens of code snippets that could be easily parametrized and replaced by a simple function call. The code isn't mission-critical, as it's "only" testing code. Nevertheless this makes it a pain to...

How to use code from one class in another? (Java)

java,redundancy,extending
I'm making a tank game and to avoid redundancy I'm making classes to extend. My MenuPanel looks like this atm (I've only written the code that matters for the question) (knop = dutch for button) public class MenuPanel extends JPanel implements ActionListener { private JButton playKnop, highScoreKnop, quitKnop, HTPKnop; private...

Efficient Three “Ships”, One Message Algorithm

algorithm,cryptography,redundancy,information-theory
The premise is that person 1 wants to send a secret message M (without key sharing) across the ocean to person 2. She decides to send partial messages via 3 ships such than if any two ships' versions get delivered person 2 can construct the complete original message. The goal...

how to use a class in multiple panels

java,jbutton,redundancy
i'm making a tank game. to avoid redundancy to make my buttons in the menupanel i wrote a class button: package menu; import java.awt.Image; import java.awt.event.ActionListener; import javax.swing.ImageIcon; import javax.swing.JButton; public class Button extends JButton{ public JButton button; public ImageIcon buttonImage; public int x, width, height; public String backgroundPath; public...

Isn't this data redundancy in android databases?

android,database,sqlite,redundancy
I am learning about databases in android and I realized that in android it's not like that you create your database and put it somewhere in memory and get access to it, rather you create and put data within the app. I learned a way to create my SQlite DB...

Enumerate all controls in a form (redundant)

vb.net,ienumerable,redundancy
I'm trying to enumerate all the controls in a form that satisfy a certain condition like the code beelow Public Enum MethodSeachEnum StartsWith = 1 EndsWith = 2 Contains = 3 End Enum Public Function GetAllControls(Control As Control, Key As String, MethodSeach As MethodSeachEnum, ControlType As Type, Optional UseTag As...

Isn't the line QProcess *p redundant?

c++,qt,qprocess,redundancy,qt5.4
I've stumbled across this GitHub Project. While I don't agree with the code in general I can't wrap my mind about the line: QProcess *p; and p=*it; Am I wrong when I feel like creating a new pointer there is completely redundant or is there some purpose of it I'm...

Redundant data while hibernate mapping many to one

java,mysql,hibernate,many-to-one,redundancy
I have 2 tables: Trip and Place (Many-To-One) and my problem is that when I add 2 trips with different data but the same place, it adds me 2 records to Trip table and 2 records into Place table, while it should add just one record into Place. For example...

getting rid of redundant code between html pages [closed]

html,css,database,performance,redundancy
So I'm working on producing my own version of a web/db project my friend was given in school. This is my first project in either area and I'm still learning. Part of the project description mentions all of the pages the client wants. I'm solving this by making an unordered...