import java.util.ArrayList; import java.util.Arrays; import java.util.List; class Counter { public void split(String a,ArrayList<String> al) { char ch[]=a.toCharArray(); int p=0; for(int i=0;i<ch.length;i++) { if(ch[i]==32) {List<String> l=al.subList(p,i); ArrayList<String> al1=new ArrayList<String>(l); //String str=new String[al1.size()]; //al1.toArray(str); //al1.add(str); //al1.add(al1); //why this is also wrong al1.add(al.sublist(p,i)); p=i; System.out.println(al1); } } } public static void main(String... s) { String k="My name is Khan Khan"; List<String> l=Arrays.asList(k); ArrayList<String> al=new ArrayList<String>(l); Counter c=new Counter(); c.split(k,al); System.out.println(k); } }

Member Avatar
Member Avatar
+0 forum 5

Hi this is scorpionz I am uploading an excel sheet file using PHP Now the file code is working fine for gif files but not working if i provive xls extension Here is the php main code [code] <?php // include 'config.php' include 'uploadcode.php'; if(isset($_POST['upload_file'])) { $user_file = $_FILES["car_info_file"]["name"]; upload_files($_FILES["car_info_file"]["name"]); } ?> <body> <form name="uploadfile" action="" method="post" enctype="multipart/form-data"> <div class="upload-box"> <div style='border-left-width:0px;border-right-width:0px;border-top-width:0px;border-bottom-width:1px;border-color:#C0C0C0;border-style: solid; background-color:#669900;text-align:center; width:'> <a href="#">Upload File </a></div> </div> <div> <table class="bodyBg" bgcolor="#333333"> <tr> <td width="94" align><span class="style1">Upload Your Display </span></td> <td width="246"><input type="file" name="car_info_file" id="car_info_file" style="height: 19px; width:100px; font-size:87%;"/></td> </tr> <tr> <td colspan="2" align><input type="submit" name="upload_file" value="Upload" /></td> …

Member Avatar
Member Avatar
+0 forum 21

Hey guys, I am making a few gui programs and I was wondering on this code .. class PaintChart(wx.Panel): def __init__(self, parent, data): self.data = data.split() wx.Panel.__init__(self, parent) self.SetBackgroundColour('BLACK') self.Bind(wx.EVT_PAINT, self.drawChart) def drawChart(self, e): dc = wx.PaintDC(self) dc.SetDeviceOrigin(30, 240) dc.SetAxisOrientation(True, True) dc.SetPen(wx.Pen('RED')) dc.DrawRectangle(1, 1, 300, 200) Here I set the rectangular to fixed size, and if i resize the frame(This class is being called from another which holds a frame) then the frame and the panel would also resize but not the rectangular. However, I would want that to resize as well. How can I set the size of it …

Member Avatar
Member Avatar
+0 forum 1

Can someone kindly help me with a solution to this assignment http://math.hws.edu/eck/cs225/s09/lab9/ CPSC 225, Spring 2009 Lab 9: Sets in the Java Collection Framework For this week's lab, you will use two of the classes in the Java Collection Framework: HashSet and TreeSet. You will use these classes to implement a spell checker. This lab is due at the time of the next lab, next Tuesday, March 31. Please copy your work into the homework directory by that time. Your work from labs 6, 7, and 8 is due this week. I will not look for this work until this …

Member Avatar
Member Avatar
+0 forum 5

When posting any request for help with an assembly language problem, we ask that you provide some crucial information: * The operating system (Windows, Linux, MacOS, etc.) the program will be running under, including the version, * The assembler you are using, including the version, * the bit width being targetted (usually 8, 16, 32, or 64 bits), and * If you are using an emulator, and if so, which one and what architecture it targets The reason this is important is that, unlike most of the other languages discussed on the DaniWeb, 'assembly language' is not a single, common, …

Member Avatar
+1 forum 0

I am trying to add a secondary level to Chris Coyer Magic Line menu. I have made some progress but it is not complete. Right now I am stuck on 3 spots to make it complete. The placement of the secondary menu, the overlay of the secondary menu and the hover off. The HTML [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- http://css-tricks.com/jquery-magicline-navigation/ --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> <title>Magic Line Navigation</title> <link rel='stylesheet' type='text/css' href='css/style.css' /> <script type='text/javascript' src='js/jquery.js'></script> <script type='text/javascript' src='js/jquery.color-RGBa-patch.js'></script> <script type='text/javascript' src='js/menu_2.js'></script> </head> <body> <div class="nav-wrap"> <ul class="group" id="example-one"> <li class="current_page_item"><a …

Member Avatar
Member Avatar
+0 forum 1

I know that in case of virtual inheritance, a vptr is needed to access the base class members, so I looked at a program that involved virtual inheritance but I was amazed at the size of the class. The code is below: #include<iostream> using namespace std; class Base { public: }; class D1:public Base { }; class D2:virtual public Base { }; class DD: public D1, public D2 { }; int main() { DD cObj; cout<<sizeof(cObj)<<endl; return 0; } For size of pointers = 4, The size of class DD comes to be 8, even though class D1 doesn't use …

Member Avatar
Member Avatar
+0 forum 1

The End.