Search Results

Search found 100 results on 4 pages for 'yatendra goel'.

Page 4/4 | < Previous Page | 1 2 3 4 

  • How to implement Administrator rights in Java Application?

    - by Yatendra Goel
    I am developing a Data Modeling Software that is implemented in Java. This application converts the textual data (stored in a database) to graphical form so that users can interpret the data in a more efficient form. Now, this application will be accessed by 3 kinds of persons: 1. Managers (who can fill the database with data and they can also view the visual form of the data after entering the data into the database) 2. Viewers (who can only view the visual form of data that has been filled by managers) 3. Administrators (who can create and manage other administrators, managers and viewers) Now, how to implement 3 diff. views of the same application. Note: Managers, Viewers and Administrators can be located in any part of the world and should access the application through internet. One idea that came in my mind is as follows: Step1: Code all the business logic in EJBs so that it can be used in distributed environment (means which can be accessed by several users through internet) Step2: Code 3 Swing GUI Clients: One for administrators, one for managers and one for viewers. These 3 GUI clients can access business logic written in EJBs. Step3: Distribute the clients corresponding to their users. For instance, manager client to managers. =================================QUESTIONS======================================= Q1. Is the above approach is correct? Q2. This is very common functionality that various softwares have. So, Do they implement this kind of functionality through this way or any other way? Q3. If any other approach would be more better, then what is that approach?

    Read the article

  • Java Thread - Memory consistency errors

    - by Yatendra Goel
    I was reading a Sun's tutorial on Concurrency. But I couldn't understand exactly what memory consistency errors are? I googled about that but didn't find any helpful tutorial or article about that. I know that this question is a subjective one, so you can provide me links to articles on the above topic. It would be great if you explain it with a simple example.

    Read the article

  • Java Swing - How to disable a JPanel?

    - by Yatendra Goel
    I have several JComponents on a JPanel and I want to disable all of those components when I press a Start button. At present, I am disabling all of the components explicitly by component1.setEnabled(false); : : But Is there anyway by which I can disable all of the components at once? I tried to disable the JPanel to which these components are added by panel.setEnabled(false); but it didn't work.

    Read the article

  • Java Swing - Problem in JSpinner

    - by Yatendra Goel
    I am developing a Java Desktop Application and designing the GUI with the help of Netbeans Swing GUI builder. I want to use a JSpinner in my app. I have dragged and dropped it to a JPanel. Now, I want to set its two properties: First, It should display numbers in the range of 1 to 50. Neither less than 1 nor greater than 50. How can I set that range? Second, when I try to get the value of it by spinner.getValue() it returns an Object. As my spinner's data type is Integer, would it be better to downcast the Object into Integer or Is there any other way to get that numeric value?

    Read the article

  • Java - JPA - @Version annotation

    - by Yatendra Goel
    I am new to JPA. I am cofused about the @Version annotation. How it works? I have googled it and found various answers whose extract is as follows: JPA uses a version field in your entities to detect concurrent modifications to the same datastore record. When the JPA runtime detects an attempt to concurrently modify the same record, it throws an exception to the transaction attempting to commit last. But still I am not sure how it works? ================================================================================== Also as from the following lines: You should consider version fields immutable. Changing the field value has undefined results. Does it mean that we should declare our version field as final

    Read the article

  • Java - How to change context root of a dynamic web project in eclipse

    - by Yatendra Goel
    I have developed a dynamic web project in eclipse. Now I can access it through my browser using the following url: http://localhost:8080/MyDynamicWebApp Now I want to change the access url to http://localhost:8080/app I changed the context root from the project properties | Web Project Settings | Context Root But it is not working. The web app still has the access url as earlier. I have re-deployed the application on tomcat, re-started the tomcat and have done everything that should be done but the access url is the same as earlier. I found that there were no server.xml file attached with the WARfile. The how the tomcat is determining that the context root of my web app is /MyDynamicWebApp and is allowing me to access the application through that url

    Read the article

  • Java - Regex problem

    - by Yatendra Goel
    I have a list of urls of type http://www.abc.com/pk/ca and http://www.abc.com/pk Now, I want to find out only those urls that ends with /pk or /pk/ and don't have anything in between .com and /pk

    Read the article

  • Java - Regex problem

    - by Yatendra Goel
    I have list of urls of types: http://www.abc.com/pk/etc http://www.abc.com/pk/etc/ http://www.abc.com/pk/etc/etc where etc can be anything. So I want to search only those urls that contains www.abc.com/pk/etc or www.abc.com/pk/etc/

    Read the article

  • Java Thread - Synchronization issue

    - by Yatendra Goel
    From Sun's tutorial: Synchronized methods enable a simple strategy for preventing thread interference and memory consistency errors: if an object is visible to more than one thread, all reads or writes to that object's variables are done through synchronized methods. (An important exception: final fields, which cannot be modified after the object is constructed, can be safely read through non-synchronized methods, once the object is constructed) This strategy is effective, but can present problems with liveness, as we'll see later in this lesson. Q1. Is the above statements mean that if an object of a class is going to be shared among multiple threads, then all instance methods of that class (except getters of final fields) should be made synchronized, since instance methods process instance variables?

    Read the article

  • Hibernate - One design problem

    - by Yatendra Goel
    I am learning Hibernate from the tutorial on JBoss website. I have a confusion in a code example located here. There is a Cat class code at 4.1. A simple POJO example. This Cat class has a reference to his mother as private Cat mother; Q1. If the class has an identifier property as id, then wouldn't it be better to store the cat's mother's id instead of cat's mother object. means instead of private Cat mother; wouldn't it be better to have private long motherId; `

    Read the article

  • Struts 1 - problem in showing ActionMessages through a JSP page

    - by Yatendra Goel
    I am using Struts 1.3.10. I am trying to display ActionMessage and ActionError set by Action class through a JSP page. The problem is that the ActionErrors are displaying well but ActionMessages are not displaying. When I debug the application, I found that the messages (reference variable of ActionMessages) contains messages. I also saved those messages through saveMessages(request, messages) method of Action class. So, I think that the problem is in the JSP code through which I am trying to display those messages. The JSP code is as follows: <logic:messagesPresent> <ul id="messsages"> <html:messages id="msg" message="true"> <li><bean:write name="msg"/> </li> </html:messages> </ul> </logic:messagesPresent>

    Read the article

  • Java Swing - How to access a JComponent of one JPanel from other JPanel, both added to the JFrame?

    - by Yatendra Goel
    I am developing a Java Desktop Application with GUI implemented in SWING. I hava a JFrame. I have added three JPanels on that. One JPanel panel1 has a Start Button. Now I want to disable various componets on other JPanels when a user presses the start button on the panel1. Now how can I access the components of those other panels from panel1. I know that one approach is to first get the container of panel1 panel1.getParent(); Then get the components of the container container.getComponents(); and use them as per need. Q1. Is there any other way by which I can perform the same task? (I think this is the only way) Q2. After getting the components list of the container, how to differentiate one container with other?

    Read the article

  • What does this statement mean ? printf("[%.*s] ", (int) lengths[i],

    - by Vivek Goel
    I was reading this page http://dev.mysql.com/doc/refman/5.0/en/mysql-fetch-row.html there is one line printf("[%.*s] ", (int) lengths[i], row[i] ? row[i] : "NULL"); from code MYSQL_ROW row; unsigned int num_fields; unsigned int i; num_fields = mysql_num_fields(result); while ((row = mysql_fetch_row(result))) { unsigned long *lengths; lengths = mysql_fetch_lengths(result); for(i = 0; i < num_fields; i++) { printf("[%.*s] ", (int) lengths[i], row[i] ? row[i] : "NULL"); } printf("\n"); } what does [%.*s] mean in that code ?

    Read the article

  • Java - Does null variable require space in memory

    - by Yatendra Goel
    class CheckStore { private String displayText; private boolean state; private String meaningfulText; private URL url; public CheckStore(String text, boolean state) { this.displayText = text; this.state = state; } : : } As I am initializing only two variables (displayText and state) in the constructor, Will the rest two variables (meaningfulText and url which will have the value null) will require space in memory to store null value. Q1. I think they will require space. If they will, then how much memory does a null value takes in the memory (like int takes 4 bytes). Q2. How much space a string takes in memory. I guess it will depend on the length of the string. So how much space a string takes of how much length?

    Read the article

  • Java - Thread - Problem in one of the Sun's tutorial

    - by Yatendra Goel
    I was reading this Sun's tutorial on Thread. I found a block of code there which I think can be replaced by a code of fewer lines. I wonder why Sun's expert programmers followed that long way when the task can be accomplished with a code of fewer lines. I am asking this question so as to know that if I am missing something that the tutorial wants to convey. The block of code is as follows: t.start(); threadMessage("Waiting for MessageLoop thread to finish"); //loop until MessageLoop thread exits while (t.isAlive()) { threadMessage("Still waiting..."); //Wait maximum of 1 second for MessageLoop thread to //finish. t.join(1000); if (((System.currentTimeMillis() - startTime) > patience) && t.isAlive()) { threadMessage("Tired of waiting!"); t.interrupt(); //Shouldn't be long now -- wait indefinitely t.join(); } } threadMessage("Finally!"); I think that the above code can be replaced by the following: t.start(); t.join(patience); // InterruptedException is thrown by the main method so no need to handle it if(t.isAlive()) { // t's thread couldn't finish in the patience time threadMessage("Tired of waiting!"); t.interrupt(); t.join(); } threadMessage("Finally!");

    Read the article

  • Linq to XSD processing

    - by goel
    For Typed Xml to Linq processing ,do i need to download Linq to XSD alpha installer or is it available in VS 2008 ? (I am using VS 2008 Professional edition).

    Read the article

  • Use of select or multithread for almost 80 or more clients?

    - by Tushar Goel
    I am working on one project in which i need to read from 80 or more clients and then write their o/p into a file continuously and then read these new data for another task. My question is what should i use select or multithreading? Also I tried to use multi threading using read/fgets and write/fputs call but as they are blocking calls and one operation can be performed at one time so it is not feasible. Any idea is much appreciated. update 1: I have tried to implement the same using condition variable. I able to achieve this but it is writing and reading one at a time.When another client tried to write then it cannot able to write unless i quit from the 1st thread. I do not understand this. This should work now. What mistake i am doing? Update 2: Thanks all .. I am able to succeeded to get this model implemented using mutex condition variable. updated Code is as below: **header file******* char *mailbox ; pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER ; pthread_cond_t writer = PTHREAD_COND_INITIALIZER; int main(int argc,char *argv[]) { pthread_t t1 , t2; pthread_attr_t attr; int fd, sock , *newfd; struct sockaddr_in cliaddr; socklen_t clilen; void *read_file(); void *update_file(); //making a server socket if((fd=make_server(atoi(argv[1])))==-1) oops("Unable to make server",1) //detaching threads pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); ///opening thread for reading pthread_create(&t2,&attr,read_file,NULL); while(1) { clilen = sizeof(cliaddr); //accepting request sock=accept(fd,(struct sockaddr *)&cliaddr,&clilen); //error comparison against failire of request and INT if(sock==-1 && errno != EINTR) oops("accept",2) else if ( sock ==-1 && errno == EINTR) oops("Pressed INT",3) newfd = (int *)malloc(sizeof(int)); *newfd = sock; //creating thread per request pthread_create(&t1,&attr,update_file,(void *)newfd); } free(newfd); return 0; } void *read_file(void *m) { pthread_mutex_lock(&lock); while(1) { printf("Waiting for lock.\n"); pthread_cond_wait(&writer,&lock); printf("I am reading here.\n"); printf("%s",mailbox); mailbox = NULL ; pthread_cond_signal(&writer); } } void *update_file(int *m) { int sock = *m; int fs ; int nread; char buffer[BUFSIZ] ; if((fs=open("database.txt",O_RDWR))==-1) oops("Unable to open file",4) while(1) { pthread_mutex_lock(&lock); write(1,"Waiting to get writer lock.\n",29); if(mailbox != NULL) pthread_cond_wait(&writer,&lock); lseek(fs,0,SEEK_END); printf("Reading from socket.\n"); nread=read(sock,buffer,BUFSIZ); printf("Writing in file.\n"); write(fs,buffer,nread); mailbox = buffer ; pthread_cond_signal(&writer); pthread_mutex_unlock(&lock); } close(fs); }

    Read the article

  • Java - java.util.List problem

    - by Yatendra Goel
    I have a java.util.ArrayList<Item> and an Item object. Now, I want to obtain the number of times the Item is stored in the arraylist. I know that I can do arrayList.contains() check but it returns true, irrespective of whether it contains one or more Items. Q1. How can I find the number of time the Item is stored in the list? ================================================================================== Q2. Also, If the list contains more than one Item, then how can I determine the index of other Items because arrayList.indexOf(item) returns the index of only first Item every time?

    Read the article

  • Netbeans configuration problem

    - by Yatendra Goel
    I am using Netbeans 6.8 The problem is that the projects explorer (that displays all the projects and their contents) displays each package as a node. For instance, if there is package hierarchy like this; com.mycompany.myproject.package1.package1.1 then it displays 5 nodes for the five packages which is very disturbing while development. Is there any way by which I can configure it(Netbeans) so that it groups all the subpackages of a package under one node and displays the subpackages only when I expand the package node?

    Read the article

  • Storing and displaying unicode string (??????) using PHP and MySQL

    - by Anirudh Goel
    I have to store hindi text in a MySQL database, fetch it using a PHP script and display it on a webpage. I did the following: I created a database and set its encoding to UTF-8 and also the collation to utf8_bin. I added a varchar field in the table and set it to accept UTF-8 text in the charset property. Then I set about adding data to it. Here I had to copy data from an existing site. The hindi text looks like this: ????????:05:30 I directly copied this text into my database and used the PHP code echo(utf8_encode($string)) to display the data. Upon doing so the browser showed me "??????". When I inserted the UTF equivalent of the text by going to "view source" in the browser, however, ???????? translates into &#2360;&#2370;&#2352;&#2381;&#2351;&#2379;&#2342;&#2351;. If I enter and store &#2360;&#2370;&#2352;&#2381;&#2351;&#2379;&#2342;&#2351; in the database, it converts perfectly. So what I want to know is how I can directly store ???????? into my database and fetch it and display it in my webpage using PHP. Also, can anyone help me understand if there's a script which when I type in ????????, gives me &#2360;&#2370;&#2352;&#2381;&#2351;&#2379;&#2342;&#2351;? Solution Found I wrote the following sample script which worked for me. Hope it helps someone else too <html> <head> <title>Hindi</title></head> <body> <?php include("connection.php"); //simple connection setting $result = mysql_query("SET NAMES utf8"); //the main trick $cmd = "select * from hindi"; $result = mysql_query($cmd); while ($myrow = mysql_fetch_row($result)) { echo ($myrow[0]); } ?> </body> </html> The dump for my database storing hindi utf strings is CREATE TABLE `hindi` ( `data` varchar(1000) character set utf8 collate utf8_bin default NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `hindi` VALUES ('????????'); Now my question is, how did it work without specifying "META" or header info? Thanks!

    Read the article

  • ArchBeat Link-o-Rama for 11/16/2011

    - by Bob Rhubart
    Size, Failure, and Optimization | Roger Sessions The slide deck from Roger Sessions' keynote address at the 2nd IT Architect Regional Conference in Bogota, Colombia. Webcast: Oracle Business Intelligence Mobile Event Date: Tuesday, November 29, 2011 Time: 9 a.m. PT/12 noon ET Featuring Manan Goel (Director BI Product Marketing, Oracle) and Shailesh Shedge (Director BI & Analytics Practice, Ascentt). Live Webinar: Solutions for MySQL High Availability (November 29) Tune into this webcast to learn how MySQL’s High Availability solution can help you minimize downtime and ensure business continuity. Domain-Driven Design: Useful Models for Complex Problems | @ericevans0 Domain-Driven Design: Useful Models for Complex Problems | Eric Evans Eric Evans' slide deck from the recent IASA event in Spain. Oracle Hardware goes social Introducing the Oracle Hardware Social Media Hub -- The new Facebook meeting place for the global hardware community. The hub now features a pioneering Q&A app called Oracle Ask the Expert, where you can ask questions and engage with Oracle experts. Review: WebLogic Server 11g Administration Handbook by S. Alapati Dr. Frank Munz, author of "Middleware and Cloud Computing, reviews the new WebLogic book by Sam Alapati and offers a quick overview of a couple of other new titles. SOA All the Time; Architects in AZ; Clearing Info Integration hurdles This week on the Architect Home Page on OTN.

    Read the article

  • ArchBeat Link-o-Rama for 2012-03-21

    - by Bob Rhubart
    Webcast: Simplify Oracle RAC Deployment with Oracle VM event.on24.com Tuesday March 20, 2012 - 9am PT / Noon ET Learn how you can: Deploy an Oracle (RAC) Database environment in minutes with Oracle VM templates Create, deploy or convert existing systems into highly available cluster environments Instantly respond to changing demand by relocating resources between servers Speakers: Ronen Kofman – Product Management Director, Oracle Markus Michalewicz – Senior Principal Product Manager, Oracle Webcast: Oracle Business Intelligence Mobile event.on24.com Event Date: Wednesday, March 28, 2012 Time: 10 a.m. PT / 1 p.m. ET Speakers: Pete Manhardt – Director Enterprise Information at Smiths Group, plc Shailesh Shedge – Director BI & Analytics Practice at Ascentt Manan Goel – Director BI Product Marketing at Oracle Seth's Blog: The extraordinary software development manager sethgodin.typepad.com "Being good at programming is insufficient qualification for becoming a world class software project manager/leader," says marketing guru Seth Godin. Mismatch: Developer skills and customer demands | Floyd Teter orclville.blogspot.com "Those of us in the developer community may need to reconsider the law of supply and demand," says Oracle ACE Director Floyd Teter, "and get on with the process of matching our skills to the demands of our customers." SOA gets mobilized; mobile gets SOA-ized: survey | Joe McKendrick www.zdnet.com "Maybe mobile is the killer app for SOA that actually will convince people to adopt the architectural style." Integrating with Oracle Fusion Applications: Discovering Integration Artifacts | Rajesh Raheja rraheja.wordpress.com Rajesh Raheja briefly discusses "the ease with which integrations are now possible using standards-based technologies with enterprise applications." Chargeback and showChargeback and showback...both a 'throw back' | Tom Laszewski blogs.oracle.com Tom Laszeski discusses strategies for tracking and applying the costs of "IT services, hardware or software to the business unit in which they are used." GlassFish 4.0 Virtualization Progress - VirtualBox | The Aquarium blogs.oracle.com Want to spawn GlassFish instances as VirtualBox virtual machines? The Aquarium shares resources that will help you get it done. Thought for the Day "Spring is the time of plans and projects." — Leo Tolstoy

    Read the article

  • ArchBeat Link-o-Rama for 11/17/2011

    - by Bob Rhubart
    Building an Infrastructure Cloud with Oracle VM for x86 + Enterprise Manager 12c | Richard Rotter Richard Rotter demonstrates "how easy it could be to build a cloud infrastructure with Oracle's solution for cloud computing." Article: Social + Lean = Agile | Dave Duggal In today’s increasingly dynamic business environment, organizations must continuously adapt to survive. Change management has become a major bottleneck. Organizations’ need a practical mechanism for managing controlled variance and change in-flight to break the logjam. This paper provides a foundation for applying lean and agile principles to achieve Enterprise Agility through social collaboration. Stress Testing Java EE 6 Applications - Free Article In Free Java Magazine : Adam Bien "It is strange," says Adam Bien, "everyone is obsessed about green bars and code coverage, but testing of multi threaded behavior is widely ignored - until the applications run into massive problems." Using Access Manager to Secure Applications Deployed on WebLogic | Rene van Wijk Another great how-to post from Oracle ACE Rene van Wijk, this time involving JBoss RichFaces, Facelets, Oracle Coherence, and Oracle WebLogic Server. DOAG 2011 vs. Devoxx - Value and Attraction | Markus Eisele Oracle ACE Director Markus Eisele compares and contrasts these popular conferences with the aim of helping others decide which to attend. SOA All the Time; Architects in AZ; Clearing Info Integration hurdles SOA all the Time; Architects in AZ; Clearing Info Integration Hurdles This week on the Architect Home Page on OTN. Webcast: Oracle Business Intelligence Mobile Event Date: Wednesday, December 7, 2011 Time: 10 a.m. PT/1 p.m. ET Featuring Manan Goel (Director BI Product Marketing, Oracle) and Shailesh Shedge (Director BI and Analytics Practice, Ascentt). Webcast: Maximum Availability on Private Clouds A discussion of Oracle’s Maximum Availability Architecture, Oracle Database 11g, Oracle Exadata Database Machine, and Oracle Database appliance, featuring Margaret Hamburger (Director, Product Marketing, Oracle) and Joe Meeks (Director, Product Management, Oracle). November 30, 2011 at 10:00am PT / 1:00pm ET. Oracle Technology Network Architect Day - Phoenix, AZ Wednesday December 14, 2011, 8:30am - 5:00pm. The Ritz-Carlton, Phoenix, 2401 East Camelback Road, Phoenix, AZ 85016. Registration is free, but seating is limited.

    Read the article

< Previous Page | 1 2 3 4