C#: Issue reducing ListView Flickering by using Begin/EndUpdate and or using AddRange

I'm trying to reduce ListView flickering because I load over 250,000 items into a listview (5 columns x 50,000 ListViewItems), which takes about 5 minutes. I found two potential solutions but cannot get either of them to work.
MSDN BeginUpdate/EndUpdate
- Is one solution which is supposed to prevent redrawing until reaching the of the For/Loop cycle. However, I have these strategically placed as demonstrate by this source and it still does it.
MSDN ListView.AddRange: Is the second option recommended in the previous link, and attempts to reduce flickering by adding a range of listview items as opposed
to doing so individually.  The issue here is I'm not able to figure out how to convert my string array of values to an array for listview values (ListViewItems[]). This is also compounded by the fact that whatever I do, I have to prevent cross-threading
by passing through a delegate and method. This is the solution I think I will need to implement but I need your help.
This is the code ("Loading()")s wrapped in the BeginUpdate/EndUpdate, which doesn't appear to work, maybe because this method is within an async thread. This method is also where I want attempt converting my string to a ListViewItemCollection
to see if the "AddRange" will help reduce or eliminate the flickering.
The Additem() method below that is what I will have to tweak if I can, with some assistance, get the "AddRange" option working.
private void Loading()
int t = 1;
listView1.BeginUpdate();
foreach (string line in scripts)
string[] listValues = line.Split(',');
ListViewItem values = new ListViewItem(listValues);
if (t == 1)
AddColumn("Script Name", 200); // Creates column headings
AddColumn("Date and Time", 150);
AddColumn("SID", 75);
AddColumn("Environment", 75);
AddColumn("Client", 75);
t++;
else
if ((values.Text != "") && (values.Text != "Script Name"))
AddItem(values);
if (!dictScript.Contains(values.Text))
dictScript.Add(values.Text);
AddScript(values.Text);
listView1.EndUpdate();
The AddItem() method to handle cross-treading issue:
private void AddItem(object o)
if (this.listView1.InvokeRequired)
AddItemCallback d = new AddItemCallback(AddItem);
this.Invoke(d, new object[] { (ListViewItem)o });
else
{ // code that adds item to listView (in this case $o)
listView1.Items.Add((ListViewItem)o);
SV

That was a great suggestion! It worked perfectly!
I solved two problems with in one new learning moment. This took care of the flickering and loaded in less than 3 seconds with 60,000 entries.
In response to Phil, I absolutely agree in any other case. However, this will meet the applicaiton requires and how the users intend to use it.
Thanks fellas!
This was my VirtualListViewTest code.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.IO;
namespace DirectorVirtual
public partial class Form1 : Form
private string info;
private string infoDS1;
private string infoDS2;
List<ListViewItem> scripts;
public Form1()
InitializeComponent();
scripts = new List<ListViewItem>();
private void listView1_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
e.Item = scripts[e.ItemIndex];
private void Loading()
listView1.View = View.Details;
listView1.Columns.Add("Name", 200); // Creates column headings
listView1.Columns.Add("Date and Time", 150);
listView1.Columns.Add("Person", 75);
listView1.Columns.Add("Computer", 75);
listView1.Columns.Add("Location", 75);
foreach (string s in info.Split('\n'))
if (!s.Contains("Name"))
scripts.Add(new ListViewItem(s.Split(',')));
listView1.RetrieveVirtualItem += new RetrieveVirtualItemEventHandler(listView1_RetrieveVirtualItem);
listView1.VirtualListSize = scripts.Count;
listView1.VirtualMode = true;
private void DownloadData()
try
// Retrieve the contents of the Execution Log.txt file
WebClient web = new WebClient();
// 2.0 Data
infoDS2 = web.DownloadString("http://dummylink.net/Execution_Log.txt");
// 1.0 Data
infoDS1 = web.DownloadString("http://dummylink.net/Execution_Log_1.0.txt");
web.Dispose();
catch
MessageBox.Show("Failed to retrieve the Execution Log.", "Execution Log Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
System.Windows.Forms.Application.Exit();
Environment.Exit(0);
info = infoDS1 + infoDS2;
private void button1_Click(object sender, EventArgs e)
DownloadData();
Loading();
SV

Similar Messages

  • Just wondering what Apple's stand is on the issue with a flickering and a dark area appearing on imac 27"screen - forums seem to indicate this is not uncommon - and happens through normal use - so should be subject to repair (Sale of Goods Act - 6 years)

    Just wondering what Apple's stand is on the issue with a flickering and a dark area appearing on imac 27"screen - forums seem to indicate this is not uncommon - and happens through normal use - so should be subject to repair (Sale of Goods Act - ie 6 year warranty)

    We are just users like yourself.  If Apple has stated publicly about the problems you mentioned, it will be listed on their website and/or in one of their Knowledge Base Articles.
    I have a 27" & do not suffer from such a problem.  You should keep in mind that these are technical support forums. Generally, the only people posting here are those with problems. The thousands/millions without problems don't ever come here. 
    Think of these forums as a hospital emergency room. 

  • Performance issue in browsing SSAS cube using Excel for first time after cube refresh

    Hello Group Members,
    This is a continuation of my earlier blog question -
    https://social.msdn.microsoft.com/Forums/en-US/a1e424a2-f102-4165-a597-f464cf03ebb5/cache-and-performance-issue-in-browsing-ssas-cube-using-excel-for-first-time?forum=sqlanalysisservices
    As that thread is marked as answer, but my issue is not resolved, I am creating a new thread.
    I am facing a cache and performance issue for the first time when I try to open a SSAS cube connection using Excel (using Data tab  -> From Other Sources --> From Analysis Services) after daily cube refresh. In end users system (8 GB RAM but around
    4GB available RAM), for the first time, it takes 10 minutes to open the cube. From next run onwards, its open up quickly within 10 secs.
    We have daily ETL process running in high end servers. The configuration of dedicated SSAS cube server is 8 core, 64GB RAM. In total we have 4 cube DB - out of which for 3 is full cube refresh and 1 is incremental refresh. We have seen after daily cube
    refresh, it takes 10 odd minutes to open the cube in end users system. From next time onwards, it opens up really fast with 10 secs. After cube refresh, in server systems (32 GB RAM, around 4GB available RAM), it takes 2 odd minutes to open the cube.
    Is there, any way we could reduce the time taken for first attempt ?
    As mentioned in my previous thread, we have already implemented a cube wraming cache. But, there is no improvement.
    Currently, the cumulative size of the all 4 cube DB are more than 9 GB in Production and each cube DB having 4 individual cubes in average with highest cube DB size is 3.5 GB. Now, the question is how excel works with SSAS cube after
    daily cube refresh?
    Is it Excel creates a cache of the schema and data after each time cube is refreshed and in doing so it need to download the cube schema in Excel's memory? Now to download the the schema and data of each cube database from server to client, it will take
    a significant time based on the bandwidth of the network and connection.
    Is it anyway dependent to client system RAM ? Today the bigest cube DB size is 3.5 GB, tomorrow it will be 5-6 GB. Now, though client system RAM is 8 GB, the available or free RAM would be around 4 GB. So, what will happen then ?
    Best Regards, Arka Mitra.

    Could you run the following two DMV queries filling in the name of the cube you're connecting to. Then please post back the row count returned from each of them (by copying them into Excel and counting the rows).
    I want to see if this is an issue I've run across before with thousands of dimension attributes and MDSCHEMA_CUBES performance.
    select [HIERARCHY_UNIQUE_NAME]
    from $system.mdschema_hierarchies
    where CUBE_NAME = 'YourCubeName'
    select [LEVEL_UNIQUE_NAME]
    from $system.mdschema_levels
    where CUBE_NAME = 'YourCubeName'
    Also, what version of Analysis Services is it? If you connect Object Explorer in Management Studio to SSAS, what's the exact version number it says on the top server node?
    http://artisconsulting.com/Blogs/GregGalloway

  • Flickering while using MSI gaming app with MSI motherboard+MSI Nvidia 970

    As title, I am experiencing flickering when using MSI gaming app both in gaming and OC settings. When I close the app, everything is fine. I am not experienced in OCing, hence I'd be absolutely glad to be able to use MSI gaming app, and it worked with the previous version.
    MSI gaming app version: 4.0.0
    System:
    Mainboard:MSI Z97 GAMING 3
    Bios: latest update
    VGA: MSI GTX 970 Gaming 4G GeForce GTX 970
    PSU: be quiet! Pure Power L8-CM 630W ATX 2.31 (L8-CM-630W/BN182)
    Processor: Intel Core i7-4790K 4x 4.00GHz, boxed
    Mem: G.Skill Ares DIMM Kit 8GB RAM DDR3-2133Mhz

    peterlewisknox, for your own issue please open an own topic and don't resurrect old ones that had no replies already. >>Please read and comply with the Forum Rules.<<

  • Issue with Ftp Client / Server using Sockets

    I have developed a Ftp Client and a Ftp Server. The client Connects to the Ftp Server and sends files to the ftp server. It is a multi threaded server and can have multiple clients connecting to it.
    If a client goes down...the server waits till the client comes up
    Similarly the client waits if a server goes down and reconnects when the server is again up and running
    i am having a strange issue here. When two clients go down and reconnect to the server...They take a long time to connect and transferring of files takes a long time...
    Other wise in all other scenarios the duo work properly.
    Any feedback and suggestion about this strange issue from all you java gurus out there will be deeply appreciated.
    Here is the client code
    import java.net.*;
    import java.net.Socket;
    import java.net.InetAddress;
    import java.io.*;
    import java.io.File;
    import java.util.*;
    import java.lang.*;
    import java.lang.Object;
    import javax.crypto.*;
    import java.util.regex.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    import java.io.InputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.File.*;
    import java.nio.channels.FileLock;
    public class  FTPClient {
         public static void main(String[] args) throws Exception
              Timer timer = new Timer("Test Timer");
              timer.scheduleAtFixedRate(new TimerTask()
                   private int counter = 0;
                                            public void run() {
                                                                     try     {                                                                                
                                                                              System.out.println(counter++);
                                                                               Socket soc=new Socket("xxx.x.x.xx",5217);
                                                                               System.out.println("Socket Initialised.");          
                                                                               transferfileClient t=new transferfileClient(soc);
                                                                               t.SendFile();
                                                                               System.out.println("run complete.");                                                                           
                                                                          catch(Exception ex)
                                                           }, 10000, 40000);
         static class transferfileClient
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;
         BufferedReader br;
         transferfileClient(Socket soc)
              try
                   ClientSoc=soc;
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   br=new BufferedReader(new InputStreamReader(System.in));
              catch(Exception ex)
         //encrypto routine starts
    class DesEncrypter {
           Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03
            // Iteration count
            int iterationCount = 19;   
            DesEncrypter(String passPhrase) {
                try {
                             // Create the key
                             KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                             SecretKey key = SecretKeyFactory.getInstance(
                             "PBEWithMD5AndDES").generateSecret(keySpec);
                             ecipher = Cipher.getInstance(key.getAlgorithm());
                             dcipher = Cipher.getInstance(key.getAlgorithm());   
                             // Prepare the parameter to the ciphers
                             AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                             // Create the ciphers
                             ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                             dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends     
         void SendFile() throws Exception
                   try
                   String directoryName; 
                   // File object referring to the directory.
                   String[] files;        // Array of file names in the directory.        
                   //directory = new File ( "C:\\FTP\\" ) ; 
                   File directory1 = new File("C:\\FTP");
                        boolean successmk = directory1.mkdir();
                        if (!successmk) {
                             // Directory creation failed /Already Exists
                        File directory = new File("C:\\FTP\\ftpc");
                        boolean successmk1 = directory.mkdir();
                        if (!successmk1) {
                             // Directory creation failed /Already Exists
                   //directory = new File ( "E:\\FTP-encrypted" ) ;           
                if (directory.isDirectory() == false) {
                    if (directory.exists() == false)
                       System.out.println("There is no such directory!");
                    else
                      System.out.println("That file is not a directory.");
                else {
                    files = directory.list();
                    System.out.println("Files in directory \"" + directory + "\":");
                    for (int i = 0; i < files.length; i++)
                             String patternStr = "xml";
                             Pattern pattern = Pattern.compile(patternStr);
                             Matcher matcher = pattern.matcher(files);
                             boolean matchFound = matcher.find();
                                       if (matchFound) {                                   
                                       System.out.println(" " + files[i]);                                        
                                       String filename;
                                       filename=files[i];                                   
                                       File f=new File(directory,filename);
                                       FileLock lock = null;                                   
                                       FileOutputStream fos = new FileOutputStream(f, true);
                                       lock = fos.getChannel().tryLock();
                                                 if (lock == null) {
                                                 System.out.println(" Failed to get the file lock: means that the file is locked by other instance.");
                                                 fos.close();
                                                 else
                                                                     InetAddress addr = InetAddress.getLocalHost();                                                                      
                                                                               // Get IP Address
                                                                               //byte[] ipAddr = addr.getAddress();
                                                                               String ip= addr.toString();                                                                      
                                                                               // Get hostname
                                                                               //String hostname = addr.getHostName();
                                       System.out.println(" Lock Acquired.");
                                       lock.release();
                                       fos.close();
                                       dout.writeUTF("SEND");
                                            dout.writeUTF(ip);
                                       dout.writeUTF(filename);
              //String msgFromServer=din.readUTF();          
    DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
    // Encrypt
              FileInputStream fino=new FileInputStream(f);
              encrypter.encrypt(fino,
    new FileOutputStream("ciphertext.txt"));               
              fino.close();
              FileInputStream fin=new FileInputStream("ciphertext.txt");          
              int ch;
              do
                   ch=fin.read();
                   dout.writeUTF(String.valueOf(ch));
              while(ch!=-1);
              fin.close();          
              String option;
                        option=din.readUTF();
                             if((option.compareTo("Delete")==0))     
                                  boolean success = (new File("ciphertext.txt")).delete();
                                  boolean success1 = f.delete();
                                  if (success) {
                                  System.out.println("File Sent ...");
                                  if (success1) {
                                  System.out.println("--File deleted from Client ...");
         for (int j = 0; j < 999999999; j++){}
                                       }//pattermatch loop ends here
    else
                             { //System.out.println("   " + "Not an XML file-------->" +files[i]);
    for (int jb = 0; jb < 111999999; jb++){}
              }// for loop ends here for files in directory
                   }//else loop ends for directory files listing               
         System.out.println("sendfile finished...");
         return;
         }               catch(Exception ex)          {ex.printStackTrace();}                    
         }//sendfile ends here     
         public void displayMenu() throws Exception
                   System.out.println(" Send File");                    
                        SendFile();
                        return;          
    And here is the server code...
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    import java.text.DateFormat;
    import java.text.Format;
    import java.lang.Object;
    import java.lang.*;
    import javax.crypto.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    public class FTPServer
    {     public static void main(String args[]) throws Exception
         {     ServerSocket soc=new ServerSocket(5217);
              System.out.println("FTP Server Started on Port Number 5217");
              while(true)
                   System.out.println("Waiting for Connection ...");
                   transferfile t=new transferfile(soc.accept());               
    class transferfile extends Thread
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;     
         transferfile(Socket soc)
         {     try
              {     ClientSoc=soc;                              
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   System.out.println("FTP Client Connected ...");
                   System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
                   //System.out.println("FTP Client Connected ..." + ClientSoc.getRemoteSocketAddress());
                   start();               
              catch(Exception ex)
    //encrypto routine starts
    class DesEncrypter {
            Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03 };   
            // Iteration count
            int iterationCount = 19;   
           DesEncrypter(String passPhrase) {
                try {
                    // Create the key
                    KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                    SecretKey key = SecretKeyFactory.getInstance(
                        "PBEWithMD5AndDES").generateSecret(keySpec);
                    ecipher = Cipher.getInstance(key.getAlgorithm());
                    dcipher = Cipher.getInstance(key.getAlgorithm());   
                    // Prepare the parameter to the ciphers
                    AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                    // Create the ciphers
                    ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                    dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                        //added later on
                        in.close();                    
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends
    //not implemented right now as we arent using the ftp server to download stuff...can be activated later on if we want
         void SendFile() throws Exception
              String filename=din.readUTF();
              File f=new File(filename);
              if(!f.exists())
                   dout.writeUTF("File Not Found");
                   return;
              else
              {     dout.writeUTF("READY");
                   FileInputStream fin=new FileInputStream(f);
                   int ch;
                   do
                        ch=fin.read();
                        dout.writeUTF(String.valueOf(ch));
                   while(ch!=-1);     
                   fin.close();     
                   dout.writeUTF("File Received Successfully");                                   
         String Compare(String filename) throws Exception
                        ///dout.writeUTF("entering compare");
                        String dateTempString=new String();
                        Date dateValue=new Date();
                        SimpleDateFormat formatter = new SimpleDateFormat ("hhmmss");
                        dateTempString = formatter.format(dateValue);
                        File dir1 = new File("C:\\FTPnew");
                        boolean success2 = dir1.mkdir();
                        if (!success2) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success = dir.mkdir();
                        if (!success) {
                             // Directory creation failed /Already Exists
                        File ftemp=new File(dir,dateTempString + filename);
                        File fnewtemp=new File(dir,"new-enc-"+filename);
                        // Create encrypter/decrypter class
                        DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                        FileOutputStream fout=new FileOutputStream(fnewtemp);     
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();
                        //dout.writeUTF("written temp en file");
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(fnewtemp),
                    new FileOutputStream(ftemp));
                        //String Option;
                        dout.writeUTF("Delete");                    
                        System.out.println("File Upload Successfull--Duplicate file with timestamp Created");          
                        boolean success1 = fnewtemp.delete();                    
                        return "hello" ;
         void ReceiveFile() throws Exception
              String ip=din.readUTF();
              System.out.println("\tRequest Coming from Internal IP Address : "+ ip);
              String filename=din.readUTF();
              if(filename.compareTo("File not found")==0)
                   return;
              // Destination directory
       File dir11 = new File("C:\\FTPnew");
                        boolean success22 = dir11.mkdir();
                        if (!success22) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success21 = dir.mkdir();
                        if (!success21) {
                             // Directory creation failed /Already Exists
              File f=new File(dir ,"enc-"+filename);
              File fe=new File(dir,filename);
              String option;
              if(fe.exists())
                   //dout.writeUTF("File Already Exists");
                   String compvalue = Compare(filename);
                   //dout.writeUTF(compvalue);
                   if(compvalue.compareTo("hello")==0)
                        //dout.writeUTF("Transfer Completed");
                        return;
                   option=din.readUTF();
              else
                   //dout.writeUTF("SendFile");
                    option="Y";
                   if(option.compareTo("Y")==0)
                        // Generate a temporary key.       
            // Create encrypter/decrypter class
             DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                 FileOutputStream fout=new FileOutputStream(f);                    
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();                    
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(f),
                    new FileOutputStream(fe));          
                        boolean success2 = f.delete();
                        dout.writeUTF("Delete");
                        System.out.println("File Upload Successfull");                    
                   else
                        return;
         public void run()
              while(true)
                   try
                   String Command=din.readUTF();
                   if(Command.compareTo("SEND")==0)
                        System.out.println("\tSEND Command Received ...");     
                        ReceiveFile();
                        continue;
                   catch(Exception ex)
                        //System.out.println("\tClient Terminated Abnormally ...........");
                        continue;

    Please note that this is not an FTP client and server. FTP is defined by a standard IETF protocol and this isn't it.
    Then, move the following lines:
    din=new DataInputStream(ClientSoc.getInputStream());
    dout=new DataOutputStream(ClientSoc.getOutputStream());
    System.out.println("FTP Client Connected ...");
    System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
    //System.out.println("FTP Client Connected ..."+ClientSoc.getRemoteSocketAddress());from the constructor into the run() method. i.e. don't do anything with the socket in the thread which handles the accept().

  • I have an apple id for my ipod touch at home. My company is planning to issuing Ipads. Should I use the same apple id on the ipad for those apps I purchase and would like to purchase and use on my work ipad?

    I have an apple id for my ipod touch at home. My company is planning to issuing Ipads. Should I use the same apple id on the ipad for those apps I purchase and would like to use on my work ipad?

    Yes, otherwise you will have to pay for those apps again. If an app is purchased by one Apple ID, he/she will be able to redownload it again for no cost (note: this does apply to songs, but NOT to movies).

  • How Do I Filter a Report Using a Multi Select List Box and Specifying Date Between Begin Date and End Date

    Hope someone can help.  I have tried to find the best way to do this and can't seem to make sense of anything.  I'm using an Access 2013 Database and I have a report that is based on a query.  I've created a Report Criteria Form.  I
    need the user to be able to select multiple items in a list box and also to enter a Begin Date and End Date.  I then need my report to return only the records that meet all selected criteria.  It works fine with a ComboBox and 1 selection but can't
    get it to work with a List Box so they can select multiple items.  Any help is greatly appreciated while I still have hair left. 

    The query should return all records.
    Let's say you have the following controls on your report criteria form:
    txtStart: text box, formatted as a date.
    txtEnd: text box, formatted as a date.
    lbxMulti: multi-select list box.
    cmdOpenReport: command button used to open the report.
    The text boxes are used to filter the date/time field DateField, and the list box to filter the number field SomeField.
    The report to be opened is rptReport.
    The On Click event procedure for the command button could look like this:
    Private Sub cmdOpenReport_Click()
    Dim strWhere As String
    Dim strIn As String
    Dim varItm As Variant
    On Error GoTo ErrHandler
    If Not IsNull(Me.txtStart) Then
    strWhere = strWhere & " AND [DateField]>=#" & Format(Me.txtStart, "yyyy-mm-dd") & "#"
    End If
    If Not IsNull(Me.txtEnd) Then
    strWhere = strWhere & " AND [DateField]<=#" & Format(Me.txtEnd, "yyyy-mm-dd") & "#"
    End If
    For Each varItm In Me.lbxMulti.ItemsSelected
    strIn = strIn & "," & Me.lbxMulti.ItemData(varItm)
    Next varItm
    If strIn <> "" Then
    ' Remove initial comma
    strIn = Mid(strIn, 2)
    strWhere = strWhere & " AND [SomeField] In (" & strWhere & ")"
    End If
    If strWhere <> "" Then
    ' Remove initial " AND "
    strWhere = Mid(strWhere, 6)
    End If
    DoCmd.OpenReport ReportName:="rptMyReport", View:=acViewPreview, WhereCondition:=strWhere
    Exit Sub
    ErrHandler:
    If Err = 2501 Then
    ' Report cancelled - ignore
    Else
    MsgBox Err.Description, vbExclamation
    End If
    End Sub
    If SomeField is a text field instead of a number field, change the line
            strIn = strIn & "," & Me.lbxMulti.ItemData(varItm)
    to
            strIn = strIn & "," & Chr(34) & Me.lbxMulti.ItemData(varItm) & Chr(34)
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Strange issue with rights of account, used by SSIS (Foreach Loop Container does not return file names without Admin rights on server)

    Hello everyone.
    Faced very strange issue with account, which is used to run SSIS package.
    The specific package uses Foreach Loop Container to retrieve file names within the specified folder, and put them into Import file task.
    The package is set up to run under specific service account. This service account is given all permissions (Full control) to the folder where source files reside.
    So the issue is: SSIS package fails to execute this task (Foreach Loop Container and then Import), and shows that no files are found in the directory (although files ARE there).
    Once we're adding the service account into local Administrators group on the SQL Server, it works! Removing - does not work again. We cannot leave the service account as SQL server's admin as it's prohibited by our IT policies, and is just a bad practice.
    Any ideas, please? 
    MCP

    Here's the real log output:
    Date 16.04.2014 12:47:09
    Log Job History (RU-BW: Update)
    Step ID 1
    Server Server
    Job Name RU-BW: Update
    Step Name bw_import_cust_master_data
    Duration 00:00:02
    Sql Severity 0
    Sql Message ID 0
    Operator Emailed
    Operator Net sent
    Operator Paged
    Retries Attempted 0
    Message
    Executed as user: service_account Microsoft (R) SQL Server Execute Package Utility  Version 10.50.4286.0 for 64-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.    Started:  12:47:09  Error: 2014-04-16 12:47:11.45
        Code: 0xC0202070     Source: bw_import_cust_master_data Connection manager "Input"     Description: The file name property is not valid. The file name is a device or contains invalid characters.  End Error  Error:
    2014-04-16 12:47:11.47     Code: 0xC0202070     Source: bw_import_cust_master_data Connection manager "Input"     Description: The file name property is not valid. The file name is a device or contains invalid characters.  End
    Error  Error: 2014-04-16 12:47:11.48     Code: 0xC0202070     Source: bw_import_cust_master_data Connection manager "Input"     Description: The file name property is not valid. The file name is a device or contains invalid
    characters.  End Error  Error: 2014-04-16 12:47:11.48     Code: 0xC020207E     Source: Import file Flat File Source [1]     Description: The file name is not valid. The file name is a device or contains invalid characters.
     End Error  Error: 2014-04-16 12:47:11.48     Code: 0xC004701A     Source: Import file SSIS.Pipeline     Description: component "Flat File Source" (1) failed the pre-execute phase and returned error code 0xC020207E.
     End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  12:47:09  Finished: 12:47:11  Elapsed:  2.324 seconds.  The package execution failed.  The step failed.
    MCP

  • How do I fix the compatibility issue between my iPhone 4S with iOS 7 and my Pioneer car stereo? There was no problem with iOS 6, but now I get a message saying "this device is not compatible" and so I can't use Netflix for example. How do I fix it?

    How do I fix the compatibility issue between my iPhone 4S with iOS 7 and my Pioneer car stereo? There was no problem with iOS 6, but now I get a message saying "this device is not compatible" and so I can't use Netflix for example. How do I fix it?

    This is a typical response from the manufacturer. Did you try the fix that Lawrence mentioned. When Apple or any other phone manufacturer update phone software, they have the latest Bluetooth installed. It is usually the problem with the radio manufacturer that they devices are using the older Bluetooth protocols. You can try this support document http://support.apple.com/kb/TS3581 and see if anything there helps, but generally it requires the radio manufacturer to update their firmware.

  • MacBook Pro Health and safety issue: Potential Burn during normal use

    Hi,
    I am not a complainer. I worked for Apple of 6+ years and have had a top of the line Apple Notebook since Apple created the concept of the laptop notebook.
    I recently experienced a 3rd degree burn using my MacBook Pro that I think Apple needs to warn folks about:
    MacBook Pro 17"
    Machine Model: MacBookPro1,2
    CPU Type: Intel Core Duo
    Number Of Cores: 2
    CPU Speed: 2.16 GHz
    L2 Cache (shared): 2 MB
    Memory: 2 GB
    Bus Speed: 667 MHz
    Boot ROM Version: MBP12.0061.B00
    Serial Number: ()
    SMC Version: 1.5f10
    Sudden Motion Sensor:
    State: Enabled
    I had my laptop on my lap. I was wearing shorts. It noticed that it was warm on my leg where the left side of the MacBook Pro was touching my leg, but it didn't create a reflex pain response.
    Upon completing my session, when I closed the machine and put it away, I noticed a 1 inch x .75 inch blister on my leg where it had been touching the MacBook/Pro; and it has turn out to be a significant burn.
    I checked all the documentaiton that came with my MacBook Pro and there was no warning about the potential of this situation.
    I recommend that Apple let owners know, perhaps through an email or a popup when they visit the Apple site. Lastly, when I encountered this issue, I wasn't running any high performance, compute bound applications. It was email. So, I have to believe that it is possible to detect wait states within the processes running and take the processors to a low power mode of operation when they are not performing actual work. Am I out in left field here?
    I want Apple to be successful. I haven't heard of a similar complaint on any of the high performance PC's at work. Beyond a Health and Safety issue, this is also a reputation issue. Better to face into the storm and honestly deal with this issue.
    A slightly crisp, but loyal, MacBook Pro user.
    Mike Doherty
    MacBook Pro Mac OS X (10.4.5) Potential Health and Safety Issue- 3rd degreee burn potential under normal use

    Mike... I do sympathize with your situation but let me correct you:
    I recently experienced a 3rd degree burn using my
    MacBook Pro
    Do you know what a 3rd degree burn is? A 3rd degree burn involves the dermis, and is full thickness involving the subcutaneous tissues and fat underneath your skin layers. This is something that usually happens when man meets fire, electrocution, and chemical burns. A 3rd degree burn is not typically achieved by a simple transfer of energy by conduction, unless extreme heat for an extended period of time.
    I had my laptop on my lap. I was wearing shorts. It
    noticed that it was warm on my leg where the left
    side of the MacBook Pro was touching my leg, but it
    didn't create a reflex pain response.
    Reflex pain response? Don't try to make up medical terminology. You didn't feel it much like you don't feel the sun when you get a sunburn initially... your skin slowly adjusted to the temperature, and at some point the heat increased over the threshold of which causes damage. You should have gone to the doctor if you were overly concerned.
    Upon completing my session, when I closed the machine
    and put it away, I noticed a 1 inch x .75 inch
    blister on my leg where it had been touching the
    MacBook/Pro; and it has turn out to be a significant
    burn.
    You're right, if you have a 1inch by almost 1 inch heat related blister on your leg, it is bad, nothing that I would consider significant. That is less then 1% of your body, probably about 0.25% to 0.5%, and only a 2nd degree burn. Your most significant complication would be a local skin infection.
    I checked all the documentaiton that came with my
    MacBook Pro and there was no warning about the
    potential of this situation.
    Actually... I'd hate to call you a liar, but I'm pretty sure that it does warn about burns.
    To confirm this, apple has also information online:
    http://docs.info.apple.com/article.html?artnum=30612
    I recommend that Apple let owners know, perhaps
    through an email or a popup when they visit the Apple
    site.
    They do... link above.
    Lastly, when I encountered this issue, I wasn't
    running any high performance, compute bound
    applications. It was email. So, I have to believe
    that it is possible to detect wait states within the
    processes running and take the processors to a low
    power mode of operation when they are not performing
    actual work. Am I out in left field here?
    No, you're definitely not. Here's where I start to agree with you. For the computer to heat up that much, when not doing things like rendering video is abnormal, and you deserve to have apple check out your computer. I think you should contact them on this concern.
    I want Apple to be successful. I haven't heard of a
    similar complaint on any of the high performance PC's
    at work. Beyond a Health and Safety issue, this is
    also a reputation issue. Better to face into the
    storm and honestly deal with this issue.
    It's harder for other manufacturers... our computers are aluminum, designed to disperse the heat. Technically they are considered "portables" not laptops, but I don't get into that argument because I disagree with the word "portable"... it's meant to work on your lap, and if you can't comfortably using regular apps, you deserve an answer.
    A slightly crisp, but loyal, MacBook Pro user.
    Hey, at least you're taking it with some humor. It's a shame you had to get hurt as a result of your computer. If I were you I would have gone to your Primary Care Physician, documented the burn, and returned your computer for a new one, and for something say, a free iPod for your pain.
    Sorry you got hurt, I think you should have your heat issue professionally investigated through apple care

  • I've been using LR with my Nikon D3200 for a year or so. Shooting in RAW/NEF no issues with import etc until I updated LR and now I can't get LR to allow me to select when I try to import. It does show the images but they're grayed out and not able to be

    I've been using LR with my Nikon D3200 for a year or so. Shooting in RAW/NEF no issues with import etc until I updated LR and now I can't get LR to allow me to select when I try to import. It does show the images but they're grayed out and not able to be selected. Any thoughts? TIA

    Greyed imaged in the Import dialog box mean you have already imported the photos into Lightroom, so there is no need and no benefit to importing them a second time.
    Just go to the Library module, search for the desired photos, and resume working on these photos.

  • HT200189 VPN server update actually did not solve my issue on 10.9.1 using Server 3.0.2

    The aforementioned fix actually did not solve my issue on 10.9.1 using Server 3.0.2. Any other suggestions? I also see that the VPN service cannot be shut down. After sliding to off, it gives no message and automatically slides to On again...

    In my case I managed to fix it by means of this article:
    http://jonsview.com/how-to-setup-os-x-10-9-as-a-l2tp-vpn-server-without-apples-s erver-app
    And then especially the part about using an old version of Racoon (from Mountain Lion for example) to replace the current apparent defunct one in Mavericks...

  • What issues can i run into using HR_PSBUFFER_INITIALIZE

    Hi
    we are going to add FM "HR_PSBUFFER_INITIALIZE" with "HR_INFOTYPE_OPERATION", for improving the perofrmance...as this FM is buffering the data and doing some EXPORT to memory. The result of this is that after a few hundred calls to HR_INFOTYPE_OPERATION the buffer gets big enough to impact the performance of the function module. After thousand of updates with HR_INFOTYPE_OPERATION , each call will take many seconds and your ABAP program will be unusable.
    but i am concerned looking at [this thread|; ...can someone elaborate on issues we may face with using HR_PSBUFFER_INITIALIZE?
    Especially in the above thread it is said that
    it wrecks havoc when we are trying to update records which are related to eachother
    this is little unclear, what does it mean?
    thanks in advance

    check if OSS Note #956700 can help

  • Goods Issue Configuration - Account 330001 already used in transaction BSX

    Dear All Experts,
    I am configuring OBYC for Goods Issue scnario. When I am putting Stock account  and this error I am getting
    Account 330001 already used in transaction BSX
    Message no. F4803
    Diagnosis
    Accounts used in transaction BSX (posting to asset balance sheet account) cannot be used in any other account determination. Account 330001 (chart of accounts 4000) is already being used in transaction BSX.
    System Response
    You cannot use account 330001 here.
    Procedure
    Correct your entry.
    Assumption : My assumption is, the debiting stock accout at the time of GR is CREDITED while issuing goods for production through MB1A. But getting above error while mapping.
    Is there any other logic behind mapping ? I gone through the threads from SDN itself I got some idea about GI. The accounting entries which are posted are like as below :
    Consumption Raw Material A/c     Dr
          Inventory Raw Material        Cr
    Does this mean while issuing goods we should not use BSX STOCK account in GBB ?   In above entry are these P & L account or Balance sheet account ? 
    Expert guidance will be vert appreciable !
    Regards,
    Revati Joshi.

    Dear Murali.
    Thank you for reply.
    Have a look at configuration which I have done.
    Rules
    Debit / Credit - Not ticked.
    General Modification - Ticked
    Valuation Modif - Ticked.
    Valuation Class - Ticked.
    Accounts
    Valuation Modifier - 0001
    General Modification - VBR
    Valuation Class - 3030
    Account - 750034 ( Consumption Account) which will be debiting while GI.
    1 ) From where system will pick the Stock Account ?  2 ) Is this above configuration correct ?
    Regards,
    Revati Joshi.

  • Do we have some way to reduce Dimension table size using NLS?

      Initially we thought the Cube
         archive in NLS would be like:
    Replicate Cube in NLS with DAP.  DAP creation will create a new structure same like "Star Schema".
    While we load data to NLS it deletes from DB.
    And hence it reduced size of the DB.
    Associated Dimensions will also be replicated in the NLS.
    After actually implementation we found :
    Fact table size is reducing and DB size with associated E/F fact table is reducing
    Dimension tables are still there in DB, and still saving space in DB.
    Do we have some other way to reduce Dimension table size using NLS?
    As when we are analyzing top 100 tables in SAP BW, we are seeing multiple dimensions are part
    of this list.
    Thanks,
    Jaydip

    Hi Jaydip,
    Please check below link it might be helpful for you.
    http://www.informatik.uni-jena.de/dbis/lehre/ss2011/dbarch/SAP_BW_DB2_NLS_22062011.pdf

Maybe you are looking for