Search Results

Search found 131 results on 6 pages for 'saurabh agarwal'.

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

  • Shell script task status monitoring

    - by Bikram Agarwal
    I'm running an ANT task in background and checking in 60 second intervals whether that task is complete or not. If it is not, every 60 seconds, a message should be displayed on screen - "Deploy process is still running. $slept seconds since deploy started", where $slept is 60, 120, 180 n so on. There's a limit of 1200 seconds, after which the script will show the log via 'ant log' command and ask the user whether to continue. If the user chooses to continue, 300 seconds are added to the time limit and the process repeats. The code that I am using for this task is - ant deploy & limit=1200 deploy_check() { while [ ${slept:-0} -le $limit ]; do sleep 60 && slept=`expr ${slept:-0} + 60` if [ $$ = "`ps -o ppid= -p $!`" ]; then echo "Deploy process is still running. $slept seconds since deploy started." else wait $! && echo "Application ${New_App_Name} deployed successfully" || echo "Deployment of ${New_App_Name} failed" break fi done } deploy_check if [ $$ = "`ps -o ppid= -p $!`" ]; then echo "Deploy process did not finish in $slept seconds. Here's the log." ant log echo "Do you want to kill the process? Press Ctrl+C to kill. Press Enter to continue." read log limit=`expr ${limit} + 300` deploy_check fi Now, the problem is - this code is not working. This looks like a perfectly good code and yet, this is not working. Can anyone point out what is wrong with this code, please.

    Read the article

  • How to do parrallel processing in Unix Shell script?

    - by Bikram Agarwal
    I have a shell script that transfers a build.xml file to a remote unix machine (devrsp02) and executes the ANT task wldeploy on that machine (devrsp02). Now, this wldeploy task takes around 15 minutes to complete and while this is running, the last line at the unix console is - "task {some digit} initialized". Once this task is complete, we get a "task Completed" msg and the next task in the script is executed only after that. But sometimes, there might be a problem with the weblogic domain and the deployment might be failing internally, with no effect on the status of the wldeploy task. The unix console will still be stuck at "task {some digit} initialized". The error of the deployment will be getting logged in a file called output.a So, what I want now is - Start a time counter before running wldeploy. If the wldeploy runs for more than 15 minutes, the following command should be run - tail -f output.a ## without terminating the wldeploy or cat output.a ## after terminating the wldeploy forcefully Point to be noted here is - I can't run the wldeploy task in background, as in that case the user won't get to know when the task is complete, which is crucial for this script. Could you please suggest anything to achieve this?

    Read the article

  • Can we you the attached properties in C# class library?

    - by Manas Agarwal
    Hi I have implemented the Observer Pattern with lazy load. The class that requests the data from the database is a singleton class. Now I am able to load the data from one database (located in one datacenter) very easily. But I need to get the data from other data centers too and display on the same UI. I can somehow pass the address of second data center and fetch the data from there also. But once I will get the data from second data center, it will be added to earlier list only. So later it will be thought for me to distinguish between the data. So I thought of attaching a property with the result set, so that while displaying the output I can show the data for both the data centers separately but on the same UI. I thought of attached property as an option where I can attach the data center name with the list of the data obtained. How is it possible to do in C#? Thanks Manas

    Read the article

  • find a duplicate entry in an array in constant space and O(n) time [closed]

    - by Anubhav Agarwal
    Possible Duplicate: Algorithm to find a duplicate entry in constant space and O(n) time Given an array of N integer such that only one integer is repeated. Find the repeated integer in O(n) time and constant space. There is no range for the value of integers or the value of N For example given an array of 6 integers as 23 45 67 87 23 47. The answer is 23 (I hope this covers ambiguous and vague part) I searched on the net but was unable to find any such question in which range of integers was not fixed. Also here is an example that answers a similar question to mine but here he created a hash table with the highest integer value in C++.But the cpp does not allow such to create an array with 2^64 element(on a 64-bit computer).

    Read the article

  • Vertically align UILabel

    - by Ashish Agarwal
    I am trying to vertically align the text in the UILabel view of my app. The problem is that I want the text to be vertically aligned to the top and the size of the label to be 280 x 150. I am only able to achieve one of these 2 things. If I remove the line [myLabel sizeToFit]; then the alignment of the text is alright but the size is messed up. But if I add the above line, then the alignment is messed up but the size is alright. How do I fix this problem. I've added the code below - CGRect labelFrame = CGRectMake(22, 50, 280, 150); UILabel *myLabel = [[UILabel alloc] initWithFrame:labelFrame]; [myLabel setText:finalRecipe]; [myLabel setBackgroundColor: [UIColor lightGrayColor]]; [myLabel setNumberOfLines:0]; [myLabel sizeToFit]; [self.view addSubview:myLabel];

    Read the article

  • How to parse SQL files using C# ?

    - by Sunil Agarwal
    Hi, Can anyone please help me? I am having bunch of .sql files. I want to parse (validate) those files before executing them on server. I have many online sites which parse the code. But I want to parse the code using C#. So please can you guide. If there is any tool, dll I need to use. I just want to parse the file and not execute it

    Read the article

  • How to undo SQL changes using installer

    - by Sunil Agarwal
    I have installer to install procedures, scripts, views, etc in SQL server 2005/2008. Now I want to add a condition in the installer like if there is any error while installing, I want to undo all the changes done in SQL server. I tried to store the procedures, views, etc which I am changing while installing and reverting them back if I get any error. But am not able to do it the way I want. Can someone guide me if he had done the same thing? To specify I am using WIX installer. Also if someone has tried SMO, it will be of great help.

    Read the article

  • Can an application on the user's computer be started from a Firefox Extension?

    - by Saurabh Agarwal
    For example, can I start an instance of "Calculator.exe" on the user's computer (if it is available of course) upon some particular event in firefox, say clicking of a button? I thought of perhaps linking the extension to Python's subprocess method using XPCOM. But I was wondering whether there is an easier way. Additional information: I do not, at this point need to interact with the application upon its instantiation. Therefore I am looking for a way to open an application that's all. (Though, out of interest, if you have any pointers to interact with the same as well, that would be great) Thanks!

    Read the article

  • Get items selected from another form

    - by Samarth Agarwal
    Hi I have a Windows Form application. I have a Textbox. I want to implement a functionality like when the user clicks on the textbox, a list should be made available to the user and then the item selected from the list should be filled in the textbox. The list should not be available if some other control is focussed other than the textbox. What would be the better way to do this? Should I implement the list in the same form as the textbox or should I use another form for the list? I want to implement a functionality like in the Tally Accounting Software.

    Read the article

  • Smoothly drag a Sprite in cocos2d - iPhone

    - by Saurabh
    Hi All I have implemented a drag on a sprite object as follows.. -(BOOL)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch * touch = [touches anyObject]; CGPoint location = [[Director sharedDirector] convertCoordinate: [touch locationInView:touch.view]]; [diskSprite setPosition:ccp(location.x , location.y )]; return kEventHandled; } but this dragging is not smooth..... when i drag fast with my thumb the object left from the path. Thanks

    Read the article

  • WebRequest.Create problem

    - by Saurabh
    My requirement is downlaoding a HTTM page. Like and I am using WebRequest.Create. But the line HttpWebRequest request = (HttpWebRequest) WebRequest.Create("http://www.mayosoftware.com"); Is throwinh an exception {"Configuration system failed to initialize"}. I am working in a compmany. Does it due to proxy or anything? But it’s occurring while creation of the URL it self. Exception trace is: at System.Configuration.ConfigurationManager.PrepareConfigSystem() at System.Configuration.ConfigurationManager.GetSection(String sectionName) at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName) at System.Net.Configuration.WebRequestModulesSectionInternal.GetSection() at System.Net.WebRequest.get_PrefixList() at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) Code is like void GetHTTPReq() { Looking forward on it. The complete code is as follows but problem is in the starting itself : \ // used to build entire input StringBuilder sb = new StringBuilder(); // used on each read operation byte[] buf = new byte[8192]; // prepare the web page we will be asking for HttpWebRequest request = (HttpWebRequest) WebRequest.Create("http://www.mayosoftware.com"); // execute the request HttpWebResponse response = (HttpWebResponse) request.GetResponse(); // we will read data via the response stream Stream resStream = response.GetResponseStream(); string tempString = null; int count = 0; do { // fill the buffer with data count = resStream.Read(buf, 0, buf.Length); // make sure we read some data if (count != 0) { // translate from bytes to ASCII text tempString = Encoding.ASCII.GetString(buf, 0, count); // continue building the string sb.Append(tempString); } } while (count > 0); // any more data to read? // print out page source Console.WriteLine(sb.ToString()); }

    Read the article

  • Move to next page if Table can not adjust in current page using iText

    - by Saurabh
    I am generating a PDF report using iText. The report is having four parts as - Project Info1 (A PDF Table of variable height) Project Info2 (A PDF Table of variable height) Requestor Info (A PDF Table of Fixed height) Location Info (A PDF Table of Fixed height) The top two information are of variable height and they can acquire certain pages. The other two are of fixed size which comes at last. I want to move the last (one or both) boxes to the next page if there is no space available to fit those boxes in current page. If space for one box is available then place one to the current page and move other box to the next table. Is there way to decide this?

    Read the article

  • Whats the difference between Command Parameters and Menu Contribution Parameters

    - by Saurabh
    I can see that parameters can be defined for Commands defined using the Commands extension point. I can not define a value for these command parameters. I can also define parameters under the Command element in the menus extension point when defining menu contributions. I can define a value for the parameter here. Are the command parameters in Command different from parameters in menu contributions? If they are different how are they different?

    Read the article

  • What are the worst working conditions you have written code in?

    - by Saurabh Sawant
    There are good times and there are worst times. I recently had to write code in a hot room with temperatures near 107°F (42°C); nothing to sit on; 64 Kbps inconsistent internet connection; warm water for drinking and a lot of distractions and interruptions. I am sure many people have been in similar situations and I would like to know your experiences. More experiences at HackerNews about the same topic. Even more experiences at Slashdot about the same subject.

    Read the article

  • iPhone apps causing battery to drain out

    - by saurabh
    Hi, Recently my iPhone battery started to discharge in just one day. I do not use my iPhone much (less than 1 hour a day). and then while discussing it with couple of colleagues, I heard that there are some apps which even if installed on your iPhone can cause your battery to drain out faster. It does not matter if you are not using those apps, only having them installed was enough to cause battery drain. I have heard this from couple of my techie friends as well and thus had to put some credibility to it. Being an iPhone developer, I don't think that is possible. Do you think if this is possible for an app to cause battery drain just by being installed there on iPhone?

    Read the article

  • SQLITE problem in rowid

    - by Saurabh
    I am using SQLite C# library and as per my requirement, before going to add I am retreving the rowid of that table. It is working fine but hetting error when table is empty. Once we add any data(a row) then it’s working fine . mDbCon = GetConnection(); SQLiteCommand cmd = mDbCon.CreateCommand(); cmd.CommandText = " SELECT MAX(rowid) FROM " + “MYTABLE”; cmd.CommandType = CommandType.Text; mDbCon.Open(); SQLiteDataReader sqReader = cmd.ExecuteReader(); while (sqReader.Read()) { if ( sqReader.IsDBNull(0) ) { max = (Int32)sqReader.GetInt32(0); } } mDbCon.Close(); It’s throwing exception when table “MYTABLE” don’t have any data.

    Read the article

  • Devise not allowing active resource to access the services

    - by Saurabh Pandit
    In my application there are two folders one for a rails application and another for a ruby application. In the ruby folder I have created a ruby file in which I have written code to access some model which is present in the rails application using active resource. Sample code is shown below : active_resource_example.rb require 'rubygems' require 'active_resource' class Website < ActiveResource::Base self.site = "http://localhost:3000/admin/" self.user = "user" self.password = "password" end websites = Website.find(:all) puts websites.inspect In my rails application I have used ActiveAdmin gem which uses devise for authentication. On rails Server I get the following result : Started GET "/admin/websites.json" for 192.168.1.37 at 2011-11-12 14:41:06 +0530 Processing by Admin::WebsitesController#index as JSON Completed in 43ms And on my terminal where I executed active_resource_example.rb, I got following error : user@user:~/Desktop$ ruby active_resource_example.rb /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:132:in `handle_response': Failed. Response code = 401. Response message = Unauthorized . (ActiveResource::UnauthorizedAccess) from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:115:in `request' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:80:in `block in get' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:218:in `with_auth' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:80:in `get' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/base.rb:894:in `find_every' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/base.rb:806:in `find' from active_resource_example.rb:12:in `<main>' user@user:~/Desktop$ I tried this with another application in which Devise authentication is not used with the same configuration I used in active_resource_example.rb, there I got the result. Desperately need some solution to this issue.

    Read the article

  • WCF method called twice

    - by Saurabh Lalwani
    Hi, I have a web service which is returning data to the desktop application. The problem I am having is, when the web service returns small volume of data everything works fine but when the volume of data is large it throws the following exception: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. And when I am debugging the web service, I see that this particular method is called twice. It executes the return statement 1st time nothing happens, but when it does execute it for the second time the above mentioned exception is thrown in the desktop app. I found similar posts before on stackoverflow but they did not solve my problem. Can anybody please tell me what's going on in here? Thanks!

    Read the article

  • jerky scrolling in NSTableView

    - by Saurabh
    Hello All, I have a NSTableView with around 70 - 80 rows, each row contain a checkbox, title text and a drop down menu to select data. The problem i am facing is that when i scroll the table it does not scroll smooth. When i remove the NSComboBoxCell it works ok. Here is the code i used to add NSComboBoxCell - NSTableColumn* checkColumn = [tblEditData tableColumnWithIdentifier:@"Timer"]; NSCell *aCell = [aTableColumn dataCellForRow:rowIndex]; [aCell setState:3]; NSComboBoxCell *comboBoxCell = [NSComboBoxCell new]; [comboBoxCell addItemWithObjectValue:@"Timer"]; [comboBoxCell addItemWithObjectValue:@"1"]; [comboBoxCell addItemWithObjectValue:@"3"]; [comboBoxCell addItemWithObjectValue:@"6"]; [comboBoxCell addItemWithObjectValue:@"9"]; [comboBoxCell addItemWithObjectValue:@"12"]; [comboBoxCell setStringValue:aDataRow1.timer_val]; [checkColumn setDataCell:comboBoxCell]; return comboBoxCell; Please advice what should i do to remove the jerky scrolling. Thanks

    Read the article

  • add sub view in center - iPad

    - by Saurabh
    Hello All, I want to add a sub view in current view, this sub view is 300x300. When I add subview using [self.view addSubview:md.view]; the md.view will appear at position (0,0) is there any way to add subview in center? Thanks

    Read the article

  • whats wrong in this LINQ synatx?

    - by Saurabh Kumar
    Hi, I am trying to convert a SQL query to LINQ. Somehow my count(distinct(x)) logic does not seem to be working correctly. The original SQL is quite efficient(or so i think), but the generated SQL is not even returning the correct result. I am trying to fix this LINQ to do what the original SQL is doing, AND in an efficient way as the original query is doing. Help here would be really apreciated as I am stuck here :( SQL which is working and I need to make a comparable LINQ of: SELECT [t1].[PersonID] AS [personid] FROM [dbo].[Code] AS [t0] INNER JOIN [dbo].[phonenumbers] AS [t1] ON [t1].[PhoneCode] = [t0].[Code] INNER JOIN [dbo].[person] ON [t1].[PersonID]= [dbo].[Person].PersonID WHERE ([t0].[codetype] = 'phone') AND ( ([t0].[CodeDescription] = 'Home') AND ([t1].[PhoneNum] = '111') OR ([t0].[CodeDescription] = 'Work') AND ([t1].[PhoneNum] = '222') ) GROUP BY [t1].[PersonID] HAVING COUNT(DISTINCT([t1].[PhoneNum]))=2 The LINQ which I made is approximately as below: var ids = context.Code.Where(predicate); var rs = from r in ids group r by new { r.phonenumbers.person.PersonID} into g let matchcount=g.Select(p => p.phonenumbers.PhoneNum).Distinct().Count() where matchcount ==2 select new { personid = g.Key }; Unfortunately, the above LINQ is NOT generating the correct result, and is actually internally getting generated to the SQL shown below. By the way, this generated query is also reading ALL the rows(about 19592040) around 2 times due to the COUNTS :( Wich is a big performance issue too. Please help/point me to the right direction. Declare @p0 VarChar(10)='phone' Declare @p1 VarChar(10)='Home' Declare @p2 VarChar(10)='111' Declare @p3 VarChar(10)='Work' Declare @p4 VarChar(10)='222' Declare @p5 VarChar(10)='2' SELECT [t9].[PersonID], ( SELECT COUNT(*) FROM ( SELECT DISTINCT [t13].[PhoneNum] FROM [dbo].[Code] AS [t10] INNER JOIN [dbo].[phonenumbers] AS [t11] ON [t11].[PhoneType] = [t10].[Code] INNER JOIN [dbo].[Person] AS [t12] ON [t12].[PersonID] = [t11].[PersonID] INNER JOIN [dbo].[phonenumbers] AS [t13] ON [t13].[PhoneType] = [t10].[Code] WHERE ([t9].[PersonID] = [t12].[PersonID]) AND ([t10].[codetype] = @p0) AND ((([t10].[codetype] = @p1) AND ([t11].[PhoneNum] = @p2)) OR (([t10].[codetype] = @p3) AND ([t11].[PhoneNum] = @p4))) ) AS [t14] ) AS [cnt] FROM ( SELECT [t3].[PersonID], ( SELECT COUNT(*) FROM ( SELECT DISTINCT [t7].[PhoneNum] FROM [dbo].[Code] AS [t4] INNER JOIN [dbo].[phonenumbers] AS [t5] ON [t5].[PhoneType] = [t4].[Code] INNER JOIN [dbo].[Person] AS [t6] ON [t6].[PersonID] = [t5].[PersonID] INNER JOIN [dbo].[phonenumbers] AS [t7] ON [t7].[PhoneType] = [t4].[Code] WHERE ([t3].[PersonID] = [t6].[PersonID]) AND ([t4].[codetype] = @p0) AND ((([t4].[codetype] = @p1) AND ([t5].[PhoneNum] = @p2)) OR (([t4].[codetype] = @p3) AND ([t5].[PhoneNum] = @p4))) ) AS [t8] ) AS [value] FROM ( SELECT [t2].[PersonID] FROM [dbo].[Code] AS [t0] INNER JOIN [dbo].[phonenumbers] AS [t1] ON [t1].[PhoneType] = [t0].[Code] INNER JOIN [dbo].[Person] AS [t2] ON [t2].[PersonID] = [t1].[PersonID] WHERE ([t0].[codetype] = @p0) AND ((([t0].[codetype] = @p1) AND ([t1].[PhoneNum] = @p2)) OR (([t0].[codetype] = @p3) AND ([t1].[PhoneNum] = @p4))) GROUP BY [t2].[PersonID] ) AS [t3] ) AS [t9] WHERE [t9].[value] = @p5 Thanks!

    Read the article

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