Search Results

Search found 103 results on 5 pages for 'naveen jankar'.

Page 4/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • how to display numbers without garbage numbers?

    - by Medeti Naveen Kumar
    Hi friends, whenever i press the numbers in text filed upto 9 numbers my textfield has taken right values but i press 10 th number.i have found duplicate number. in my header file i declare a pressnumber is "long long int" -(IBAction)press:(id)sender{ pressNumber = pressNumber*10 + (int)[sender tag]; phonenumber.text = [NSString stringWithFormat:@"%d",currentNumber]; } i want to enter a phone number in my textfiled but it is not taken 10 right numbers. Thanking you,

    Read the article

  • php cron jobs overlapping

    - by naveen gupta
    Hi I wrote few months back a script in perl for checking overlapping of jobs use Fcntl ':flock'; INIT { my $waitcount=12; # possible attemtps to run script my $waitseconds=300; # wait for $waitseconds each attempt my $lockstatus=0;#no lock was attained while ($waitcount > 0){ if (open LH, $0){ while ($waitcount > 0){ if (flock LH, LOCK_EX|LOCK_NB){ $waitcount=0;#signal end of waiting $lockstatus=1;#lock was attained } else{ --$waitcount;#decrement waitcount print "waiting to be able to lock $0\n"; sleep $waitseconds; }#end else }#end while }#end if else{ --$waitcount;#decrement waitcount print "waiting to be able to open $0\n"; sleep $waitseconds; }#end else }#end while if ($lockstatus == 0){ die "no lock was attained\n"; }#end if } I wanted to know if we can do similar thing in php .. How to integrate with your current php code which is running a part of php jobs?

    Read the article

  • Does std::multiset guarantee insertion order?

    - by Naveen
    I have a std::multiset which stores elements of class A. I have provided my own implementation of operator< for this class. My question is if I insert two equivalent objects into this multiset is their order guaranteed? For example, first I insert a object a1 into the set and then I insert an equivalent object a2 into this set. Can I expect the a1 to come before a2 when I iterate through the set? If no, is there any way to achieve this using multiset?

    Read the article

  • Conversion between different template instantiation of the same template

    - by Naveen
    I am trying to write an operator which converts between the differnt types of the same implementation. This is the sample code: template <class T = int> class A { public: A() : m_a(0){} template <class U> operator A<U>() { A<U> u; u.m_a = m_a; return u; } private: int m_a; }; int main(void) { A<int> a; A<double> b = a; return 0; } However, it gives the following error for line u.m_a = m_a;. Error 2 error C2248: 'A::m_a' : cannot access private member declared in class 'A' d:\VC++\Vs8Console\Vs8Console\Vs8Console.cpp 30 Vs8Console I understand the error is because A<U> is a totally different type from A<T>. Is there any simple way of solving this (may be using a friend?) other than providing setter and getter methods? I am using Visual studio 2008 if it matters.

    Read the article

  • Flash+PHP+cookie

    - by naveen
    I want an animation play only once in the browser. If any user seen the movie and if goes to any other page or refresh(F5) and then come back on the animation page then animation should not play from start. I want to play it from another frame. I think it can be done by set cookie or somthing using javascript or php. Please anybody help me. Thanks in advance. I will appreciate ,if some code help please

    Read the article

  • Is 'bool' a basic datatype in C++ ?

    - by Naveen
    I got this doubt while writing some code. Is 'bool' a basic datatype defined in the C++ standard or is it some sort of extension provided by the compiler ? I got this doubt because Win32 has 'BOOL' which is nothing but a typedef of long. Also what happens if I do something like this: int i = true; Is it "always" guaranteed that variable i will have value 1 or is it again depends on the compiler I am using ? Further for some Win32 APIs which accept BOOL as the parameter what happens if I pass bool variable?

    Read the article

  • Error using iif in ms access query

    - by naveen
    I am trying to fire this query in MS Access SELECT file_number, IIF(invoice_type='Spent on Coding',SUM(CINT(invoice_amount)), 0) as CodingExpense FROM invoice GROUP BY file_number I am getting this error Error in list of function arguments: '=' not recognized. Unable to parse query text. I tried replacing IIF with SWITCH to no avail. What's wrong with my query and how to correct this?

    Read the article

  • Java scripts conflict on my home page

    - by naveen
    <script type="text/javascript" src="jquery-1.js"></script> <script type="text/javascript" src="mootools.js"></script> <script type="text/javascript" src="slideshow.js"></script> <script type="text/javascript"> //<![CDATA[ window.addEvent('domready', function(){ var data = { '1.jpg': { caption: 'Volcano Asención in Ometepe, Nicaragua.' }, '2.jpg': { caption: 'A Ceibu tree.' }, '3.jpg': { caption: 'The view from Volcano Maderas.' }, '4.jpg': { caption: 'Beer and ice cream.' } }; var myShow = new Slideshow('show', data, {controller: true, height: 400, hu: 'images/', thumbnails: true, width: 500}); }); //]]> </script> <script type="text/javascript"> $(document).ready(function() { //slides the element with class "menu_body" when paragraph with class "menu_head" is clicked $("#firstpane p.menu_head").click(function() { $(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow"); $(this).siblings().css({backgroundImage:"url(left.png)"}); }); //slides the element with class "menu_body" when mouse is over the paragraph $("#secondpane p.menu_head").mouseover(function() { $(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow"); $(this).siblings().css({backgroundImage:"url(left.png)"}); }); }); </script> <!--[if lt IE 7]> <script type="text/javascript" src="unitpngfix.js"></script> <![endif]-->

    Read the article

  • Does the compiler optimize the function parameters passed by value?

    - by Naveen
    Lets say I have a function where the parameter is passed by value instead of const-reference. Further, lets assume that only the value is used inside the function i.e. the function doesn't try to modify it. In that case will the compiler will be able to figure out that it can pass the value by const-reference (for performance reasons) and generate the code accordingly? Is there any compiler which does that?

    Read the article

  • log file not generated while accessing a jar having log4j support.

    - by naveen garimella
    I have a x.jar which is being used by some client y.jar. Both x.jar and y.jar are at the same package level. i have put the log4j.xml at the same package level. But the log file is never generated. Can i know why? I have tried few other options as well but no luck till now. i have added log4j-1.2.16.jar to ClassPath: variable in manifest files of both x.jar and y.jar. Put log4j.xml at the class level of y.jar which actually calls the x.jar classes. package structure is as follows: x.jar --manifest.mf has a entry ClassPath:log4j-1.2.16.jar y.jar --manifest.mf has a entry ClassPath:log4j-1.2.16.jar log4j-1.2.16.jar log4j.xml --has a RollingFileAppender. Can any one suggest whether i am missing anything?

    Read the article

  • Is new int[10]() valid c++?

    - by Naveen
    While trying to answer this question I found that the code int* p = new int[10](); compiles fine with VC9 compiler and initializes the integers to 0. So my questions are: First of all is this valid C++ or is it a microsoft extension? Is it guaranteed to initialize all the elements of the array? Also, is there any difference if I do new int; or new int();? Does the latter guarantee to initialize the variable?

    Read the article

  • download iphone sample code from apple

    - by Naveen
    the iphone sdk documentation has links to sample code, but you have to download them individually from the web. Is there a bundle you can download all at once from apple ? For example, reading the first iphone tutorial at switchonthecode, the first new word I came across was UIApplication. There are 5 samples on the web...

    Read the article

  • Date difference in SQL Server 2005

    - by naveen
    Hi, I have two dates of the form Start Date: 2007-03-24, End Date: 2009-06-26 Now I need to find the difference between these two in the below form: 2 years, 3 months and 2 days Can someone please … in SQL Server 2005

    Read the article

  • grails services :: multiple projects

    - by naveen
    PROBLEM : I have multiple grails projects (lets say appA, appB and appC) : services to be precise I want to run them in a single grails-app.. probably a war deployment, how can i do this? REQUIREMENTS : I want this to be a single app since i am deploying it on cloud and i don't have enough memory to hold all these service instances individually. The reason for multiple grails project is scalability. So that if later on i want to run 10 instance of appA, 3 instance of appB, and 1 instance of aapC; i should be able to do that. EDIT : Can i use something like 0mq, will that be helpful in keeping the services separated from each other. How will i package my service? And reading the docs of 0mq seems that it can work with both inprocess and external process. Will async grails requests on HTTP work with 0mq in process/ external mq calls. Haven't used 0mq, but from the initial doc it seems to work. Need some experience calls in this scenario. Are there any other alternatives or mq alternatives?

    Read the article

  • Java-Counting occurrence of word from huge textfile

    - by Naveen
    I have a text file of size 115MB. It consists of about 20 million words. I have to use the file as a word collection, and use it to search the occurrence of each user-given words from the collection. I am using this process as a small part in my project. I need a method for finding out the number of occurrence of given words in a faster and correct manner since i may use it in iterations. I am in need of suggestion about any API that i can make use or some other way that performs the task in a quicker manner. Any recommendations are appreciated.

    Read the article

  • ArchBeat Link-o-Rama Top 10 for October 7-13, 2012

    - by Bob Rhubart
    The Top 10 items shared via the OTN ArchBeat Facebook page for the week of October 7-13, 2012. OOW12: Oracle Business Process Management/Oracle ADF Integration Best Practices | Andrejus Baranovskis The Oracle OpenWorld presentations keep coming! Oracle ACE Director Andrejus Baranovskis shares the slides from "Oracle Business Process Management/Oracle ADF Integration Best Practices," co-presented with Danilo Schmiedel from Opitz Consulting. Oracle's Analytics, Engineered Systems, and Big Data Strategy | Mark Rittman Part 1 of 3 in Oracle ACE Director Mark Rittman's series on Oracle Exalytics, Oracle R Enterprise and Endeca. Adaptive ADF/WebCenter template for the iPad | Maiko Rocha Oracle Fusion Middleware A-Team member Maiko Rocha responds to a a customer request for information about how to create an adaptive iPad template for their WebCenter Portal application, "a specific template to streamline their workflow on the iPad." Following the Thread in OSB | Antony Reynolds Antony Reynolds recently led an Oracle Service Bus POC in which his team needed to get high throughput from an OSB pipeline. "Imagine our surprise when, on stressing the system, we saw it lock up, with large numbers of blocked threads." He shares the details of the problem and the solution in this extensive technical post. WebCenter Sites Gadget Development Concepts Quickstart | John Brunswick What are Gadgets? "At their most basic level they can be thought of as lightweight portlets that run largely on the client side of an architecture," says John Brunswick. "Gadgets provide a cross-platform container to run reusable UI modules that generally expose dynamic information to an end user, allowing for some level of end user customization." Oracle Fusion Middleware Security: OAM and OIM 11g Academies Looking for technical how-to content covering Oracle Access Manager and Oracle Identity Manager? The people behind the Oracle Middleware Security blog have indexed relevant blog posts into what they call Academies. "These indexes contain the articles we've written that we believe provide long lasting guidance on OAM and OIM. Posts covered in these series include articles on key aspects of OAM and OIM 11g, best practice architectural guidance, integrations, and customizations." Fusion Applications Technical Tips | Naveen Nahata "Setting memory parameters for Admin and Managed servers of various domains in Fusion Applications can be, let us say, a little daunting," says Oracle Fusion Middleware A-Team member Naveen Nahata. "While all this may look complicated and intimidating, it is actually relatively simple once you understand how it all works." Updated Agenda for OTN Architect Day Los Angeles (Oct 25) In less than two weeks Oracle Architect Day rolls into Los Angeles, with a full slate of sessions devoted to cloud computing, engineered systems, and SOA. Follow the link for the updated event agenda. ORCLville: OOW 2012 - A Not So Brief Recap Oracle ACE Director Floyd Teter, an Applications & Apps Technology specialists, shares his personal, frank, and and extensive recap or Oracle OpenWorld 2012. SOA Suite create partition in Enterprise Manager | Peter Paul van de Beek "In Oracle SOA Suite 10g, or more specific BPEL 10g, one could group functionality in domains," says Peter Paul van de Beek. "This feature has been away in the early versions of SOA Suite 11g. They have returned in more recent version and can be used for all SCA composites (instead of BPEL only). Nowadays these 10g domains are called partitions." Thought for the Day "I strive for an architecture from which nothing can be taken away." — Helmut Jahn Source: BrainyQuote.com

    Read the article

  • Java EE@Java Day Taipei 2014

    - by reza_rahman
    Java Day Taipei 2014 was held at the Taipei International Convention Center on August 1st. Organized by Oracle University, it is one of the largest Java developer events in Taiwan. This was another successful year for Java Day Taipei with a fully sold out venue. In addition to Oracle speakers like me, Steve Chin and Naveen Asrani, the event also featured a bevy of local speakers including Taipei Java community leaders. Topics included Java SE, Java EE, JavaFX and Big Data. I delivered a keynote on Java EE 7/Java EE 8 as well as a talks on aligning the JavaScript ecosystem with Java EE 7 and using NoSQL solutions in Java EE applications. More details on the sessions and Java Days Taipei, including the slide decks and code, posted on my personal blog.

    Read the article

  • Why is casting Derived** to Base*const* forbidden ?

    - by smerlin
    After reading this question, i saw the answer by Naveen containing a link to this page, which basically says, that casting from Derived** to Base** is forbidden since could change a pointer to an pointer to a Derived1 object point to a pointer to a Derived2 object (like: *derived1PtrPtr=derived2Ptr). OK, i understand this is evil ... But when casting Derived** to Base*const* this is not even possible, so whats the reason that this is not allowed anyway ?

    Read the article

  • MOSS Sharepoint - Holiday Approval /tracking

    - by nav
    Hi, Has anyone implemented a holiday workflow approval / tracking list in MOSS Sharepoint 2007? Can anyone suggests other solutions? The solution below works fine but I am specifically looking for a way to lookup manager of the user who created the holiday request list item in the workflow. I have followed this link http://www.u2u.info/Blogs/Kevin/Lists/Posts/Post.aspx?ID=39 which shows you how to create a custom workflow approval. Below are the steps outlined by the link. User add new holiday item to list Workflow kicks off Wf has the manager hardcoded (need a way to look this up, maybe from AD??) and creates a Task for them to review the request. If desired, this can include an email notification of the task Manager reviews, adds comments and approves/denies request User is notified of completed request Many Thanks, Naveen

    Read the article

  • Holiday Approval /tracking

    - by nav
    Hi, Has anyone implemented a holiday workflow approval / tracking list in MOSS Sharepoint 2007? Can anyone suggests other solutions? The solution below works fine but I am specifically looking for a way to lookup manager of the user who created the holiday request list item in the workflow. I have followed this link http://www.u2u.info/Blogs/Kevin/Lists/Posts/Post.aspx?ID=39 which shows you how to create a custom workflow approval. Below are the steps outlined by the link. User add new holiday item to list Workflow kicks off Wf has the manager hardcoded (need a way to look this up, maybe from AD??) and creates a Task for them to review the request. If desired, this can include an email notification of the task Manager reviews, adds comments and approves/denies request User is notified of completed request Many Thanks, Naveen

    Read the article

  • Windows 7 Automatically Connecting To Unsecured Wireless Networks On Startup

    - by Xtend
    Most of the questions on this topic related to folks connecting to somebody else's wireless network when their own was available and could remedy the situation by going to their connections and unchecking the "connect automatically" box. See this: " Avoid automatically connecting to wireless network on windows 7 " as an example. In my situation, I've noticed that Win 7 will automatically connect to any unsecured wifi network - even if I have never connected to it in the past. If I am traveling and boot Win 7, it will start and connect to what appears to be the best signaled unsecured network without prompting me for confirmation (note: in the above link, "Naveen" seems to have same problem). Obviously, that is a security concern to me. Further, when I open "Network and Sharing" and "Manage wireless networks" the network is not displayed (probably because I labelled it a public network). Again, these are new, never connected with before, wireless networks. I always promptly disconnect from them but don't want to have to be on constant guard for an auto connection to a malicious network. This began about a month ago, as I recall, Win 7 did not behave like this in the past, I didn't monkey with wifi settings, and don't use a 3rd party connection manager. I did have to download some internet security certificates for army website access but I don't think that should mess with network settings. Any ideas how I can tell Win7 cease automatically connecting to networks or, at least, to prompt me for a confirmation before connecting?

    Read the article

  • how to keep same header on starting of next page in pdf

    - by Santosh Singh
    Here is My Code. private void getActionItems(Document document, Chapter chapter, Section section, Paragraph pas) { List drbRefList = null; try { _actionService = new ActionItemImpl(); _aiBean = new ActionItemData(); if (_aiBean != null) { _actionList = new ArrayList(); LOG.info("business passed here is" + _business); _actionList = _actionService.getActionItemsForPDF(_userSSOID, _business, _reviewID, _connection); } LOG.info(" after calling getActionItemsForPDF"); LOG.info("_actionList" + _actionList); Table tablesh1 = new Table(1, 1); float[] widthsh1 = new float[1]; widthsh1[0] = ReviewConstants.MAGIC_DOTTWELVE; tablesh1.setTableFitsPage(true); tablesh1.setPadding(2); tablesh1.setSpacing(0); tablesh1.setWidth(ReviewConstants.MAGIC_ONEZEROZERO); tablesh1.setWidths(widthsh1); tablesh1.setBorderColor(Color.WHITE); Cell hcell = new Cell(new Paragraph(ReviewConstants.S_ACTIONHEADING, new Font(Font.HELVETICA, fontSize, Font.BOLD, Color.BLUE))); hcell.setHeader(true); tablesh1.addCell(hcell); section.add(tablesh1); Table actionTable = null; String businessUnit = reviewData.getBusinessUnit(); float[] widthac = null; //Updated for Nuclear Energy Engineering Business Unit Requirement by Naveen if(!"Nuclear Energy Engineering".equalsIgnoreCase(businessUnit)){ actionTable = new Table(ReviewConstants.NINE,ReviewConstants.THREE); widthac = new float[ReviewConstants.NINE]; widthac[0] = ReviewConstants.MAGIC_DOTONE; widthac[1] = ReviewConstants.MAGIC_DOTONEZERO; widthac[2] = ReviewConstants.MAGIC_DOTTWOZERO; widthac[ReviewConstants.THREE] = ReviewConstants.MAGIC_DOTTWOZERO; widthac[ReviewConstants.FOUR] = ReviewConstants.MAGIC_DOTONEZERO; widthac[ReviewConstants.FIVE] = ReviewConstants.MAGIC_DOTONEZERO; widthac[ReviewConstants.SIX] = ReviewConstants.MAGIC_DOTONEZERO; widthac[ReviewConstants.SEVEN] = ReviewConstants.MAGIC_DOTONEZERO; widthac[ReviewConstants.EIGHT] = ReviewConstants.MAGIC_DOTONEZERO; }else{ actionTable = new Table(ReviewConstants.SIX,ReviewConstants.THREE); widthac = new float[ReviewConstants.SIX]; widthac[0] = ReviewConstants.MAGIC_DOTONE; widthac[1] = ReviewConstants.MAGIC_THREEZERO; widthac[2] = ReviewConstants.MAGIC_THREEZERO; widthac[ReviewConstants.THREE] = ReviewConstants.MAGIC_THREEZERO; widthac[ReviewConstants.FOUR] = ReviewConstants.MAGIC_DOTONEZERO; widthac[ReviewConstants.FIVE] = ReviewConstants.MAGIC_DOTONEZERO; } actionTable.setTableFitsPage(true); actionTable.setPadding(2); actionTable.setSpacing(0); actionTable.setWidth(ReviewConstants.MAGIC_ONEZEROZERO); actionTable.setWidths(widthac); actionTable.setBorderWidth(1); Cell accell = new Cell(new Paragraph(ReviewConstants.S_ACTIONID, new Font(Font.HELVETICA, fontSize, Font.BOLD))); accell.setHeader(true); actionTable.addCell(accell); if(!"Nuclear Energy Engineering".equalsIgnoreCase(businessUnit)){ accell = new Cell(new Paragraph(ReviewConstants.PDF_RT, new Font(Font.HELVETICA, fontSize, Font.BOLD))); accell.setHeader(true); actionTable.addCell(accell); } accell = new Cell(new Paragraph(ReviewConstants.S_REQA, new Font(Font.HELVETICA, fontSize, Font.BOLD))); accell.setHeader(true); actionTable.addCell(accell); accell = new Cell(new Paragraph(ReviewConstants.S_CLOSURE, new Font(Font.HELVETICA, fontSize, Font.BOLD))); accell.setHeader(true); actionTable.addCell(accell); accell = new Cell(new Paragraph(ReviewConstants.S_DISPOSITION, new Font(Font.HELVETICA, fontSize, Font.BOLD))); accell.setHeader(true); actionTable.addCell(accell); //added by santosh on 18 june actionTable.endHeaders(); document.add(actionTable); if(!"Nuclear Energy Engineering".equalsIgnoreCase(businessUnit)){ accell = new Cell(new Paragraph(ReviewConstants.S_DRB_REFERENCE, new Font( Font.HELVETICA, fontSize, Font.BOLD))); accell.setHeader(true); actionTable.addCell(accell); accell = new Cell(new Paragraph(ReviewConstants.S_DEADLINE, new Font( Font.HELVETICA, fontSize, Font.BOLD))); accell.setHeader(true); actionTable.addCell(accell); } accell = new Cell(new Paragraph(ReviewConstants.S_OWNER, new Font( Font.HELVETICA, fontSize, Font.BOLD))); accell.setHeader(true); actionTable.addCell(accell); accell = new Cell(new Paragraph(ReviewConstants.S_STATE, new Font( Font.HELVETICA, fontSize, Font.BOLD))); accell.setHeader(true); actionTable.addCell(accell); int acSize = 0; if (_actionList != null) { acSize = _actionList.size(); } for (int i = 0; i < acSize; i++) { _aiBean = (ActionItemData) _actionList.get(i); Cell adCell = new Cell(new Paragraph(_aiBean.getActionID(), new Font( Font.HELVETICA, ReviewConstants.MAGIC_EIGHT))); adCell.setHeader(false); actionTable.addCell(adCell); if(!"Nuclear Energy Engineering".equalsIgnoreCase(businessUnit)){ if (_aiBean.getActionItemType().equals("0")) { adCell = new Cell(new Paragraph("Normal", new Font(Font.HELVETICA, fontSize))); } else { adCell = new Cell(new Paragraph("Critical", new Font(Font.HELVETICA, fontSize))); } adCell.setHeader(false); actionTable.addCell(adCell); } adCell = new Cell(new Paragraph(_aiBean.getRequiredAction(), new Font(Font.HELVETICA, fontSize))); adCell.setHeader(false); actionTable.addCell(adCell); adCell = new Cell(new Paragraph(_aiBean.getClosureCriteria(), new Font(Font.HELVETICA, fontSize))); adCell.setHeader(false); actionTable.addCell(adCell); String drbLink = ReviewConstants.EMPTY; drbRefList = new ArrayList(); if (!DRUtils.isEmpty(_aiBean.getState()) && ((_aiBean.getState() .equalsIgnoreCase(ReviewConstants.DRAFT_BEGUN_STATE)) || (_aiBean.getState() .equalsIgnoreCase(ReviewConstants.SCOPE_PROPOSED)) || (_aiBean .getState() .equalsIgnoreCase(ReviewConstants.RES_PROPOSED)))) { drbLink = ReviewConstants.EMPTY; _aiBean.setDisposition(ReviewConstants.EMPTY); } else { drbRefList = _actionService.getDrbRefForPDF(_aiBean.getActionSeqID(), _connection); int drbRefCnt = 0; if (drbRefList != null) { drbRefCnt = drbRefList.size(); int j = 0; for (j = 0; j < drbRefCnt; j++) { LOG.info("drbRefList.get(j)" + drbRefList.get(j).toString()); if (j < (drbRefCnt - 1)) { drbLink += drbRefList.get(j).toString() + ReviewConstants.COMMA_SPACE; } else { drbLink += drbRefList.get(j).toString(); } } } } LOG.info("drbLink" + drbLink); adCell = new Cell(new Paragraph(_aiBean.getDisposition(), new Font(Font.HELVETICA, fontSize))); adCell.setHeader(false); actionTable.addCell(adCell); //Updated for Nuclear Energy Engineering Business Unit Requirement by Naveen if(!"Nuclear Energy Engineering".equalsIgnoreCase(businessUnit)){ adCell = new Cell(new Paragraph(drbLink, new Font( Font.HELVETICA, fontSize))); adCell.setHeader(false); actionTable.addCell(adCell); adCell = new Cell(new Paragraph(_aiBean.getDeadline(), new Font(Font.HELVETICA, fontSize))); adCell.setHeader(false); actionTable.addCell(adCell); } adCell = new Cell(new Paragraph(_aiBean.getActionItemOwnerName(), new Font(Font.HELVETICA, fontSize))); adCell.setHeader(false); actionTable.addCell(adCell); adCell = new Cell(new Paragraph(_aiBean.getState(), new Font(Font.HELVETICA, fontSize))); adCell.setHeader(false); actionTable.addCell(adCell); //added by santosh actionTable.endHeaders(); document.add(actionTable); // added by santosh end } /*Phrase headerPhrase = new Phrase(); Table headTab = (Table)actionTable.getElement(0, 5); headerPhrase.add(headTab); HeaderFooter printHeader = new HeaderFooter(headerPhrase,false); System.out.println("addHeader"); document.setHeader(printHeader); actionTable.setLastHeaderRow(1); actionTable.endHeaders(); document.add(actionTable);*/ // added by santosh actionTable.endHeaders(); document.add(actionTable); // added by santosh end section.add(actionTable); } catch (Exception e) { LOG.error("General Exception occured", e); } }

    Read the article

  • SQL SERVER – Solution – Puzzle – SELECT * vs SELECT COUNT(*)

    - by pinaldave
    Earlier I have published Puzzle Why SELECT * throws an error but SELECT COUNT(*) does not. This question have received many interesting comments. Let us go over few of the answers, which are valid. Before I start the same, let me acknowledge Rob Farley who has not only answered correctly very first but also started interesting conversation in the same thread. The usual question will be what is the right answer. I would like to point to official Microsoft Connect Items which discusses the same. RGarvao https://connect.microsoft.com/SQLServer/feedback/details/671475/select-test-where-exists-select tiberiu utan http://connect.microsoft.com/SQLServer/feedback/details/338532/count-returns-a-value-1 Rob Farley count(*) is about counting rows, not a particular column. It doesn’t even look to see what columns are available, it’ll just count the rows, which in the case of a missing FROM clause, is 1. “select *” is designed to return columns, and therefore barfs if there are none available. Even more odd is this one: select ‘blah’ where exists (select *) You might be surprised at the results… Koushik The engine performs a “Constant scan” for Count(*) where as in the case of “SELECT *” the engine is trying to perform either Index/Cluster/Table scans. amikolaj When you query ‘select * from sometable’, SQL replaces * with the current schema of that table. With out a source for the schema, SQL throws an error. so when you query ‘select count(*)’, you are counting the one row. * is just a constant to SQL here. Check out the execution plan. Like the description states – ‘Scan an internal table of constants.’ You could do ‘select COUNT(‘my name is adam and this is my answer’)’ and get the same answer. Netra Acharya SELECT * Here, * represents all columns from a table. So it always looks for a table (As we know, there should be FROM clause before specifying table name). So, it throws an error whenever this condition is not satisfied. SELECT COUNT(*) Here, COUNT is a Function. So it is not mandetory to provide a table. Check it out this: DECLARE @cnt INT SET @cnt = COUNT(*) SELECT @cnt SET @cnt = COUNT(‘x’) SELECT @cnt Naveen Select 1 / Select ‘*’ will return 1/* as expected. Select Count(1)/Count(*) will return the count of result set of select statement. Count(1)/Count(*) will have one 1/* for each row in the result set of select statement. Select 1 or Select ‘*’ result set will contain only 1 result. so count is 1. Where as “Select *” is a sysntax which expects the table or equauivalent to table (table functions, etc..). It is like compilation error for that query. Ramesh Hi Friends, Count is an aggregate function and it expects the rows (list of records) for a specified single column or whole rows for *. So, when we use ‘select *’ it definitely give and error because ‘*’ is meant to have all the fields but there is not any table and without table it can only raise an error. So, in the case of ‘Select Count(*)’, there will be an error as a record in the count function so you will get the result as ’1'. Try using : Select COUNT(‘RAMESH’) and think there is an error ‘Must specify table to select from.’ in place of ‘RAMESH’ Pinal : If i am wrong then please clarify this. Sachin Nandanwar Any aggregate function expects a constant or a column name as an expression. DO NOT be confused with * in an aggregate function.The aggregate function does not treat it as a column name or a set of column names but a constant value, as * is a key word in SQL. You can replace any value instead of * for the COUNT function.Ex Select COUNT(5) will result as 1. The error resulting from select * is obvious it expects an object where it can extract the result set. I sincerely thank you all for wonderful conversation, I personally enjoyed it and I am sure all of you have the same feeling. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: CodeProject, Pinal Dave, PostADay, Readers Contribution, Readers Question, SQL, SQL Authority, SQL Puzzle, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQLServer, T SQL, Technology

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >