Search Results

Search found 239 results on 10 pages for 'ravi teja'.

Page 1/10 | 1 2 3 4 5 6 7 8 9 10  | 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

  • How to query MySQL for exact length and exact UTF-8 characters

    - by oskarae
    I have table with words dictionary in my language (latvian). CREATE TABLE words ( value varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; And let's say it has 3 words inside: INSERT INTO words (value) VALUES ('teja'); INSERT INTO words (value) VALUES ('vejš'); INSERT INTO words (value) VALUES ('feja'); What I want to do is I want to find all words that is exactly 4 characters long and where second character is 'e' and third character is 'j' For me it feels that correct query would be: SELECT * FROM words WHERE value LIKE '_ej_'; But problem with this query is that it returs not 2 entries ('teja','vejš') but all three. As I understand it is because internally MySQL converts strings to some ASCII representation? Then there is BINARY addition possible for LIKE SELECT * FROM words WHERE value LIKE BINARY '_ej_'; But this also does not return 2 entries ('teja','vejš') but only one ('teja'). I believe this has something to do with UTF-8 2 bytes for non ASCII chars? So question: What MySQL query would return my exact two words ('teja','vejš')? Thank you in advance

    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

  • 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

  • How to install a Logitech c310 webcam?

    - by Teja
    I bought a new Logitech C310 webcam.i dont know how to install webcam on ubuntu.am trying to install this software through the terminal window. wine /media/LWS_2_0/Setup.exe but its showing as fixme:ole:TLB_ReadTypeLib Header type magic 0x00905a4d not supported. err:ole:TLB_ReadTypeLib Loading of typelib L"Z:\\media\\LWS_2_1\\MSetup.exe" failed with error 0 and its opening a window with data as "We have detected you have connected your webcam to a USB1.1 port,for the best performance and full feature set,we suggest using a USB2.0 port" I tried this all the USB ports available in my system.its showing the same error. Please tell me how to install this webcam on ubuntu 11.10. Thanx for reading.

    Read the article

  • Should ATI catalyst be installed for sake of openCL?

    - by G Sree Teja Simha
    I have a HP Envy 4 1025tx with Hybrid graphics. Although this is a 64bit system, I've installed 32bit Ubuntu on it for some reasons.(Hybrid graphics don't do well with 64bit Ubuntu.-"Some one on some forum") I had heating problems with the GPU but I've fixed them all with vgaswitcheroo. But now I wanted to use my Blender on my Ubuntu. To my surprise Blender didn't detect the dedicated 7670m card in my machine. I've confirmed with cat /sys/kernel/debug/vgaswitcheroo/switch Both IGD and DIS were up and running. I dont seem to have libopencl on my /usr/lib even though my synaptic manager says that I have installed it. I'm not quite sure what I've installed. It says that I've installed "ocl-icd-libopencl1". So my question is... Do I have opencl on my system? If not do I have to get propreitary ATI drivers for sake of opencl(fglrx wrecks up my unity totally on my system I need directions to fix it if this is the choice)? Should I get a 64bit Ubuntu installed on this system?

    Read the article

  • Microphone problem in Ubuntu 11.10

    - by Teja
    I am using both Windows 7 and Ubuntu 11.10 on a single system with the same hardware. While I'm making call through Gmail or Skype my voice is audible to others while I'm on Windows 7, but while I'm on Ubuntu 11.10 it's not audible to others, but I am able to hear their voice. But while I'm playing music on Ubuntu along with a call, the others are able to hear the music, but my voice is not audible for them. Please give me a solution for this and tell me where I can change the microphone settings on Ubuntu 11.10.

    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

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