Hi! Straight to the problem: I'm building this server application which will monitor SQL databases. I want it to remember any number of connections so I've made a few methods which I thought would do the trick, except they don't. The program should add any new SQL connection to a List<MyConnection>, then serialize it to a file "connections.txt", and finally to a JComboBox. PROBLEM: When I add the first connection, it works properly since the file needs to be generated. Then I proceed to add a second one, and for that I found that I have to delete the file …

Member Avatar
Member Avatar
+0 forum 22

I need to sort items from multiple columns. I use this to get the id from the columns and format the data: $.fn.serial = function() { var array = []; var $elem = $(this); $elem.each(function(i) { var id = this.id; $(move_selector, this).each(function(e) { array.push( 'id[]=' + this.id ); }); }); var data = array.join('&'); //console.log(data); return data; }; $(function() { $("div.connectedSortable").sortable({ connectWith: '.connectedSortable', update: function(event, move_selector) { $('#data').empty().html( $('.connectedSortable').serial() ); var datatest = $('#data').text(); //$('#test').text(datatest) console.log(datatest); } }); }); This gets the data to the console.log but I can't seem to get it into a variable that I can use …

Member Avatar
Member Avatar
+0 forum 2

Oh boy They ust be tired of me now. My trouble: I have two ArrayLists of custom classes. ``ArrayList<Subject>` **a**` ``ArrayList<Student>` **b**` Within those custom classes are other custom classes which themselves have primitive data types as well as an ArrayList of other custom classes. It's a big circus going on. How do I XMLEncode those two ArrayLists, **a** and **b**, so that all the information within them branching all the way down, is saved? (Also, is it possible to save both of these to the same file please?)

Member Avatar
Member Avatar
+0 forum 4

import java.io.EOFException; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.OutputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Scanner; class Record implements Serializable { int roll; String name; public void setData() { Scanner scr=new Scanner(System.in); System.out.println("Enter Roll Number: "); roll=scr.nextInt(); System.out.println("Enter Name: "); name=scr.next(); writeData(); } public void writeData() { try { ObjectOutputStream of=new ObjectOutputStream(new FileOutputStream("c:\\yyy.txt",true)); of.flush(); Object o =new Object(); o=(Object)this; of.writeObject(o); //of.reset(); of.flush(); of.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public void readData() { Record r; try { ObjectInputStream iff=new ObjectInputStream(new FileInputStream("c:\\yyy.txt")); while(true) { r=(Record)iff.readObject(); r.getData(); } …

Member Avatar
Member Avatar
+0 forum 4

I am developiong a php application which builds several large collections of objects in the course of interacting with the user. The objects need to persist across requests from the user and I've used php sessions to successfully implement this. The objects are persisted until the user is satisfied with what they have done and they request the information represented by the objects to be saved. In profiling the application I found that the session start takes about half of the total time of a request (about 4 seconds in total for a request). Since not all stored objects are …

Member Avatar
Member Avatar
+0 forum 2

Hi, I want to serialze an object. I use the binary formatter because it's a very complex object. I solved a lot of SerializationExceptions, but there are two that I don't understand or know how to handle. It says "The type "Ivi.Visa.Interop.FormattedIO488Class" in assembly "Ivi.Visa.Interop, Version=3.2.0.0, Culture=neutral, PublicKeyToken=a128c98f1d7717c1" is not marked as serializable." The problem is that Ivi.Visa.Interop is just a using directive in some of my classes. I don't know how to make them serializable. The second problem is a warning "The referenced assembly "ZedGraph.Web" could not be resolved because it has a dependency on "System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" …

Member Avatar
Member Avatar
+0 forum 6

Okay, so my hurdle here is to Serialize a list that has a bunch of objects in them, write them to a file, and be able to open the file to load the list of objects back into a listbox. I've read the MSDN articles and browsed some Forums, but everything about this is way over my head, and I've never touched Serialization before. I've got everything laid out, I think, but some guidance would be greatly appreciated. // Main.CS using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.Serialization; …

Member Avatar
Member Avatar
+0 forum 3

I want to store my array into my database using jQuery. Here is my code i'm using serialize(); function. Its storing correctly but when i unserialize(); nothing happening. Please help here is my code. <script> $(document).ready(function(){ $("#save-skills").click(function(){ var skills = $('input[name="skills[]"]').serialize(); console.log(skills); $('#loading').css('display', 'block'); var queryString = "skills=" + skills + ""; $.ajax({ url: 'save_skills.php', cache: false, contentType: "application/json; charset=utf-8", dataType:'json', async: false, type:'GET', data: queryString, success: function(data){ $('#loading').css('display', 'none'); if('error' in data){ $(".re_skills_success").hide(100); $(".re_skills_err").text(data.error); $(".re_skills_err").slideDown(400).delay(3000).slideUp(400); }else if('success' in data){ $(".re_skills_err").hide(100); $(".re_skills_success").text(data.success); $(".re_skills_success").slideDown(400).delay(3000).slideUp(400); } } }); }); }); </script> <!-- Unserialize() code --> $who = $_COOKIE['Email']; $skills = @mysql_query("SELECT * …

Member Avatar
Member Avatar
+0 forum 4

I'm attempting to use the ObjectOutput/InputStream to write data to a file; I'm fairly certain I've got the out portion but coming back in isnt working as it should, thoughts? public static void writePersistant(ArrayList<PersistantObject> persistantRecords) { try { ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("dataout/population-record.ser")); for (PersistantObject i : persistantRecords) { oos.writeObject(i); } oos.close(); } catch (FileNotFoundException ex) { System.out.println(ex.getMessage()); System.out.println(ex.getStackTrace()); } catch (IOException ex) { System.out.println(ex.getMessage()); System.out.println(ex.getStackTrace()); } } public static void readerPersistant() { try { ObjectInputStream ois = new ObjectInputStream(new FileInputStream("dataout/population-record.ser")); Object inputObj = null; while ((inputObj = ois.readObject()) != null) { if (inputObj instanceof PersistantObject) { System.out.println(inputObj); } …

Member Avatar
Member Avatar
+0 forum 3

Im trying to make an application that collects how many items were sold and which items they were, I was thinking something like this for checking the upc number, to see if it matches the names in the “files” [CODE] Select Case TextBox1.Text ' 0921115150 “Dark Chocolate Truffles”, 2221001501 “ mint mintaways”, 6652300415 “Chocolate Covered Cherries”, ' 0255541028 “Malted Milk Balls”, 0921115141 “Chocolate Covered Raisins “ Case "0921115150 ", " 2221001501 ", " 6652300415 ", " 0255541028 ", " 0921115141 " MsgBox("Correct #") Case Else MsgBox("Must be either: 0921115150 /2221001501 /6652300415 /0255541028 /0921115141 ", MsgBoxStyle.Exclamation) ' Error message displayed End …

Member Avatar
Member Avatar
+0 forum 10

The above classes provide an interface for reading the PHP session data. PHP alone only gives you access to the current users session. This class allows you to read all session files, and thus allow you to read session data across different users. This may be useful if you want to copy, backups session data, or transfer to a different format/handler etc.. At the moment it only reads file based session handling, with PHP doing the serializing and handling (the default setting). It does not support other session handlers or serializers. You can extend the base abstract class for different …

Member Avatar
Member Avatar
+2 forum 4

The End.