Search Results

Search found 207 results on 9 pages for 'ravi nikam'.

Page 1/9 | 1 2 3 4 5 6 7 8 9  | Next Page >

  • Difference in output from use of synchronized keyword and join()

    - by user2964080
    I have 2 classes, public class Account { private int balance = 50; public int getBalance() { return balance; } public void withdraw(int amt){ this.balance -= amt; } } and public class DangerousAccount implements Runnable{ private Account acct = new Account(); public static void main(String[] args) throws InterruptedException{ DangerousAccount target = new DangerousAccount(); Thread t1 = new Thread(target); Thread t2 = new Thread(target); t1.setName("Ravi"); t2.setName("Prakash"); t1.start(); /* #1 t1.join(); */ t2.start(); } public void run(){ for(int i=0; i<5; i++){ makeWithdrawl(10); if(acct.getBalance() < 0) System.out.println("Account Overdrawn"); } } public void makeWithdrawl(int amt){ if(acct.getBalance() >= amt){ System.out.println(Thread.currentThread().getName() + " is going to withdraw"); try{ Thread.sleep(500); }catch(InterruptedException e){ e.printStackTrace(); } acct.withdraw(amt); System.out.println(Thread.currentThread().getName() + " has finished the withdrawl"); }else{ System.out.println("Not Enough Money For " + Thread.currentThread().getName() + " to withdraw"); } } } I tried adding synchronized keyword in makeWithdrawl method public synchronized void makeWithdrawl(int amt){ and I keep getting this output as many times I try Ravi is going to withdraw Ravi has finished the withdrawl Ravi is going to withdraw Ravi has finished the withdrawl Ravi is going to withdraw Ravi has finished the withdrawl Ravi is going to withdraw Ravi has finished the withdrawl Ravi is going to withdraw Ravi has finished the withdrawl Not Enough Money For Prakash to withdraw Not Enough Money For Prakash to withdraw Not Enough Money For Prakash to withdraw Not Enough Money For Prakash to withdraw Not Enough Money For Prakash to withdraw This shows that only Thread t1 is working... If I un-comment the the line saying t1.join(); I get the same output. So how does synchronized differ from join() ? If I don't use synchronize keyword or join() I get various outputs like Ravi is going to withdraw Prakash is going to withdraw Prakash has finished the withdrawl Ravi has finished the withdrawl Prakash is going to withdraw Ravi is going to withdraw Prakash has finished the withdrawl Ravi has finished the withdrawl Prakash is going to withdraw Ravi is going to withdraw Prakash has finished the withdrawl Ravi has finished the withdrawl Account Overdrawn Account Overdrawn Not Enough Money For Ravi to withdraw Account Overdrawn Not Enough Money For Prakash to withdraw Account Overdrawn Not Enough Money For Ravi to withdraw Account Overdrawn Not Enough Money For Prakash to withdraw Account Overdrawn So how does the output from synchronized differ from join() ?

    Read the article

  • XAMPP pointing a file outside root folder

    - by Ravi
    I am using XAMPP for first time in Mac. Running out problems accessing other than root folder(htdocs).when I am placing my web application inside htdocs with default httpd.conf file it works when I try to point my web application url in httpd.conf it throws error I am aware that to modify the root folder I need to do changes to my XAMPP/etc/httpd.conf file With Default XAMPP MAC Settings, I am trying to change Server root,Document root and Directory in XAMPP/etc/httpd.conf file the following ServerRoot "/Users/ravi/Documents/Development/Backbone/backboneboilerplate" DocumentRoot "/Users/ravi/Documents/Development/Backbone/backboneboilerplate" <Directory /> Options FollowSymLinks AllowOverride All Order deny,allow Deny from all </Directory> <Directory "/Users/ravi/Documents/Development/Backbone/backboneboilerplate"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> its throwing error when trying to start XAMPP httpd: Syntax error on line 54 of /Applications/XAMPP/xamppfiles/etc/httpd.conf: Cannot load /Users/ravi/Documents/Development/Backbone/backboneboilerplate/modules/mod_authn_file.so into server: cannot create object file image or add library

    Read the article

  • md5sum returns a different hash value than online hash generators

    - by Ravi
    On suse10, md5sum myname gives md5 hash as 49b0939cb2db9d21b038b7f7d453cd5d The file myname contains string "ravi" while some of the online md5 hash generators for the same string seem to give a different hash http://md5-encryption.com/ http://www.miraclesalad.com/webtools/md5.php They spit out the hash for "ravi" as 63dd3e154ca6d948fc380fa576343ba6 Why is there a difference in md5sum for the same string "ravi" ?

    Read the article

  • Unable to access other Volume in Vaio E series

    - by Rahul Ravi Kumar Shah
    Error mounting /dev/sda6 at /media/ravi/New Volume: mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda6" "/media/ravi/New Volume" Exited with: non-zero exit status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda6': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.

    Read the article

  • Jdk 6.0 update 6 installed sucessfully but java command not working

    - by Ravi.Kumar
    I switched to linux (Ubuntu 12.04) this morning and find it great but messed up while installing java. :-(. I have installed jdk6.0_6 successfully but when I run java command in terminal, I get this ravi@ravi-LIFEBOOK-AH531:~$ java The program 'java' can be found in the following packages: * default-jre * gcj-4.6-jre-headless * openjdk-6-jre-headless * gcj-4.5-jre-headless * openjdk-7-jre-headless Try: sudo apt-get install <selected package> Could someone help me with this? Below are the steps that I followed to install: copied file named jdk-6u6-linux-x64.bin to my documents from terminal executed chmod a+x jdk-6u6-linux-x64.bin and then executed sudo ./jdk-6u6-linux-x64.bin In terminal I accepted the license agreement and done.

    Read the article

  • Stored procedure strange error when called through php

    - by ravi
    I have been coding a registration page(login system) in php and mysql for a website. I'm using two stored procedures for the same. First stored procedure checks wether the email address already exists in database.Second one inserts the user supplied data into mysql database. User has EXECUTE permission on both the procedures.When is execute them individually from php script they work fine. But when i use them together in script second Stored procedure(insert) not working. Stored procedure 1. DELIMITER $$ CREATE PROCEDURE reg_check_email(email VARCHAR(80)) BEGIN SET @email = email; SET @sql = 'SELECT email FROM user_account WHERE user_account.email=?'; PREPARE stmt FROM @sql; EXECUTE stmt USING @email; END$$ DELIMITER; Stored procedure 2 DELIMITER $$ CREATE PROCEDURE reg_insert_into_db(fname VARCHAR(40), lname VARCHAR(40), email VARCHAR(80), pass VARBINARY(32), licenseno VARCHAR(80), mobileno VARCHAR(10)) BEGIN SET @fname = fname, @lname = lname, @email = email, @pass = pass, @licenseno = licenseno, @mobileno = mobileno; SET @sql = 'INSERT INTO user_account(email,pass,last_name,license_no,phone_no) VALUES(?,?,?,?,?)'; PREPARE stmt FROM @sql; EXECUTE stmt USING @email,@pass,@lname,@licenseno,@mobileno; END$$ DELIMITER; When i test these from php sample script insert is not working , but first stored procedure(reg_check_email()) is working. If i comment off first one(reg_check_email), second stored procedure(reg_insert_into_db) is working fine. <?php require("/wamp/mysql.inc.php"); $r = mysqli_query($dbc,"CALL reg_check_email('[email protected]')"); $rows = mysqli_num_rows($r); if($rows == 0) { $r = mysqli_query($dbc,"CALL reg_insert_into_db('a','b','[email protected]','c','d','e')"); } ?> i'm unable to figure out the mistake. Thanks in advance, ravi.

    Read the article

  • Comma seprated search in mysql query

    - by Ravi Kotwani
    I have search mechanism in my site. For that I have written a large conditional query. $sql = "select * from users where keyword like '%".$_POST['search']."%' OR name like '%".$_POST['search']."%'"; Now, I suppose I have following data on the site: ID Name Keyword 1 Sanjay sanjay, surani 2 Ankit ankit, shah 3 Ravi ravi, kotwani Now, I need the result such that when user writes "sanjay, shah" ($_POST['search'] = 'sanjay, shah') then records 1 and 2 should be displayed. Can I achive this in single mysql query?

    Read the article

  • How do I modify the noacpi option?

    - by Sagar Ratnakara Nikam
    I am new to ubuntu and have stared using it since a week. I installed ubuntu server 11.10 on a VM created using VMWare player. Once installed, i tried to install ubuntu desktop using sudo apt-get install --no-install-recommends ubuntu-desktop Now I am unable to boot and i get the following error *PulseAudio configured per-user session After this, nothing happens and the ubuntu server does not boot. I read in another Q&A, the same problem and the solution. Just Installed a CLI system then ubuntu-desktop, does not boot automatically My question is how to modify noacpi option. How do i get into the boot for the ubuntu server? I have read on the net that by hitting the shift button, we can get into the boot options. I tried that, but no success, probably since i am running ubuntu on VMWare Player. Please guide me on how to solve this problem

    Read the article

  • regular expression to remove original message from reply mail using in java ?

    - by ravi ravi
    In my forum, users can reply through email. I am handling mails from their reply. When they are replying the original message getting appended. I want to get only the reply message not the original message. I have to write regular expression for gmail & hotmail. I written regex for gmail as follows : \n.wrote:(?s).--End of Post-- It is removing the original message except date. I want to remove the date also. before removing the original message : " hi 33 On Tue, May 11, 2010 at 4:18 PM, Mmmmm, Rrrrr wrote: The following update has been posted to this discussion: test as user 222 [$MESSAGE_SIGNATURE_HEADER$] --End of Post-- " When I use the above regex it is filtering as follows : " hi 33 On Tue, May 11, 2010 at 4:18 PM, Mmmmm, Rrrrr " Here i want only the actual message 'hi 33' not that date. How can I filter the date using above regex? Also I need regex for Hotmail also. I appreciate for any reply. Thanks in advance.

    Read the article

  • iTunes resizing photos on sync.

    - by Ravi
    Hi All, When I synch my photos into iPhone/iPod through iTunes the photos are being resized to smaller ones. I need to get high resolution images without being resized into the device. Is there any way to do this other than saving images from mail or from browser etc ?. Thanks, Ravi

    Read the article

  • upgrade from windows server 2008 r2 std to enterprise

    - by Ravi
    We recently had to upgrade our servers from Win 2008 R2 Standard to Enterprise. The upgrade method was DISM. After the upgrade, a lot of weird things started to happen. Though Windows says it's been properly activated, we lost 1) RDP settings (disappeared from the Remote Setting tab of Properties of My Computer) 2) The option to join a domain is grayed out 3) The server had to 2 physical processors 12 cores each. Now, task manager or windows sees only 1 processor (or only 12 cores) 4) the amount of physical ram on this sever is 32 GB (Windows reports only 4 GB are usable) Has anyone encountered this before ? Thanks Ravi

    Read the article

  • MS Excel XML Header Footer

    - by Ravi
    Hello All, I'm generating a excel report in a XML Excel format. In this report I have to repeat the top 25 rows and bottom 10 rows on each page, like a header and a footer. Can you please guide me on the code that is required to accomplish this task. I'm using ColdFusion. Thank you. Ravi

    Read the article

  • Issues Migrating Ejb 2.0 from jboss 4 to jboss 5.1

    - by Ravi
    Deploying an EAR application in jboss 5.1 throws an error. Below is the error The content of element type "message-driven" must match "(description?,display-name?,small- icon?,large-icon?,ejb-name,ejb-class,transaction-type,message-selector?,acknowledge- mode?,message-driven-destination?,env-entry*,ejb-ref*,ejb-local-ref*,security-identity?,resource- ref*,resource-env-ref*)". This EAR application worked in JBoss 4.0.2, but not working on Jboss 5.1 Thanks Ravi S

    Read the article

  • triggering onchange event

    - by Ravi
    Hello All, I'm not able to get the below code to work. $("#grid_table td:nth-child(10) input").live("onchange",function () { alert("changed"); }); am I missing something here? Thanks. Ravi

    Read the article

  • Communicating to SAP XI through .NET - IDOC XML

    - by RAVI KOTA
    Hi Friends, I have a situation where in we need to send IDOC things to SAP XI from .NET application. It is like both sending and receiving. I guess that it is having something connected to translate IDoc to XML and vice versa and then communicate. Can you just some technical knowledge on how to achieve this communication between SAP XI and .NET for IDOCs Many thanks, Ravi Kota

    Read the article

  • ComboBox in Flex

    - by Ravi K Chowdary
    Hi, I have a combobox with multi selection. when i click on add button, which ever data is selected in the Combobox, those data has to be displayed in the another comboBox. Please check the code and Can anyone of you please help me on this. "/ Thanks, Ravi

    Read the article

  • Conversion from jpg to gif with reduced size

    - by Ravi
    Hello, This is nice code. But it is uncertain. I am trying with jpg to gif conversion. With some images it reduces the size and with some images it increase the size. Can you help me that how can i get the reduced sized gif from jpg. Thanks, ravi

    Read the article

  • Knockout.js mapping plugin with require.js

    - by Ravi
    What is the standard way of loading mapping plugin in require.js ? Below is my config.js (require.js config file) require.config({ // Initialize the application with the main application file. deps:["app"], paths:{ // JavaScript folders. libs:"lib", plugins:"lib/plugin", templates:"../templates", // Libraries. jquery:"lib/jquery-1.7.2.min", underscore:"lib/lodash", text:'text', order:'order', knockout:"lib/knockout", knockoutmapping:"lib/plugin/knockout-mapping" }, shim:{ underscore:{ exports:'_' }, knockout:{ deps:["jquery"], exports:"knockout" } } } In my view model define(['knockout', 'knockoutmapping'], function(ko, mapping) { } However, mapping is not bound to ko.mapping. Any pointers/suggestions would be appreciated. Thanks, Ravi

    Read the article

  • Advanced Data Grid sorting

    - by Ravi K Chowdary
    Hi, I have using AdvancedDataGrid and using sorting fucntionality. By default the grid sorting is decending. I want to make a sorting is ascending. I write a sorting function and click on the header on the advanced datagrid, the first and second time it is not working ,it is working on thrid time. It is not remembering the first sorting call. It is remember the call after 3 clicks. Please any one of you can answer it asap. Thanks, ravi

    Read the article

  • Multi Action with Form design streatgy

    - by Ravi
    Hello All, I want to have a controller that can handle multiple requests. Like a UserController handling all the addUser, deleteUser, updateUser and viewUser functionality. I know that MultiActionController can be used to bundle multiple similar request into one controller. But the functionalities like addUser and updateUser involves user to enter data, which the controller need to process. Can a MultiActionController handle doSubmit kind of methods (similar to SimpleFormController). Is there any better way to handle this kind of scenario? Thanks. Ravi

    Read the article

  • Best way to fetch data from a single database table with multiple threads?

    - by Ravi Bhatt
    Hi, we have a system where we collect data every second on user activity on multiple web sites. we dump that data into a database X (say MS SQL Server). we now need to fetch data from this single table from daatbase X and insert into database Y (say mySql). we want to fetch time based data from database X through multiple threads so that we fetch as fast as we can. Once fetched and stored in database Y, we will delete data from database X. Are there any best practices on this sort of design? any specific things to take care on table design like sharing or something? Are there any other things that we need to take care to make sure we fetch it as fast as we can from threads running on multiple machines? Thanks in advance! Ravi

    Read the article

  • Oracle Database Appliance Setup Poster Updated

    - by Ravi.Sharma
    The newly updated Setup Poster for Oracle Database Appliance is now available at http://wd0338.oracle.com/archive/cd_ns/E22693_01/index.htm This updated poster is a comprehensive source of information for anyone planning to deploy Oracle Database Appliance. It includes two main sections (which are conveniently printed on the two sides of a single 11x17 page) 1. Preparing to Deploy Oracle Database Appliance2. Oracle Database Appliance Setup The Preparing to Deploy Oracle Database Appliance section provides a concise list of items to plan for and review before beginning deployment. This includes registering Support Identifiers, allocating IP addresses, downloading software and patches, choosing configuration options, as well as important links to useful information. The Oracle Database Appliance Setup section provides a step by step procedure for deploying and configuring Oracle Database Appliance. This includes initial powering up of Oracle Database Appliance, configuring initial network, downloading software and completing the configuration using Oracle Database Appliance Configurator (GUI)  

    Read the article

  • Full text search with Sphider

    - by Ravi Gupta
    I am searching for a good, light weight, open source, full text search engine for php. I came across a number of options like Lucene, Zend Lucene, Solr etc but at the same time I also find out many people suggesting Sphider for small/medium side websites. I looked at shipder website a lot but unable to find out how to use it as a Full Text Search Engine.If anybody worked on it could help me to figure out whether it supports full text search or not. Edit: Please don't suggest any other alternatives for full text search.

    Read the article

1 2 3 4 5 6 7 8 9  | Next Page >