Search Results

Search found 262 results on 11 pages for 'sujit singh'.

Page 6/11 | < Previous Page | 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Java Memory Management

    - by Tara Singh
    I am designing a client-server chat application in Java. This is a secure application where the messages are exchanged using cryptographic algorithms. I have one server and it can support many clients. My problem is that when one client logs on the server it works fine, but when another user logs into the system, the server starts giving me bad padding exceptions for the encrypted text. I am not able to figure out the problem, according to my logic, when new connection request to server is made, the server creates a thread for listening to the client. Is it possible that once the instance of thread class is created, it does all the processing correctly for the first client, but not for the second client because the variables in server listener thread class already have some previous value, and thus the encrypted text is not decrypted properly? Please advise how I can make this process more robust so that the number of clients does not affect how well the server functions.

    Read the article

  • Issues while downloading document from Sharepoint using JAVA

    - by Deepak Singh Rawat
    I am trying to download a file from Sharepoint 2007 sp2 document library using GetItem method of the Copy webservice. I am facing the following issues : In the local instance ( Windows Vista ) I can save only 10.5 Kb of any file. The webservice is returning only 10.5 Kb of data for any file. On the production server, I am able to List the documents using some credentials but when I am trying to download a document using the same credentials I get a 401 : Unauthorized message. I can download the document using the Sharepoint website successfully.

    Read the article

  • select option in Safari ?

    - by Karandeep Singh
    < select size="2" multiple> < option value="1">1< /option> < option value="2">2< /option> < option value="3">3< /option> < option value="4">4< /option> < option value="5">5< /option> < option value="6">6< /option> < option value="7">7< /option> < option value="8">8< /option> < option value="9">9< /option> < option value="10">10< /option> < option value="11">11< /option> < option value="12">12< /option> < option value="13">13< /option> < /select> size attribute of Select tag is not working properly in Safari. if size attribute's value is greater than four then there have no problem, its working. But when I set the value of size less than four then it show four values. above example displays four options in safari but I want two options. What is the reason for this ?

    Read the article

  • conditional update records mysql query

    - by Shakti Singh
    Hi, Is there any single msql query which can update customer DOB? I want to update the DOB of those customers which have DOB greater than current date. example:- if a customer have dob 2034 update it to 1934 , if have 2068 updated with 1968. There was a bug in my system if you enter date less than 1970 it was storing it as 2070. The bug is solved now but what about the customers which have wrong DOB. So I have to update their DOB. All customers are stored in customer_entity table and the entity_id is the customer_id Details is as follows:- desc customer_entity -> ; +------------------+----------------------+------+-----+---------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+----------------------+------+-----+---------------------+----------------+ | entity_id | int(10) unsigned | NO | PRI | NULL | auto_increment | | entity_type_id | smallint(8) unsigned | NO | MUL | 0 | | | attribute_set_id | smallint(5) unsigned | NO | | 0 | | | website_id | smallint(5) unsigned | YES | MUL | NULL | | | email | varchar(255) | NO | MUL | | | | group_id | smallint(3) unsigned | NO | | 0 | | | increment_id | varchar(50) | NO | | | | | store_id | smallint(5) unsigned | YES | MUL | 0 | | | created_at | datetime | NO | | 0000-00-00 00:00:00 | | | updated_at | datetime | NO | | 0000-00-00 00:00:00 | | | is_active | tinyint(1) unsigned | NO | | 1 | | +------------------+----------------------+------+-----+---------------------+----------------+ 11 rows in set (0.00 sec) And the DOB is stored in the customer_entity_datetime table the column value contain the DOB. but in this table values of all other attribute are also stored such as fname,lname etc. So the attribute_id with value 11 is DOB attribute. mysql> desc customer_entity_datetime; +----------------+----------------------+------+-----+---------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------+----------------------+------+-----+---------------------+----------------+ | value_id | int(11) | NO | PRI | NULL | auto_increment | | entity_type_id | smallint(8) unsigned | NO | MUL | 0 | | | attribute_id | smallint(5) unsigned | NO | MUL | 0 | | | entity_id | int(10) unsigned | NO | MUL | 0 | | | value | datetime | NO | | 0000-00-00 00:00:00 | | +----------------+----------------------+------+-----+---------------------+----------------+ 5 rows in set (0.01 sec) Thanks.

    Read the article

  • How can we call an activity through service in android???

    - by Shalini Singh
    Hi! friends, i am a android developer,,, want to know is it possible to call an activity through background service in android like : import android.app.Service; import android.content.Intent; import android.content.SharedPreferences; import android.media.MediaPlayer; import android.os.Handler; import android.os.IBinder; import android.os.Message; public class background extends Service{ private int timer1; @Override public void onCreate() { // TODO Auto-generated method stub super.onCreate(); SharedPreferences preferences = getSharedPreferences("SaveTime", MODE_PRIVATE); timer1 = preferences.getInt("time", 0); startservice(); } @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } private void startservice() { Handler handler = new Handler(); handler.postDelayed(new Runnable(){ public void run() { mediaPlayerPlay.sendEmptyMessage(0); } }, timer1*60*1000); } private Handler mediaPlayerPlay = new Handler(){ @Override public void handleMessage(Message msg) { try { getApplication(); MediaPlayer mp = new MediaPlayer(); mp = MediaPlayer.create(background.this, R.raw.alarm); mp.start(); } catch(Exception e) { e.printStackTrace(); } super.handleMessage(msg); } }; /* * (non-Javadoc) * * @see android.app.Service#onDestroy() */ @Override public void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } } i want to call my activity......

    Read the article

  • Source control on internet i.e. no private networks.

    - by Kavitesh Singh
    Me and my friend are in the process of starting a small project and want to implement a source control. Now both are located in different cities and can communicate using internet for file sharing etc. I need an online hosting solution or any way where i can maintain the source code repository for both of us to check in/out. As of now we want to maintain it as private project. Does sourceforge allow hosting projects which would not be opensource? One option i was thinking, to obtain a static IP form ISP and host the repository.But that mean my system needs to be online when my friend wants to checkin/out or do some diff with old version code. Secondly, would SVN or git be a better choice in such a situation. I have no experience in git/mercurial as of now.

    Read the article

  • calling background service from BroadcastReceiver....

    - by Shalini Singh
    Hi , i am trying to call a push notification background from BroadcastReceiver class.but my application is going to crash the code is given bellow public class AlarmReceiver extends BroadcastReceiver { Context ctx; static int count=1; @Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub //Toast.makeText(context, "working"+count, Toast.LENGTH_LONG).show(); count++; Log.e("broadcast***","receiver"); Intent myIntent=new Intent(context,NotifyService.class); myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(myIntent); } } * manifest entry:- <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"/> </intent-filter> </receiver> Error: 05-24 15:17:00.042: ERROR/AndroidRuntime(424): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.alarm/com.android.alarm.NotifyService}; have you declared this activity in your AndroidManifest.xml? Please help me....

    Read the article

  • php switch statement error on int = 0

    - by Jagdeep Singh
    I am having a problem in php switch case. When i set $number=0 it should run very first case but here this code returns 10-20K that is in second case. I checked comparison operators, tested them in if else case they return correct values but here first case do not run on $number=0 Why is this happening ? php consider 0 as false or something wrong in code ? Link to codepad paste http://codepad.org/2glDh39K also here is the code <?php $number = 0; switch ($number) { case ($number <= 10000): echo "0-10K"; break; case ($number > 10000 && $number <= 20000): echo "10-20K"; break; case ($number > 20000 && $number <= 30000): echo "20-30K"; break; case ($number > 30000 && $number <= 40000): echo "30-40K"; break; case ($number > 40000 && $number <= 50000): echo "40-50K"; break; case ($number > 50000 && $number <= 60000): echo "50-60K"; break; case ($number > 60000 && $number <= 70000): echo "60-70K"; break; case ($number > 70000 && $number <= 80000): echo "70-80K"; break; case ($number > 80000 && $number <= 90000): echo "80-90K"; break; case ($number > 90000): echo "90K+"; break; default: //default echo "N/A"; break; } ?>

    Read the article

  • Silverlight Application

    - by Avijit Singh
    I have prepared a Silverlight application and my database is in the server. Its running smoothly for small set of data but for large data set giving an error : Remote Serve returned an error:notFound. How can i resolve it,please any one solve this problem. I have build it in ASP.NET with C#. So kindly provide the solution in C# if possible.

    Read the article

  • Change only Revision number in AssemblyInfo.cs with msbuild FileUpdate task

    - by Divya mohan Singh
    I need to change only the revision number of an AssemblyInfo.cs file. The version number is in the format Major.Minor.Build.Revision e.g. 1.4.6.0. Currently I change the version with the FileUpdate task (from the MSBuild Community Tasks Project) and the following regex: <FileUpdate Files="@(AssemblyResult)" Regex='(\[\s*assembly:\s*AssemblyVersion\(\s*"[^\.]+\.[^\.]+)\.([^\.]+)(\.)([^\.]+)("\)\s*\])' ReplacementText='[assembly: AssemblyVersion("$(AssemblyMajorNumber).$(AssemblyMinorNumber).$(AssemblyBuildNumber).$(Revision)")]' /> Now I need to update only the revision number and leave major,minor and build unchanged. So, is there any task to do this? Or can it be done with a regex? What would be the regular expression then?

    Read the article

  • Help needed regarding CLCorelocation

    - by yogendra singh
    Hello everybody, i am developing a GPS application in which i needs to track the speed of the device/iphone ,i am using the CLCorelocation API's Locate me referral code provided by Apple my problem is that the LocationManager does not updates the current latitude and longitudes thus i am unable to calculate the distance as well as the speed of the device/iphone. Any kinds of suggestions/code will be highly appreciated please suggest me if i can do something with the Mapkit framework introduced in the sdk 3.0. thanks in advance

    Read the article

  • Trying to insert a row using stored procedured with a parameter binded to an expression.

    - by Arvind Singh
    Environment: asp.net 3.5 (C# and VB) , Ms-sql server 2005 express Tables Table:tableUser ID (primary key) username Table:userSchedule ID (primary key) thecreator (foreign key = tableUser.ID) other fields I have created a procedure that accepts a parameter username and gets the userid and inserts a row in Table:userSchedule Problem: Using stored procedure with datalist control to only fetch data from the database by passing the current username using statement below works fine protected void SqlDataSourceGetUserID_Selecting(object sender, SqlDataSourceSelectingEventArgs e) { e.Command.Parameters["@CurrentUserName"].Value = Context.User.Identity.Name; } But while inserting using DetailsView it shows error Procedure or function OASNewSchedule has too many arguments specified. I did use protected void SqlDataSourceCreateNewSchedule_Selecting(object sender, SqlDataSourceSelectingEventArgs e) { e.Command.Parameters["@CreatedBy"].Value = Context.User.Identity.Name; } DetailsView properties: autogen fields: off, default mode: insert, it shows all the fields that may not be expected by the procedure like ID (primary key) not required in procedure and CreatedBy (user id ) field . So I tried removing the 2 fields from detailsview and shows error Cannot insert the value NULL into column 'CreatedBy', table 'D:\OAS\OAS\APP_DATA\ASPNETDB.MDF.dbo.OASTest'; column does not allow nulls. INSERT fails. The statement has been terminated. For some reason parameters value is not being set. Can anybody bother to understand this and help?

    Read the article

  • search engine crawling frequency

    - by Aditya Pratap Singh
    I want to design a search engine for news websites ie. download various article pages from these websites, index the pages, and answer search queries on the index. I want a short pseudocode to find an appropriate crawling frequency -- i do not want to crawl too often because the website may not have changed, and do not want to crawl too infrequently because index would then be out of date. Assume that crawling code looks as follows while(1) { sleep(sleep_interval); // sleep for sleep_interval crawl(website); // crawls the entire website diff = diff(currently_crawled_website, previously_crawled_website); // returns a % value of difference between the latest and previous crawls of the website sleep_interval = infer_sleep_interval(diff, sleep_interval); } looking for a pseudocode for the infer_sleep_interval method: long sleep_interval infer_sleep_interval(int diff_percentage,long previous_sleep_interval) { ... ... ... } i want to design method which adaptively alters the sleeping interval based on the update frequency of the website.

    Read the article

  • using internationalization on list data

    - by singh
    i am using Struts2 in application. <s:iterator value="listObject"> <s:component template="abc.vm"> <s:param name="text" value="listValue" /> <s:param name="prefix" value="listIndex" /> </s:component> </s:iterator> listValue is a values of list. i am using iterator to traverse the list. now on listValue, i want to put here internationalization concept.so that all the list value can be display based on Locale which store in a list. please suggest!

    Read the article

  • check only one checkbox in gridview using jquery

    - by Gurbax Singh Bhangal
    i have a grid view in which i have placed the checkbox in itemtemplate i want only the one checkbox is selected from Gridview to select that perticular row so that i can use that id to edit or delete the row aspx page code is <asp:TemplateField Visible="false"> <ItemTemplate> <asp:Label ID="lblId" runat="server" Text='<%#Eval("id") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> Select </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="chkSelect" runat="server"/> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> Branch Name </HeaderTemplate> <ItemTemplate> <asp:Label ID="lblBranch_Name" runat="server" Text='<%# Bind("Branch") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> Address </HeaderTemplate> <ItemTemplate> <asp:Label ID="lblAddress" runat="server" Text='<%# Eval("Address") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> City </HeaderTemplate> <ItemTemplate> <asp:Label ID="lblCity" runat="server" Text='<%# Bind("City") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> and i want when i click on the checkbox which is at first of each row only one check box is selected from all the rows thanks

    Read the article

  • Super class variables not printing through sub class

    - by Abhishek Singh
    Can u tell me why this code is not displaying any result on the console. class employee { protected String name; protected double salary; protected String dob; public employee(String name, double salary, String dob) { this.name = name; this.salary = salary; this.dob = dob; } public employee(String name, double salary) { this.name = name; this.salary = salary; } } public class Manage extends employee { String dept1; public Manage(String name, double salary, String dob, String dept1) { super(name, salary, dob); this.dept1 = dept1; } public Manage(String name, double salary, String dept1) { super(name, salary); this.dept1 = dept1; } public static void main(String args[]) { employee e = new employee("Vikas", 122345); employee e2 = new employee("Vikas", 122345, "12-2-1991"); Manage m = (Manage) new Manage("Vikas", 122345, "Sales"); Manage m2 = new Manage("Vikas", 122345, "12-2-1991", "sales"); m.display(); m2.display(); } public void display() { System.out.println("Name " + name); System.out.println("Salary " + salary); System.out.println("Birth " + dob); System.out.println("Department " + dept1); } }

    Read the article

  • Preloading and caching of images in silverlight

    - by Prabhjot Singh
    Hi there I have a silverlight application in vs2010 and iam using silverlight 4.0. I have to show a videoppt in which a video is synchronised with images and it runs as a video powerpoint presentation. Is it possible to preload the images or cache them, so that they get rendered as soon as the video starts. If there is a way out, plz guide me.

    Read the article

  • Lan Chatting system [closed]

    - by jay prakash singh
    Possible Duplicate: LAN chating system or LAN chat server displaying list of user to all the user window my code is i m use RMI so this is the interface declaration public void sendPublicMessage(String keyword, String username, String message) throws RemoteException; public void sendPrivateMessage(String keyword, String username, String message) throws RemoteException; public ArrayList getClientList() throws RemoteException; public void connect(String username) throws RemoteException; public void disconnect(String username) throws RemoteException; } chat Server here connectedUser is the HasMap object we use the follo0wing code for connection here ChatImpl is the stub try { InetAddress Address = InetAddress.getLocalHost(); ChatImpl csi = new ChatImpl(this); Naming.rebind("rmi://"+Address.getHostAddress()+":1099/ChatService", csi); } public ArrayList getClientList() { ArrayList myUser = new ArrayList(); Iterator i = connectedUser.keySet().iterator(); String user = null; while(i.hasNext()) { user = i.next().toString(); myUser.add(user); } return myUser; } public void addClient(Socket clientSocket) throws RemoteException { connectedUser.put(getUsername(), clientSocket); sendPublicMessage(ONLINE, getUsername(), "CLIENT"); } this is the client side code for array list public void updateClient(ArrayList allClientList) throws RemoteException { listClient.clear(); int i = 0; String username; for(i=0; i<allClientList.size(); i++) { username = allClientList.get(i).toString(); listClient.addElement(username); } }

    Read the article

  • Parse a text file into multiple text file

    - by Vijay Kumar Singh
    I want to get multiple file by parsing a input file Through Java. The Input file contains many fasta format of thousands of protein sequence and I want to generate raw format(i.e., without any comma semicolon and without any extra symbol like "", "[", "]" etc) of each protein sequence. A fasta sequence starts form "" symbol followed by description of protein and then sequence of protein. For example ? lcl|NC_000001.10_cdsid_XP_003403591.1 [gene=LOC100652771] [protein=hypothetical protein LOC100652771] [protein_id=XP_003403591.1] [location=join(12190..12227,12595..12721,13403..13639)] MSESINFSHNLGQLLSPPRCVVMPGMPFPSIRSPELQKTTADLDHTLVSVPSVAESLHHPEITFLTAFCL PSFTRSRPLPDRQLHHCLALCPSFALPAGDGVCHGPGLQGSCYKGETQESVESRVLPGPRHRH Like above formate the input file contains 1000s of protein sequence. I have to generate thousands of raw file containing only individual protein sequence without any special symbol or gaps. I have developed the code for it in Java but out put is : Cannot open a file followed by cannot find file. Please help me to solve my problem. Regards Vijay Kumar Garg Varanasi Bharat (India) The code is /*Java code to convert FASTA format to a raw format*/ import java.io.*; import java.util.*; import java.util.regex.*; import java.io.FileInputStream; // java package for using regular expression public class Arrayren { public static void main(String args[]) throws IOException { String a[]=new String[1000]; String b[][] =new String[1000][1000]; /*open the id file*/ try { File f = new File ("input.txt"); //opening the text document containing genbank ids FileInputStream fis = new FileInputStream("input.txt"); //Reading the file contents through inputstream BufferedInputStream bis = new BufferedInputStream(fis); // Writing the contents to a buffered stream DataInputStream dis = new DataInputStream(bis); //Method for reading Java Standard data types String inputline; String line; String separator = System.getProperty("line.separator"); // reads a line till next line operator is found int i=0; while ((inputline=dis.readLine()) != null) { i++; a[i]=inputline; a[i]=a[i].replaceAll(separator,""); //replaces unwanted patterns like /n with space a[i]=a[i].trim(); // trims out if any space is available a[i]=a[i]+".txt"; //takes the file name into an array try // to handle run time error /*take the sequence in to an array*/ { BufferedReader in = new BufferedReader (new FileReader(a[i])); String inline = null; int j=0; while((inline=in.readLine()) != null) { j++; b[i][j]=inline; Pattern q=Pattern.compile(">"); //Compiling the regular expression Matcher n=q.matcher(inline); //creates the matcher for the above pattern if(n.find()) { /*appending the comment line*/ b[i][j]=b[i][j].replaceAll(">gi",""); //identify the pattern and replace it with a space b[i][j]=b[i][j].replaceAll("[a-zA-Z]",""); b[i][j]=b[i][j].replaceAll("|",""); b[i][j]=b[i][j].replaceAll("\\d{1,15}",""); b[i][j]=b[i][j].replaceAll(".",""); b[i][j]=b[i][j].replaceAll("_",""); b[i][j]=b[i][j].replaceAll("\\(",""); b[i][j]=b[i][j].replaceAll("\\)",""); } /*printing the sequence in to a text file*/ b[i][j]=b[i][j].replaceAll(separator,""); b[i][j]=b[i][j].trim(); // trims out if any space is available File create = new File(inputline+"R.txt"); try { if(!create.exists()) { create.createNewFile(); // creates a new file } else { System.out.println("file already exists"); } } catch(IOException e) // to catch the exception and print the error if cannot open a file { System.err.println("cannot create a file"); } BufferedWriter outt = new BufferedWriter(new FileWriter(inputline+"R.txt", true)); outt.write(b[i][j]); // printing the contents to a text file outt.close(); // closing the text file System.out.println(b[i][j]); } } catch(Exception e) { System.out.println("cannot open a file"); } } } catch(Exception ex) // catch the exception and prints the error if cannot find file { System.out.println("cannot find file "); } } } If you provide me correct it will be much easier to understand.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11  | Next Page >