Need suggestion in method to use

Greeting.
I'm doing data mining stuff and the data look like this:
a     c
1     1
2     1
3     1
7     1
8     1
6     2
7     2
8     2
9     2
10     2This data will be the input. I need to calculate a 'split-point' in 'a' according to class 'c' i.e. 1 and 2. I wanna group 'a' into two class. Let say after calculation the split point is 8, then output will be {1,2,3,6,7,8} and {9,10} for 'a' means 1,2,3,6,7 and 8 will become {1,2,3,6,7,8}
First I need to sort 'a'. 'a' and 'c' are parallel. And then I need to calculate probability of 'c' for a point let say 8, number <=8 that is '1' in 'c'. In this case will be 5/8.
This is some description.
My problem is: Which way will be easier to do this? Using what kind of input? (excel, txt, csv) ?
How to get start?
Edited by: Raiko on Apr 26, 2010 9:18 PM
Edited by: Raiko on Apr 26, 2010 9:20 PM
Edited by: Raiko on Apr 26, 2010 9:23 PM

Raiko wrote:
This data will be the input. I need to calculate a 'split-point' in 'a' according to class 'c' i.e. 1 and 2. I wanna group 'a' into two class. Let say after calculation the split point is 8, then output will be {1,2,3,6,7,8} and {9,10} for 'a' means 1,2,3,6,7 and 8 will become {1,2,3,6,7,8}Sorry, but your description, coupled with the data you supplied, makes no sense to me.
How are you supposed to "split" column a according to 'c', when the values 7 and 8 appear for both 'c' values?
More description please.
My problem is: Which way will be easier to do this? Using what kind of input? (excel, txt, csv) ?I'd start with .txt. Mind you, I still don't understand the requirements...
Winston

