Search Results

Search found 29 results on 2 pages for 'prasoon saurav'.

Page 1/2 | 1 2  | Next Page >

  • Specific query in Mysql

    - by Radhe
    I have two tables reports and holidays. reports: (username varchar(30),activity varchar(30),hours int(3),report_date date) holidays: (holiday_name varchar(30), holiday_date date) select * from reports gives +----------+-----------+---------+------------+ | username | activity | hours | date | +----------+-----------+---------+------------+ | prasoon | testing | 3 | 2009-01-01 | | prasoon | coding | 4 | 2009-01-03 | | prasoon | designing| 2 | 2009-01-04 | | prasoon | coding | 4 | 2009-01-06 | +----------+-----------+---------+------------+ select * from holidays gives +--------------+---------------+ | holiday_name | holiday_date | +--------------+---------------+ | Diwali | 2009-01-02 | | Holi | 2009-01-05 | +--------------+---------------+ Is there any way by which I can output the following? +-------------+-----------+---------+-------------------+ | date | activity | hours | holiday_name | +-------------+-----------+---------+-------------------+ | 2009-01-01 | testing | 3 | | | 2009-01-02 | | | Diwali | | 2009-01-03 | coding | 4 | | | 2009-01-04 | designing| 2 | | | 2009-01-05 | | | Holi | | 2009-01-06 | coding | 4 | | +-------------+-----------+---------+-------------------+

    Read the article

  • how to install g++ and openJDK from .deb package

    - by Saurav Shekhar
    I have recently started using ubuntu 12.04 for my dell inspiron 5500 15r. I want to install g++ and javac on my ubuntu.Since my USB modem doesn't support ubuntu i cannot connect my ubuntu to the internet.I have the .deb package of g++-4.4 GNU C++ compiler and openJDK Java 6 Runtime with me. Please explain to me in detail how to install them to my ubuntu. Thank You Saurav Shekhar ph-+91 895 344 1464

    Read the article

  • Query in sql involving joins of two table

    - by Satish
    I have two tables reports and holidays. reports: (username varchar(30),activity varchar(30),hours int(3),report_date date) holidays: (holiday_name varchar(30), holiday_date date) select * from reports gives +----------+-----------+---------+------------+ | username | activity | hours | date | +----------+-----------+---------+------------+ | prasoon | testing | 3 | 2009-01-01 | | prasoon | coding | 4 | 2009-01-03 | | prasoon | coding | 4 | 2009-01-06 | | prasoon | coding | 4 | 2009-01-10 | +----------+-----------+---------+------------+ select * from holidays gives +--------------+---------------+ | holiday_name | holiday_date | +--------------+---------------+ | Diwali | 2009-01-02 | | Holi | 2009-01-05 | +--------------+---------------+ Is there any way by which I can output the following? +-------------+-----------+---------+-------------------+ | date | activity | hours | holiday_name | +-------------+-----------+---------+-------------------+ | 2009-01-01 | testing | 3 | | | 2009-01-02 | | | Diwali | | 2009-01-03 | coding | 4 | | | 2009-01-04 | Absent | Absent | | | 2009-01-05 | | | Holi | | 2009-01-06 | coding | 4 | | | 2009-01-07 | Absent | Absent | | | 2009-01-08 | Absent | Absent | | | 2009-01-09 | Absent | Absent | | | 2009-01-10 | coding | 4 | | +-------------+-----------+---------+-------------------+ In other words I want to fill the activity and hours columns with "Absent" on the dates which are neither in table reports nor in table holidays. How can I write a specific query for it. The query should give the output between two specific dates.

    Read the article

  • Complex query in mysql

    - by Satish
    I have two tables reports and holidays. reports: (username varchar(30),activity varchar(30),hours int(3),report_date date) holidays: (holiday_name varchar(30), holiday_date date) select * from reports gives +----------+-----------+---------+------------+ | username | activity | hours | date | +----------+-----------+---------+------------+ | prasoon | testing | 3 | 2009-01-01 | | prasoon | coding | 4 | 2009-01-03 | | gautam | coding | 1 | 2009-01-05 | | prasoon | coding | 4 | 2009-01-06 | | prasoon | coding | 4 | 2009-01-10 | | gautam | coding | 4 | 2009-01-10 | +----------+-----------+---------+------------+ select * from holidays gives +--------------+---------------+ | holiday_name | holiday_date | +--------------+---------------+ | Diwali | 2009-01-02 | | Holi | 2009-01-05 | +--------------+---------------+ When I used the following query SELECT dates.date AS date, CASE WHEN holiday_name IS NULL THEN COALESCE(reports.activity, 'Absent') WHEN holiday_name IS NOT NULL and reports.activity IS NOT NULL THEN reports.activity ELSE '' END AS activity, CASE WHEN holiday_name IS NULL THEN COALESCE(reports.hours, 'Absent') WHEN holiday_name IS NOT NULL and reports.hours IS NOT NULL THEN reports.hours ELSE '' END AS hours, CASE WHEN holiday_name IS NULL THEN COALESCE(holidays.holiday_name, '') ELSE holidays.holiday_name END AS holiday_name FROM dates LEFT OUTER JOIN reports ON dates.date = reports.date LEFT OUTER JOIN holidays ON dates.date = holidays.holiday_date where reports.username='gautam' and dates.date>='2009-01-01' and dates.date<='2009-01-10'; I got the following output +----------+-----------+---------+------------+ | date | activity | hours | holiday | +----------+-----------+---------+------------+ |2009-01-05| coding | 1 | Holi | +----------+-----------+---------+------------+ |2009-01-10| coding | 4 | | +----------+-----------+---------+------------+ but I expected this +----------+-----------+---------+------------+ | date | activity | hours | holiday | +----------+-----------+---------+------------+ |2009-01-01| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-02| | | Diwali | +----------+-----------+---------+------------+ |2009-01-03| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-04| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-05| Coding | 1 | Holi | +----------+-----------+---------+------------+ |2009-01-06| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-07| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-08| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-09| Absent | Absent | | +----------+-----------+---------+------------+ |2009-01-10| Coding | 4 | | +----------+-----------+---------+------------+ How can I modify the above query to get the desired output(for a particular user (gautam in this case))?

    Read the article

  • Are Language Comparisons Meaningful?

    - by Prasoon Saurav
    Dr Bjarne Stroustrup in his book D&E says Several reviewers asked me to compare C++ to other languages. This I have decided against doing. Thereby, I have reaffirmed a long-standing and strongly held view: "Language comparisons are rarely meaningful and even less often fair" . A good comparison of major programming languages requires more effort than most people are willing to spend, experience in a wide range of application areas, a rigid maintenance of a detached and impartial point of view, and a sense of fairness. I do not have the time, and as the designer of C++, my impartiality would never be fully credible. -- The Design and Evolution of C++(Bjarne Stroustrup) Do you people agree with his this statement "Language comparisons are rarely meaningful and even less often fair"? Personally I think that comparing a language X with Y makes sense because it gives many more reasons to love/despise X/Y :-P What do you people think?

    Read the article

  • How to Upgrade Ubuntu 12.04.2 to Ubuntu 12.04.3

    - by Saurav Kumar
    I am currently using Ubuntu 12.04.2 32bit. I installed it using LiveCD. Tomorrow, 23rd August 2013,Ubuntu 12.04.3 is released. I want to upgrade from Ubuntu 12.04.2 to Ubuntu 12.04.3 without using any LiveCD. Is it possible? If so please suggest me how can I do. Actually while using Ubuntu 12.04.2 I have troubled with graphics. My graphics card is Intel i845G 64 MB. When Ubuntu starts it works fine and smooth without any lagging, but after sometime it hangs for few seconds (1 or 2 seconds) with a garbage screen and becomes sluggish. All windows and browsers start lagging and also it is not possible to play any video in any player (VLC, Movie Player, Xnoise, SMPlayer etc..). I think Upgrading to Ubuntu 12.04.3 could fix my problem. Any help will be greatly appreciated..

    Read the article

  • How to make text file created in Ubuntu compatible with Windows notepad

    - by Saurav Kumar
    Sometime I have to use the text files created in Ubuntu using editor like gedit, in Windows. So basically when ever I create a text file in Ubuntu I append the extension .txt, and it does make the file open in Windows very easily. But the actual problem is the text files created in Ubuntu are so difficult to understand(read) when opened in Windows' Notepad. No matter how many new lines have been used, all the lines appear in the same line. Is there a easy way to save the text files in Ubuntu's editors so that it can be seen exactly the same in Windows' notepad? Like some plugins of gedit which make it compatible with Windows' Notepad? or something else.. I searched but didn't get any help. I appreciate for the help. Thanks in advance!!

    Read the article

  • Some Nice Icon Themes for Ubuntu [on hold]

    - by Saurav Kumar
    Last night I was searching for some good looking icon themes availabe for Ubuntu, but unfortunately could not find any post which gives a list of themes :(. From yesterday night I started searching icons themes and installing one by one. So thought to share some of them hope it will help others to get a bunch of them in one post. This is a Q&A-Style tutorial which will cover: Few good icon themes which are used in famous Ubuntu type distros and are available in repository. Look and feel through pictures. How to easily install? I also request others to share their experiences of some awesome icon themes. Once themes are installed Ubuntu-Tweak will help to change and manage them, since I could not find another way to change the themes in Unity. In xfce(Xubuntu) it can be changed from Appearance. Just believe me this post will not be vast. If I'll remove pictures then it will become small, but it will not look good. Please give suggestion to make it small.

    Read the article

  • What are the factors affecting a new programming language?

    - by Saurav Sengupta
    I am developing a new general-purpose programming language of my own design. It's currently my own personal project. I have read of some experts saying that new languages do not usually survive (unfortunately I can't find a reference to that right now). What are the most substantial problems that a new language faces? The language syntax is similar to C/Python families, it does not use S-expressions, and it is an imperative language, but I'm doing first-class functions in it to provide the facilities of currying. In particular, I am concentrating on translating the source language to an intermediate language for execution by an interpreter, but I'm not in a position to translate to native code yet. What would be the issues with that? I've not personally used many non-native code languages, so I'm not well aware of the performance issues on today's machines. I also can't decide upon a lexer and parser generator. What would be the pros and cons of Flex and Yacc vs. hand-made? And what benefits will LLVM provide? I need to get the interpreter ready as quickly as possible. Finally, what factors will affect the language's use post release? I am planning a small library of essentials and full documentation for the first phase.

    Read the article

  • Error while installing phabricator using http://www.phabricator.com/rsrc/install/install_rhel-derivs.sh

    - by Saurav Shah
    The command thats run is yum install httpd git php php-cli php-mysql php-process php-devel php-gd php-pecl-apc php-pecl-json mysql-server I get these errors. How do I fix these? Error: Package: php-devel-5.3.3-3.el6_2.6.x86_64 (rhel6-optional) Requires: php = 5.3.3-3.el6_2.6 Available: php-5.3.3-3.el6.x86_64 (rhel6-base) php = 5.3.3-3.el6 Installing: php-5.3.3-14.el6_3.x86_64 (rhel6-updates) php = 5.3.3-14.el6_3 Error: Package: php-process-5.3.3-3.el6_2.6.x86_64 (rhel6-optional) Requires: php-common = 5.3.3-3.el6_2.6 Available: php-common-5.3.3-3.el6.x86_64 (rhel6-base) php-common = 5.3.3-3.el6 Installing: php-common-5.3.3-14.el6_3.x86_64 (rhel6-updates) php-common = 5.3.3-14.el6_3

    Read the article

  • Attaching a link to back button in php

    - by Prasoon Saurav
    Is there any way by which I can attach the back button of my browser to any particular link? Actually I am designing a login page in PHP. After login I want the back button of my browser to open any particular page that I want, how can I do that in PHP? Actually I am not a PHP guy, so my question might sound silly to some. :P

    Read the article

  • setting default value of superglobal

    - by Prasoon Saurav
    I have been working on a Timesheet Management website. I have my home page as index.php //index.php <?php session_start(); if($_SESSION['logged']=='set') { $x=$_SESSION['username']; echo '<div align="right">'; echo 'Welcome ' .$x.'<br/>'; echo'<a href="logout.php" class="links">&nbsp;<b><u>Logout</u></b></a>' ; } else if($_SESSION['logged']='unset') { echo'<form id="searchform" method="post" action="processing.php"> <div> <div align="right"> Username&nbsp;<input type="text" name="username" id="s" size="15" value="" /> &nbsp;Password&nbsp;<input type="password" name="pass" id="s" size="15" value="" /> <input type="submit" name="submit" value="submit" /> </div> <br /> </div> </form> '; } ?> The problem I am facing is that during the first run of this script I get an error Notice: Undefined index: logged in C:\wamp\www\ps\index.php but after refreshing the page the error vanishes. How can I correct this problem? logged is a variable which helps determine whether the user is logged in or not. When the user is logged in $_SESSION['logged'] is set, otherwise unset. I want the default value of $_SESSION['logged'] to be unset prior to the execution of the script. How can I solve this problem?

    Read the article

  • Phonegap - iOS keyboard is not hiding on outside tap of input field

    - by Prasoon
    On input text focus, keyboard appears as expected. But when I click outside of the input text, keyboard does not hide. I am using java script and jQuery. With jQueryMobile JS and CSS - page behaves correctly. But for this project we are not using jQueryMobile. This problem is only with iOS simulator/device. With Android, it's working perfectly fine. I even tried using document.activeElement.blur(); on outer element click/tap. But then I am unable to focus to input text, because that input text is inside that outer element.

    Read the article

  • Custom Memory Allocator for STL map

    - by Prasoon Tiwari
    This question is about construction of instances of custom allocator during insertion into a std::map. Here is a custom allocator for std::map<int,int> along with a small program that uses it: #include <stddef.h> #include <stdio.h> #include <map> #include <typeinfo> class MyPool { public: void * GetNext() { return malloc(24); } void Free(void *ptr) { free(ptr); } }; template<typename T> class MyPoolAlloc { public: static MyPool *pMyPool; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef T* pointer; typedef const T* const_pointer; typedef T& reference; typedef const T& const_reference; typedef T value_type; template<typename X> struct rebind { typedef MyPoolAlloc<X> other; }; MyPoolAlloc() throw() { printf("-------Alloc--CONSTRUCTOR--------%08x %32s\n", this, typeid(T).name()); } MyPoolAlloc(const MyPoolAlloc&) throw() { printf(" Copy Constructor ---------------%08x %32s\n", this, typeid(T).name()); } template<typename X> MyPoolAlloc(const MyPoolAlloc<X>&) throw() { printf(" Construct T Alloc from X Alloc--%08x %32s %32s\n", this, typeid(T).name(), typeid(X).name()); } ~MyPoolAlloc() throw() { printf(" Destructor ---------------------%08x %32s\n", this, typeid(T).name()); }; pointer address(reference __x) const { return &__x; } const_pointer address(const_reference __x) const { return &__x; } pointer allocate(size_type __n, const void * hint = 0) { if (__n != 1) perror("MyPoolAlloc::allocate: __n is not 1.\n"); if (NULL == pMyPool) { pMyPool = new MyPool(); printf("======>Creating a new pool object.\n"); } return reinterpret_cast<T*>(pMyPool->GetNext()); } //__p is not permitted to be a null pointer void deallocate(pointer __p, size_type __n) { pMyPool->Free(reinterpret_cast<void *>(__p)); } size_type max_size() const throw() { return size_t(-1) / sizeof(T); } void construct(pointer __p, const T& __val) { printf("+++++++ %08x %s.\n", __p, typeid(T).name()); ::new(__p) T(__val); } void destroy(pointer __p) { printf("-+-+-+- %08x.\n", __p); __p->~T(); } }; template<typename T> inline bool operator==(const MyPoolAlloc<T>&, const MyPoolAlloc<T>&) { return true; } template<typename T> inline bool operator!=(const MyPoolAlloc<T>&, const MyPoolAlloc<T>&) { return false; } template<typename T> MyPool* MyPoolAlloc<T>::pMyPool = NULL; int main(int argc, char *argv[]) { std::map<int, int, std::less<int>, MyPoolAlloc<std::pair<const int,int> > > m; //random insertions in the map m.insert(std::pair<int,int>(1,2)); m[5] = 7; m[8] = 11; printf("======>End of map insertions.\n"); return 0; } Here is the output of this program: -------Alloc--CONSTRUCTOR--------bffcdaa6 St4pairIKiiE Construct T Alloc from X Alloc--bffcda77 St13_Rb_tree_nodeISt4pairIKiiEE St4pairIKiiE Copy Constructor ---------------bffcdad8 St13_Rb_tree_nodeISt4pairIKiiEE Destructor ---------------------bffcda77 St13_Rb_tree_nodeISt4pairIKiiEE Destructor ---------------------bffcdaa6 St4pairIKiiE ======Creating a new pool object. Construct T Alloc from X Alloc--bffcd9df St4pairIKiiE St13_Rb_tree_nodeISt4pairIKiiEE +++++++ 0985d028 St4pairIKiiE. Destructor ---------------------bffcd9df St4pairIKiiE Construct T Alloc from X Alloc--bffcd95f St4pairIKiiE St13_Rb_tree_nodeISt4pairIKiiEE +++++++ 0985d048 St4pairIKiiE. Destructor ---------------------bffcd95f St4pairIKiiE Construct T Alloc from X Alloc--bffcd95f St4pairIKiiE St13_Rb_tree_nodeISt4pairIKiiEE +++++++ 0985d068 St4pairIKiiE. Destructor ---------------------bffcd95f St4pairIKiiE ======End of map insertions. Construct T Alloc from X Alloc--bffcda23 St4pairIKiiE St13_Rb_tree_nodeISt4pairIKiiEE -+-+-+- 0985d068. Destructor ---------------------bffcda23 St4pairIKiiE Construct T Alloc from X Alloc--bffcda43 St4pairIKiiE St13_Rb_tree_nodeISt4pairIKiiEE -+-+-+- 0985d048. Destructor ---------------------bffcda43 St4pairIKiiE Construct T Alloc from X Alloc--bffcda43 St4pairIKiiE St13_Rb_tree_nodeISt4pairIKiiEE -+-+-+- 0985d028. Destructor ---------------------bffcda43 St4pairIKiiE Destructor ---------------------bffcdad8 St13_Rb_tree_nodeISt4pairIKiiEE Last two columns of the output show that an allocator for std::pair<const int, int> is constructed everytime there is a insertion into the map. Why is this necessary? Is there a way to suppress this? Thanks! Edit: This code tested on x86 machine with g++ version 4.1.2. If you wish to run it on a 64-bit machine, you'll have to change at least the line return malloc(24). Changing to return malloc(48) should work.

    Read the article

  • Passing arguments via header in php

    - by Prasoon Saurav
    I have got 3 files with me. login.html login_check.php welcome.php In login.html when the username and password is entered and submit button is clicked login_check.php checks whether the username entry is in the database on the basis of $_POST['username'] and some SQL querry. Now I have put the following code at the bottom of login_check.php login_check.php header('Location:welcome.php') But I want to pass $_POST['username'] from login_check.php to welcome.php so that I can make use of $_POST['username'] in my welcome page. Is there any way by which I can pass an argument like in the above case?

    Read the article

  • Difference in behaviour( gcc and MSVC++ )

    - by Prasoon Saurav
    Consider the following code. #include <stdio.h> #include <vector> #include <iostream> struct XYZ { int X,Y,Z; }; std::vector<XYZ> A; int rec(int idx) { int i = A.size(); A.push_back(XYZ()); if (idx >= 5) return i; A[i].X = rec(idx+1); return i; } int main(){ A.clear(); rec(0); puts("FINISH!"); } I couldn't figure out the reason why the code gives segmentation fault on Linux(IDE used: Code::Blocks) whereas on Windows(IDE used : MSVC++) it doesn't. When I used valgrind just to check what actually the problem was, I got this output. I got Invalid write of size 4 at four different places. Then why didn't the code crash when I used MSVC++? Am I missing something?

    Read the article

  • Difference in behaviour (GCC and Visual C++)

    - by Prasoon Saurav
    Consider the following code. #include <stdio.h> #include <vector> #include <iostream> struct XYZ { int X,Y,Z; }; std::vector<XYZ> A; int rec(int idx) { int i = A.size(); A.push_back(XYZ()); if (idx >= 5) return i; A[i].X = rec(idx+1); return i; } int main(){ A.clear(); rec(0); puts("FINISH!"); } I couldn't figure out the reason why the code gives a segmentation fault on Linux (IDE used: Code::Blocks) whereas on Windows (IDE used: Visual C++) it doesn't. When I used Valgrind just to check what actually the problem was, I got this output. I got Invalid write of size 4 at four different places. Then why didn't the code crash when I used Visual C++? Am I missing something?

    Read the article

  • alternative of `die()` in php

    - by Prasoon Saurav
    I have the following script <?php echo "I am alive<br>"; die("I am dying<br>"); echo ("Dead"); ?> The output that I get is I am alive I am dying Is there any way (alternative/substitute of die()) using which the execution of the remaining script be continued?

    Read the article

  • can you make an sql query for this situation?

    - by saurav
    i have a table as below. name and 10 cities in which he lived during his lifetime. name , city1 , city2 , city3 ,city4 , city5 ,city6 , city7 , city8 , city9 city10 suppose for a particular name i want to fetch other names in table matching with maximum number of cities. for example if i want to fetch other people who have lived in three or more cities lived by this person.

    Read the article

1 2  | Next Page >