Similar Messages

  • Need suggestion in getting data using JDBC

    Hi all need suggestion,
         i had a VO corresponding to database table.
         when i am try to get the records from that table,
         how can i initialize the particular column value to the
         corresponding VO setter method.
         please do the needful.

    Hello inform2csr,
    Your question is not so clear.
    Can you be more precise?
    What is VO?

  • Need suggestion regarding Layout Manager using Swing in Java

    I have developed a swing application where i am having problem with selecting the right layout manager.
    I am attaching the file where it contains the method for addingComponents to the Content Pane. But, the code that i have written
    contains lot of spaces between first panel and second panel and so forth.
    Please suggest.
    <<Code>>
    public void addComponentsToPane(Container contentPane) {
              this.contentPane = contentPane;
    //          File Panel
              JPanel jfile1panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              JPanel jfile2panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              JPanel jfile3panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              JLabel jfile1 = new JLabel("Select File:");
              jtfile1 = new JTextField(50);
              jbfile1 = new JButton("Button1");
              jfile1panel.add(jfile1);
              jfile1panel.add(jtfile1);
              jfile1panel.add(jbfile1);
              jbfile1.addActionListener(this);
              JLabel jfile2 = new JLabel("Select File:");
              jtfile2 = new JTextField(50);
              jbfile2 = new JButton("Button2");
              jfile2panel.add(jfile2);
              jfile2panel.add(jtfile2);
              jfile2panel.add(jbfile2);
              jbfile2.addActionListener(this);
              JLabel jfile3 = new JLabel("Select File:");
              jtfile3 = new JTextField(50);
              jbfile3 = new JButton("Button3");
              jfile3panel.add(jfile3);
              jfile3panel.add(jtfile3);
              jfile3panel.add(jbfile3);
              jbfile3.addActionListener(this);
              //Button Panel
              JPanel jbuttonpanel = new JPanel();
              jbuttonpanel.setLayout(new FlowLayout(FlowLayout.CENTER));
              JButton jbcmd1 = new JButton("Submit");
              JButton jbcmd2 = new JButton("Cancel");
              jbuttonpanel.add(jbcmd1);
              jbuttonpanel.add(jbcmd2);
              jbcmd1.addActionListener(this);
              jbcmd2.addActionListener(this);
              //Content Pane               
              contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
              contentPane.add(jfile1panel);
              contentPane.add(jfile2panel);
              contentPane.add(jfile3panel);
              contentPane.add(jbuttonpanel);
    }

    But, the code that i have written contains lot of spaces between first panel and second panel and so forth.use pack(), see if it makes a difference
    as you're using FlowLayout, make the frame not resizable

  • Need suggestion on Multi currency and Unicode character set use in ABAP

    Hi All,
    Need suggestion. In one of the requirement I saw 'multi-currency and Unicode character set experience in FICO'.
    Can you please elaborate me how ABAPers are invlolved in multi currency as I think this is FICO fuctional area.
    And also what is Unicode character set exp.? Please give me some document of you have any.
    Thanks
    Sreedevi
    Moderator message - This isn't the place to prepare for interviews - thread locked
    Edited by: Rob Burbank on Sep 17, 2009 4:45 PM

    Use the default parser.
    By default, WebLogic Server is configured to use the default parser and transformer to parse and transform XML documents. The default parser and transformer are those included in the JDK 5.0.
    The built-in WebLogic Server DOM factory implementation class is com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl.
    The DocumentBuilderFactory.newInstance method returns the built-in parser.
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

  • I want to set up the Time Machine and I would love to use the Time  Capsule but since I already have a wireless router I need suggestions on  what other external disks Apple could recommend to use with the Time Machine and  how to configure that disk

    I want to set up the Time Machine and I would love to use the Time
    Capsule but since I already have a wireless router I need suggestions on
    what other
    external disks Apple could recommend to use with the Time Machine and
    how to configure that disk.
    A complication that I need to resolve is the fact that I am using Vmware
    Fusion to be able to use Windows on my Mac. Now it seems that Time
    Machine is not backing up my files
    on that virtual Windows without additional configuration and my question
    is whether you can advise me here or whether this is only a matter for
    the Fusion virtual machine.

    If you want to use Time Capsule you can.. you simply bridge it and plug it into the existing router.. wireless can be either turned off or used to reinforce the existing wireless.. eg use 5ghz in the TC which is much faster than your 2.4ghz.
    You can also use a NAS.. many brands available but the top brands are synology, qnap and netgear readynas  series. These will all do Time Machine backups although how well always depends on Apple sticking to a standard. There are cheaper ones.. I bought a single disk zyxel which was rebadged and sold through my local supermarket. It actually works very well for TM at least on Snow Leopard. Major changes were made in Lion and again ML so do not instantly think it will work on later versions. I haven't tried it yet with those versions.
    Any external drive can be plugged into the mac. Use the one with the fastest connection or cheapest price according to your budget. USB2 drives are cheap and plentiful. But no where near as fast as USB3 or FW800. So just pick whichever suits the ports on your Mac. Interesting Apple finally moved to USB3 on their latest computers.
    TM should exclude the VM partition file.. it is useless backing it up from Mac OS side.. and will slow TM as it needs to backup that partition everyday for no purpose.. TM cannot see the files inside it to backup just the changes.
    You need to backup windows from windows. Use MSbackup to external drive.. if you have pro or ultimate versions you can backup to network drive. But MSbackup is a dog.. at least until the latest version it cannot restore the partition without first loading windows. There are about a zillion backup software versions for windows.. look up reviews and buy one which works for you. I use a free one Macrium Reflect which does full disk backups and is easy to restore.. to do incremental backups though you have to pay for it.

  • Need suggestion whether to use ATM or MPLS in DSL implementation

    Presently i am working in ISP, and we are providing internet access via simple dialup, ISDN and IVS. and now we want to implement DSL i ve talk with few peoples regarding whether to use ATM or MPLS in DSL implementation but because they are solution providers so i think they are giving me expensive solution. as long as i know about this is,whole world is shifting from ATM to MPLS Technology. ATM implementation cost is very high. so i need suggestion from u because you also have practical exposure.

    I believe ATM is soon getting obsolete...

  • I need to move the iTunes library to an External Hard Drive to free up space on iMac.  Need suggestions on type of External Hard Drive to use.  A Multimedia Hard Drive like LaCie LaCinema Classic HD Multimedia Hard Drive OR a Large Desktop Hard Drive?

    I need to move an iTunes library to an External Hard Drive to free up space on iMac.  I Need suggestions on type of External Hard Drive to use.  Should you use a Multimedia Hard Drive like LaCie LaCinema Classic HD Multimedia Hard Drive OR a standard Large Desktop Hard Drive like Western Digital/Seagate/LaCie?

    There is no benefit to the multi-media feature on the first drive you mentioned. If you are going to look at differences between certain drives, I'd look at the differences in reliability first.

  • I have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    i have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    Using those instructions you may also be able to select PayPal if that is allowed in your country.

  • Can any one suggest me how to use drawPixels method for 40 series devices

    Hello!
    I am using drawPixels method of DirectGraphics class the code I have written is :-
    Image offscreen=DirectUtils.createImage(width,height,0x00000000);// width and heights are integer value
    public final int MODEL=DirectGraphics.TYPE_INT_8888_ARGB ;
    Graphics offgra = offscreen.getGraphics();
    DirectGraphics directgraphics = DirectUtils.getDirectGraphics(offgra);
    directgraphics.drawPixels(imgData,false,0,width,0,0,width,height,0,MODEL); // imgData is a int array(int imgData[]) which contains required pixels of image.
    The above code is working fine with NOKIA 60 series device but when i use it with NOKIA 40 series device it gives java.lang.IllegalArgumentException.
    same time if i use :-
    directgraphics.drawPixels(imgData,false,0,width,0,0,width,height,0,DirectGraphics .TYPE_USHORT_4444_ARGB ) ;
    // imgData is a short array(short imgData[]) which contains required pixels of image. i have used different formet here.
    it works fine with 40 series device,
    can any one suggest me how to use drawPixels method for 40 series devices with format
    DirectGraphics .TYPE_INT_8888_ARGB .

    If Remote wipe is activated it can't be undone. And Once the Wipe is done, the device can nö longer be tracked.
    Sorry.

  • Need suggestions for concurrent reads while deleting all entities

    Hello,
    we need some suggestions for the following use case, as we cannot seem to find the correct transaction locking combination to meet our needs.
    We are using BDB JE 4.1.10, and the entityStore is transactional. In a nutshell, BDB JE is used as a Cache for specific data that is pulled and updated regularly from a source Oracle DB. The application that holds BDB is a realtimel app, and response time is critical.
    In order to avoid having to merge (Insert/update/delete) entities for some of the tables that are very static and small (a few hundred records that might change every day or so), we are trying to simply delete all records (with an EntityCursor loop, since there is no 'deleteAll' that we could find) and reinsert all data every 5 minutes, and then committing when the whole process is complete. This should always be very quick, but we are not immune to timeouts from the source Oracle DB, so the transaction can be long.
    Ideally, while the delete/insert is happening, we want any concurrent read operations to return the old data (before the delete). We have made a test that locks the updater thread between the 'delete all' and 'update all' methods, so that the delete cursor is closed, but the Tx is not yet commited. We have tried the following for our reader thread:
    1- If we get() a deleted entity with a LockMode.READ_UNCOMMITTED, we get a null entity back.
    2- If we get() a deleted entity with LockMode.READ_COMMITTED, we get a LockTimeoutException.
    We have also considered simply using truncate on the EntityStore, but this requires closing and reopening the DB, so this would not work for our need to always return a value, instantly.
    Any ideas, suggestions on how we could do this in a simple manner?
    Thanks,
    Max

    Hello Max,
    I understand the issue you're describing.
    I think the best performing solution by far is to load the new data into new databases while servicing reads from the old databases. When the load is complete, reads can be diverted to the new databases, and the old databases can then be removed.
    Unfortunately, this is easier to do with the base API than with the DPL, because the DPL is managing the underlying (base API level) databases for you.
    However, even using the DPL, this approach could be very straightforward if you happen to be keeping this data set (the one that needs to be reloaded) in a separate EntityStore, or you can change your application to do so. If so, you can create a new (empty) EntityStore with a different name and use this store for loading the new data. When the load is complete, divert reads to the new EntityStore object and remove all databases for the old EntityStore.
    If this is impractical, please explain, and I'll try to suggest a different solution. If you cannot use a separate EntityStore for this particular data set, then the solution may be more complex.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Process and Forms - Issue with Method which Uses Imported Form Values

    We are doing a project to implement ESS and MSS. Using Adobe Process and Forms we generated a process with form and workflow.
    The workflow's first step uses a version of TS17900110 task to move the form to the workflow container.
    Binding:
    export:
    &FORM_STANDARD& @0E\QAssign Value@ @9T\QGets data for...@ &FORM&
    'USER_ID' @0E\QAssign Value@ @9T\QGets data for...@ &FORM_FIELD_NAME_1&
    'PERNR' @0E\QAssign Value@ @9T\QGets data for...@ &FORM_FIELD_NAME_2&
    'AWART' @0E\QAssign Value@ @9T\QGets data for...@ &FORM_FIELD_NAME_3&
    Binding
    import:
    &EMPL_USERID.OBJID& @9S\QReceives data from...@ @0D\QAssign Value@ &FORM_FIELD_VALUE_1&
    &PERNR& @9S\QReceives data from...@ @0D\QAssign Value@ &FORM_FIELD_VALUE_2&
    &AWART& @9S\QReceives data from...@ @0D\QAssign Value@ &FORM_FIELD_VALUE_3&
    The workflow is bringing values for: EMPL_USERID, PERNR, AWART.
    We need to write these field values to a table using a method.  We are using a custom task to do this.
    The task triggers a method which calls a FM which makes the update to the table.
    The step with the custom task is a foreground step which the workflow stops for so we can test execute it.
    When we execute there is a breakpoint in the ABAP code which stopps us at the point where the values are being read.
    We are trying to read values:  'USER_ID', 'PERNR', and 'AWART' but the debugger is not showing any values being brought in.
    The binding we currently have for the step we feel is the problem:
    This is all we have in there so far - NEED suggestions/advice:
    Binding export:
    &ZABSREQ&     @0E\QAssign Value@     @9T\QGets data for...@     &_WI_OBJECT_ID&
    (&ZABSREQ& - This is a BOR)
    Any information is appreciated.
    alicia.morante at gmail.com
    alicia.morante at us.army.mil
    Edited by: Alicia Morante on Jan 23, 2012 8:43 PM

    We were very anxious to solve this issue.
    While I was posting my counterpart realized that we did not have target containers setup to receive the values from the workflow.
    Once those were set the values were able to be read from the FM.
    Here's the binding updated to:
    &EMPL_NUM&     @0E\QAssign Value@     @9T\QGets data for...@     &EMPL_NUM&
    &SUBTYPE&     @0E\QAssign Value@     @9T\QGets data for...@     &SUBTYPE&
    Still gave you some points for helping - Thank you.

  • I am so tired of iphoto crashing, losing work I've done.  I want to switch to photoshop elements 10 but need to know if it uses the iphoto library or if I can import that library into elements

    I am so tired of iphoto crashing, losing work I've done.  I want to switch to photoshop elements 10 but need to know if it uses the iphoto library or if I can import that library into elements

    Using Photoshop or Photoshop Elements as Your Editor of Choice in iPhoto.
    1 - select Photoshop or Photoshop Elememts as your editor of choice in iPhoto's General Preference Section's under the "Edit photo:" menu.
    2 - double click on the thumbnail in iPhoto to open it in Photoshop.  When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done. 
    3 - however, if you get the navigation window
    that indicates that  PS wants to save it as a PS formatted file.  You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    NOTE: With Photoshop Elements  the Saving File preferences should be configured as shown:
    I also suggest the Maximize PSD File Compatabilty be set to Always.  In PSE’s General preference pane set the Color Picker to Apple as shown:
    Note:  to switch between iPhoto and PS or PSE as the editor of choice Control (right)-click on the thumbnail and select either Edit in iPhoto or Edit in External Editor from the contextual menu. If you use iPhoto to edit more than PSE re-select iPhoto in the iPhoto General preference pane. Then iPhoto will be the default editor and you can use the contextual menu to select PSE for your editor when desired.

  • Need suggestions with programming

    Hi,
    In programming my application, I am stuck at a point and would like some suggestions.
    The application is a relatively simpe HMI, interfacing to a PLC. Because the I/O count is low, I'm doing this in regular Labview, not the DSC module. To keep the Operator Interface seperate, I have an "engine" vi running in the background acquiring the data from the PLC (either via OPC w/datasocket or dll calls). Now my question is this: What is the best way to get the data from the "engine" vi to the Operator Interface vi? I'm having a mind block here. Should I use control reference or globals? Or another way? Thanks for any suggestions.

    The reasons for using the DSC include this exact situation.
    The DSC, with regards to getting data from Field Point modules (the equivalent of PLCs, I guess) runs on a server level, below LabVIEW, called the Tag Engine. The Tag Engine updates a historical database called the Citadel database. This keeps a running track of your data (depending upon the configuration.)
    Where the DSC is valuable is that the data server and database are already written for you, and all you have to do is retrieve the data as needed.
    In trying to simplify things by not using the DSC, you have tasked yourself with the rudimentary programming involved in retrieving and storing the data from the PLCs, and making it easily accessible by our HMI.
    As is sounds as though you have already done the work to create the engine, you are now stuck with how to get your data from the engine to the HMI, something that the Tag VIs do in LabVIEW. You now have to mimic the Tag VIs somehow.
    So, on to the real answer to your question (the above was presented for purely information purposes to possibly influence your decision next time...let NI do the work for you...)
    I strongly recommend AGAINST both references and globals. References are intended as a way to automate the updating of front panel controls and indicators, and not as a substitute for pointers and references. Globals are just a mess, and I avoid them at all costs. Consider a few options. Your choice should be dependent upon your exact situation.
    1. Simple Data Point server. This simple 'server' makes the latest data point available. It stores it in a LabVIEW 2 style global (something I like to call a data object, but which is probably not the best name for it.) Basically, you take the data from your engine, and write it to a subVI that uses an unitialized shift register to store the data. The subVI is always WRITTEN by the engine. Your HMI then READs the data. There is no time or latest data dependency, and simply put, your HMI will always be reading the latest data available. You can find a design template for this in the "Programming Designs..." topic on the main page of the web interface Developer Exchange, LabVIEW General.
    2. FIFO, LIFO, or similar buffer. If you need every datapoint to be handed from your engine to the HMI, then you need to buffer the data. Just use the design model as the simple server, but instead of updating the shift register with a single point, you need to append an array for each write, and delete an element for each read. FIFO (First in First Out) buffers remove the oldest data point first, and LIFO's remove the newest on first.
    There are probably other methods available. If these two don't fit your needs, please post again. Also, if you have trouble with the design pattern, please let me know. I created that design pattern, and it should be adequately documented, but if not, feel free to poke and prod.
    Good luck
    -Mike Du'Lyea

  • Help needed on Logging Servlet Implementation using high traffic HTTP Post

    I have a servlet called LogServlet, which accepts the post HTTP request Data from another application and logs it into a file. The key thing here is the logs should get logged in a squence it is received.
    Since the frequency of the data being sent is very high the LogServlet is not able to keep it up with the sequence and messing up the sequence.
    Are there any suggestions on how to improve this and make sure the servlet logs it in the way it receives it?
    Can I replace the Servlet with JSP to do the logging and will that solve my sequence issue?
    Or there are any other techniques.
    Thanking you in advance.

    You could use the log4j logging tool, it uses a static Logger for the class and you can run it in synchronized mode to ensure that your log messages don't clobber each other. Hmm, you're testing my knowledge of how synchronization is implemented in Java. It uses a semaphore-style approach under the covers, but is it a fair-style (first-come, first-served) implementation?
    After a quick Google search I just learned that in the normal VM fairness is not guaranteed, but if you use the Sun Real-Time VM synchronized will guarantee FIFO style access to synchronized resources. The Real-Time VM is not free, so if cost is an issue that might not be an option for you. That's going to make things more complicated for you since ordering sounds important.
    You can probably write something fairly easily to do what you want. Basically write a queue processing class that uses either static methods/variables or a Singleton approach to ensure that your messages get processed in a FIFO order. Then just use your existing logging logic or use log4j to write your messages to a log file. There are several pitfalls to writing multi-threaded components like this, so be careful that you've synchronized the right methods and, depending on how you decide to implement it, use the right Queue implementation (hint: you may need to look in the java.util.concurrent package for your queue implementation, depending on the approach you take.)
    One thing to note, this last approach may be overkill depending on what you mean by "very high frequency." If you're getting 10-20 requests a second, I think you still might be able to get away with log4j in synchronized mode. It also depends on how important the ordering really is. If one request arrives 500 microseconds after the other, is it okay to reverse the ordering? If so then syncrhonized log4j may still be okay. If not, then you're going to have to write something a little more sophisticated or take a closer look at the capabilities of the real-time VM.
    Alternatively, someone who's more knowledgeable than me on the subject might be able to suggest a better approach using JMS.

  • ValueObject XML creator - NEED SUGGESTION

    This is a real time scenario...
    1) I have many value objects generated from third party software.
    (A Value object is a simple java file which has a set of attributes in it with corresponding set/get methods. Ofcourse they may inturn contain other value obejcts )
    2) I need to know whether i can write a parser which will read the src/class file & generate an XML file for all the attributes present in the valueObject.This includes all the primitive data types, collections & other value objects present in the original value object.
    3) I need a corresponding unmarshall for the same ..ie., some parser which would actually read from the file & generate a value object (java object)
    Please note that some value objects may be extremely large with so many other large value objects contained in it. All that im interested is i need to populate these objects using an Xml file rather than manually writing java code to set each and every attribute present in the object (imagine , when u need to set the attribute of another object within this which is present in hierarchy of 5-6 levels ... u need to create all the corresponding objects before actually setting that one VALUE !!!)
    can anybody tell me if there is already a tool for doing the same if not , what parser .. what reference material i need to look into so that i can write my own stuff to do it.
    Assume im new to XML Parsers.
    PLEASE SUGGEST, Any help highly appreciated

    The only one that I am aware of that's relatively simple to use is castor (http://castor.org) that should give you what you need. If your VOs are rather complex, you may need to do some "tweaking" of the XML, which Castor also provides for.
    Unfortunately, JAXB doesn't (yet?) have this kind of capability that I know of. It might be buried somewhere in the API and not show-cased in the (date) Web Service Tutorial.

Maybe you are looking for

  • How to restore OS X AND Win 7 backups to new internal hard drive

    Hello, When my iMac will come back from the repair it will have a new hard drive. Will I be able to restore all files to the OS X partition AND to the Windows 7 partition so that my iMac will be in exactly the same state as before? I have a Time Mach

  • Recent Items list

    Is there a way to increase the number of recently opened items that Dreamweaver remembers?

  • How do you 'unreject' a clip?

    this is maddening...how can I 'unreject' a segment of a clip? and how do I delete rejected clips?! space saver doesn't allow me to...it says'unable to reject clips'...ahh!

  • COnVERSION ROUTINE in data element level

    how can we write the CONVERSION ROUTINE in data element level for a field in data dictionary ?.........plz if possible give the EXAMPLE code also?

  • Thin black line across screen

    My 5th generation Ipod classic has, in the last year, developed a think black line across the center of the screen that is always there. Is this a "dead pixel" area that has developed? Is there any way to repair this that isn't costly?